activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Lewandowski <>
Subject Redelivery policy not honored
Date Tue, 10 Jul 2007 20:09:17 GMT
At what level does the redelivery policy get applied? I've got a 
transactional consumer (Spring MDP) that is performing a rollback and I 
am expecting the message to be redelivered a maximum number of times as 
specified on the connection factory's redelivery policy. After the 
maximum retry attempts, I'm expecting to see the message sent to the 
dead letter queue as specified in the broker's destination policy map.
Instead, the message gets delivered over and over again, with an 
increasing value for the JMSXDeliveryCount message property and never 
gets placed on the dead letter queue. It looks as if the redelivery 
policy isn't being honored.
The only place I could find in the code where the redelivery policy is 
applied is at the MessageConsumer level (ActiveMQMessageConsumer). This 
doesn't make sense to me since a different consumers could get the 
message on repeated delivery attempts, correct? Spring's message 
listener framework seems to confirm this as it uses a polling model, 
creating a new MessageConsumer and Session once per second 
(AbstractPollingMessageListenerContainer). Does AMQ expect that the same 
MessageConsumer will be used for message redelivery in a transactional 

Connection Factory:
    <bean id="jmsConnectionFactory"
        <property name="brokerURL" value="vm://broker" />
        <property name="redeliveryPolicy">
            <bean class="org.apache.activemq.RedeliveryPolicy">
                <property name="maximumRedeliveries" value="2" />

    <broker brokerName="broker" persistent="true" useJmx="false"
        start="true" xmlns="">
                     <policyEntry queue="EventQueue">
queuePrefix="DEAD" />
            <transportConnector uri="vm://broker" />

View raw message