activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: If I want to rollback a message
Date Fri, 27 Apr 2007 14:54:58 GMT
On 4/26/07, spiderman2 <shawn.gandhi@bridgewatersystems.com> wrote:
>
> What are my options for the following requirement:
>
> Step 1: A consumer gets a message from a broker's queue (which will likely
> use roundrobin).
> Step 2: It realizes that it doesn't want this particular message at this
> time, so the broker should deliver it to another consumer.

Transacted sessions are the only real way to undeliver a message; but
then the JMS client will replay the messsage N times before its really
failed back to the broker (based on the RedeliveryPolicy). You could
just wait until the time is right to be able to consume the message?


Generally speaking, its considered bad form to consume messages then
realise they're not for you and try to un-deliver them. You really
should use selectors to filter out what you need. If for whatever
reason you can't use selectors then you should place the message on a
different queue for 'someone else' to process (so that its then easy
to filter out yourself from getting the message again). i.e. using the
the 'undeliver' approach its very easy for messages to be continuously
delivered to the wrong consumer & cause loads of unnecessary work.

-- 
James
-------
http://macstrac.blogspot.com/

Mime
View raw message