activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kieran1 <>
Subject Master Slave and Failover - pefetched messages are lost
Date Tue, 28 Nov 2006 22:11:57 GMT

I am testing pure master/slave with 4.0.1 and 4.0.2 with this scenario:

1. start the master and slave brokers
2. start a producer, sent 50 messages to a Queue, stop the producer
3. start a consumer, let it consume 20 messages from the Queue
4. kill the master broker, see that the consumer reconnects to the slave
5. let the consumer consumer 10 more messages from the queue
6. kill the consumer
7. start a new consumer, expect that it will consume the remaining 20
messages from the Queue
8. restart the producer, send more messages, expect that those messages will
not be consumed until all 50 of the first messages have been consumed

Note that the consumer prefetches messages from the original master.  

If I set the prefetch limit to 1000, meaning that the first consumer will
prefetch all 50 messages from the original master before the failover, I
find again the behavior described in the linked thread but also that the
second consumer will NOT receive the remaining 20 original messages.  If I
stop the first consumer after the failover but before it has consumed all of
its prefetched messages, then those messages are lost.

If I set the prefetch limit to 1, then I find the behavior described in this
thread: on
the first consumer -- including the potential for new messages to be
consumed before the first 50 are consumed, but the second consumer will
consume the remaining 20 messages.

View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message