nonono
nonono

Reputation: 76

How to config max-delivery-attempts for Spring Boot with Embedded ActiveMQ Artemis?

I would like to config the max-delivery-attempts of dead letter as described in the manual.

I tried Spring Boot with embedded ActiveMQ Artemis JMS server, but cannot figure out how to set max-delivery-attempts value.

Upvotes: 2

Views: 623

Answers (1)

nonono
nonono

Reputation: 76

After debugging the Configuration instance I finally find the method. Here's the code:

@Configuration
public class RedeliveryConfiguration implements ArtemisConfigurationCustomizer {

    @Override
    public void customize(org.apache.activemq.artemis.core.config.Configuration configuration) {
        Map<String, AddressSettings> addressesSettings = configuration.getAddressesSettings();

        // # is the catch all address or default address
        addressesSettings.get("#").setMaxDeliveryAttempts(2);
    }
}

Upvotes: 3

Related Questions