We're using ActiveMQ 5.14.2.1 triggered by the Java Windows service wrapper, accessing from a Tomcat webapp using JMS and the Spring framework JMS (v4.3.28).
I'm trying to configure a redelivery policy so that when we return the message to the queue using session.rollback()
it follows the policy. To do this, I set up the redeliveryPlugin
in the activemq.xml
file as follows:
<amq:redeliveryPlugin fallbackToDeadLetter="true" sendToDlqIfMaxRetriesExceeded="true">
<amq:redeliveryPolicyMap>
<amq:redeliveryPolicyMap>
<amq:defaultEntry>
<amq:redeliveryPolicy maximumRedeliveries="20" useExponentialBackOff="true"
initialRedeliveryDelay="1000" redeliveryDelay="2000" maximumRedeliveryDelay="600000"/>
</amq:defaultEntry>
</amq:redeliveryPolicyMap>
</amq:redeliveryPolicyMap>
</amq:redeliveryPlugin>
I also updated the broker element to turn on schedulerSupport:
<amq:broker brokerName="MyBroker" dataDirectory="${activemq.data}"
useJmx="false" schedulerSupport="true">
I've tried a few permutations of this based on various documentation pages and several SO results, without success. Whatever I try it's using the default redelivery behavior (1 second between, no exponential backoff, max of 6 retries). I know it's reading this activemq.xml
file, because when I put content that doesn't match the XSD it errors out.
What do I have to do to alter ActiveMQ's redelivery policy?