You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by "Litton, Tom - CEPM" <To...@cepm-us.com> on 2006/05/01 22:48:15 UTC

A few redelivery questions

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?  I'm setting the XML file location using the property brokerXmlConfig and calling the method ActiveMQConnectionFactory.setProperties.  Does this still work in 4.0?  It looks like this is how ActiveMQInitialContextFactory creates it's connections, so i assume so.
 
 
 
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?
 
 
3.  It looks like the back off multiplier isn't taking effect.  I printed out some debug data and here is what i got:
Redeliverying message after delay 1000
Rollback counter: 5
Init delay: 1000
back off multi: 5
 
After the 5th rollback, the delay is still the same as the initial delay (1000).  I'm still debugging this, so I'll let you know if I find out anything.  
 
Thanks for any help you can provide.
 
Tom


----------------------------------------------------------------------
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.


Re: A few redelivery questions

Posted by James Strachan <ja...@gmail.com>.
On 5/1/06, Litton, Tom - CEPM <To...@cepm-us.com> 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" />

BTW I've just checked the source code - AFAIK the redelivery policy is
not used on the server side - its purely on the client side - so this
entry will be ignored.

(we should really generate a warning if there are XML elements ignored
in XBean).

Your best bet to configure the redelivery policy is via the
ActiveMQConnectionFactory...
http://www.activemq.org/Message+Redelivery+and+DLQ+Handling

Unless you are using Jencks/MDPs
http://www.activemq.org/Resource+Adapter+Properties

--

James
-------
http://radio.weblogs.com/0112098/

Re: A few redelivery questions

Posted by James Strachan <ja...@gmail.com>.
On 5/1/06, Litton, Tom - CEPM <To...@cepm-us.com> 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

http://activemq.org/How+do+I+embed+a+Broker+inside+a+Connection


> 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.

--

James
-------
http://radio.weblogs.com/0112098/