activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Litton, Tom - CEPM" <>
Subject RE: A few redelivery questions
Date Tue, 02 May 2006 15:04:14 GMT
Thanks for the quick replies James.

I have one more problem with the redelivery.  

Durring the rollback, the consumer registeres a task to start itself after a certain delay.
 The messages are then put back on the queue for redelivery.  The problem is the consumer
is never stopped.  The result is that their is no delay.  The messages get processed immediantly
after they are requeued.  

I changed the code to stop the consumer before the messages are requeued.  Is their a better
solution?  This solution will have problems if the consumer is (permenantly) stopped during
the delay, because it will just restart again afterwards.   

Thanks again for all your help.

-----Original Message-----
From: James Strachan []
Sent: Tuesday, May 02, 2006 8:56 AM
Subject: Re: A few redelivery questions

On 5/1/06, Litton, Tom - CEPM <> wrote:
> I have a few questions about how messages get redelivered. I'm using an embedded broker
(in tomcat).  The version is 4.0 RC3.
> 1.  How do you configure the redelivery delay for all queues.  Right now i have the configuration:
>     <destinationPolicy>
>       <policyMap>
>         <policyEntries>
>           <policyEntry queue="*">
>             <redeliveryPolicy initialRedeliveryDelay="10000" useExponentialBackOff="true"
backOffMultiplier="5" maximumRedeliveries="5" />
>           </policyEntry>
>         </policyEntries>
>       </policyMap>
>     </destinationPolicy>
> But it seems to have no effect.  The redelivery delay is still 1 second.  Should I specify
">" or "*.>" for all queues?

Use > for all queues.

I'm guesing the queue name has a dot in it right?

>  I'm setting the XML file location using the property brokerXmlConfig and calling the
method ActiveMQConnectionFactory.setProperties.  Does this still work in 4.0?

No, I'm afraid not.

The best way to create an embedded broker from an XML configuration
file is to either use the BrokerFactoryBean in your spring.xml or just
use the BrokerService POJO directly

> 2.  The redelivery policy seems to take effect on calls to Session.recover and Session.rollback.
 What happens to the unacknowledged messages if neither of those methods get called?  Will
they ever get redelivered before the broker is restarted?

Yes - redelivery happens when a session is closed (or a client
disconnects) - then any messages delivered to a consumer/session that
are not acknowledged will get redelivered.

Using the inactivity monitor, you can get the broker to kill any
'hung' clients to ensure messages are redelivered promptly if a client
locks up.



The information contained in this transmission is intended only for
the personal and confidential use of the designated recipients named
herein.  If the reader of this transmission is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
transmission in error, and that any review, dissemination,
distribution, or copying of this transmission is strictly prohibited.
If you have received this communication in error, please notify the
sender and return and delete the original transmission immediately.
Thank you.

View raw message