1

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.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
nonono
  • 46
  • 1
  • 5

1 Answers1

1

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);
    }
}
Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
nonono
  • 46
  • 1
  • 5