activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marek Neumann <>
Subject RedeliveryPolicy not working with Springs DefaultMessageListenerContainer
Date Mon, 14 Nov 2011 14:09:20 GMT

we set up an ActiveMQ Spring configuration:

<bean id="queueConnectionFactory"
       <property name="connectionFactory">
          <bean class="org.apache.activemq.ActiveMQConnectionFactory">
            <property name="brokerURL">
         <property name="redeliveryPolicy" ref="amqRedeliveryPolicy" />

with a defined Redelivery Policy:

<bean id="amqRedeliveryPolicy" class="org.apache.activemq.RedeliveryPolicy">
      <property name="useExponentialBackOff" value="true" />
      <property name="backOffMultiplier" value="2" />
      <property name="initialRedeliveryDelay" value="1000" />
      <property name="maximumRedeliveries" value="5" />

We are using Springs DefaultMessageListenerContainer.

Problem is that the redelivery works but without using the additional
configured params (message is redelivered with very short intervals
until the maximum is reached, then sent to DLQ). When debugging we found
out that the redelivery delay is calculated in ActiveMQMessageConsumer.
However, there are different consumers available, so it always gets
initialized with the default value:

if (currentRedeliveryCount > 0) {
     redeliveryDelay =
} else {
     redeliveryDelay = redeliveryPolicy.getInitialRedeliveryDelay();

Does somebody have an idea how to make this work? Is there any
configuration problem? We have also tried to set the "cacheLevelName" as
recommended in some threads - without success.



View raw message