activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <>
Subject Re: Failover causes duplicate messages
Date Wed, 24 Feb 2010 23:58:58 GMT
On Wed, Feb 24, 2010 at 2:31 PM, Josh Carlson <> wrote:
> Hi Gary,
> Thanks for the explanation. The order is:
>    consumer retrieves message
>    connection is lost and consumer re-establishes connection to new master
> broker
>    consumer acks the message retrieved from the former broker
>    consumer retrieves the same message it just ack'ed.
> I guess the question is ... is there a way for the new broker on failover to
> recognize the consumers that have retrieved message but not ack'ed messages
> and behave exactly as if they were retrieved from itself (not redispatch
> unless the connection to the consumer is lost)? I suppose that would require
> some heuristics to determine how long to wait before those original
> consumers reconnect.

Given the sequence that you listed above, the redispatch of the
messages is correct as Gary explained. Given the loss of the
connection, the broker will redispatch any pending messages. Any
messages that the client received from the lost connection that are
unacked cannot be acked using the new connection (i.e., the client
can't just hold those messages and swap the underlying connection).

perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"

ActiveMQ in Action:

View raw message