Reputation: 112
How do I limit the amount of times a JMS DefaultMessageListenerContainer will retry a message with SpringBoot and ActiveMQ.( I know we can achieve this using JMSXDeliveryCount property in IBM MQ messageListener).
Upvotes: 1
Views: 1340
Reputation: 22279
The easiest approach is to use the RedeliveryPolicy
available in for ActiveMQ. To use it with spring boot, you could enable it as query params on the Broker URL.
tcp://localhost:61616?jms.redeliveryPolicy.maximumRedeliveries=5
You can tweak other features, such as time between redelivery etc with the options described in activemq.apache.org/redelivery-policy.html.
Upvotes: 1