activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Baker (Commented) (JIRA)" <>
Subject [jira] [Commented] (AMQ-3285) ActiveMQXAConnectionFactory does not respect various parameters for redelivery policy
Date Wed, 18 Apr 2012 15:24:40 GMT


John Baker commented on AMQ-3285:


I've got some information to add. I've debugged this and find the following code being (correctly?)
executed in ActiveMQMessageConsumer when a message is rolled back:

                    if (redeliveryDelay > 0 && !unconsumedMessages.isClosed())
                        // Start up the delivery again a little later.
                        scheduler.executeAfterDelay(new Runnable() {
                            public void run() {
                                try {
                                    if (started.get()) {
                                } catch (JMSException e) {
                        }, redeliveryDelay);

The value of redeliveryDelay (in ms) is correct. However, the "problem" is the Spring DefaultMessageListener,
which asks ActiveMQ for another message and it gives back the message waiting for redelivery.
I can see that the thread has the same ID in the debugger, so I think the problem is better
described as:

"ActiveMQ does not remove the message due for redelivery from the queue, but gives it out
next time it's asked to do so. After X retries, it's moved to the DLQ and hence the listener
will not receive it again when it asks for the next message".

This is a very serious problem.

> ActiveMQXAConnectionFactory does not respect various parameters for redelivery policy
> -------------------------------------------------------------------------------------
>                 Key: AMQ-3285
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.4.0, 5.4.2, 5.5.0
>            Reporter: Jaskirat Bhatia
>         Attachments:,
> I tried to add these following parameters to my redelivery policy and activeMQ is not
respecting any of them except maximumRedelivery
> <spring:bean id="redeliveryPolicy" class="org.apache.activemq.RedeliveryPolicy">
> 			<spring:property name="maximumRedeliveries" value="5"/>
> 			<spring:property name="initialRedeliveryDelay" value="5000"/>
> 						<spring:property name="redeliveryDelay" value="2000"/>
> 			<spring:property name="useExponentialBackOff" value="true"/>
> 			<spring:property name="backOffMultiplier" value="2"/>
> 		</spring:bean>
> I have attached the project which I took from
and added the above parameter to my brokerURL:
> tcp://localhost:5000?jms.redeliveryPolicy.maximumRedeliveries=3&jms.redeliveryPolicy.initialRedeliveryDelay=10000&jms.redeliveryPolicy.deliveryDelay=10000&jms.redeliveryPolicy.useExponentialBackOff=true&jms.redeliveryPolicy.backOffMultiplier=2
> This test case will show you that none of the parameters like initiaRedeliveryDelay etc
will take effect, except maxRedeliveries

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message