Hi,

we set up an ActiveMQ Spring configuration:

<bean id="queueConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
       <property name="connectionFactory">
          <bean class="org.apache.activemq.ActiveMQConnectionFactory">
            <property name="brokerURL">
               <value>${amq.broker.url}</value>
            </property>
         <property name="redeliveryPolicy" ref="amqRedeliveryPolicy" />
       </bean>
      </property>
   </bean>

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" />
</bean>

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 =
redeliveryPolicy.getNextRedeliveryDelay(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.

Thanks,

Marek

Reply via email to