activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spiderman2 <>
Subject Dispatch Policy Question
Date Fri, 27 Apr 2007 22:16:00 GMT

I have a simple scenario and a question on behaviour.


1 Broker with 50 messages and 2 consumers (consumer.prefetchSize=0) of its
queue. (CLIENT_ACK mode)

The first consumer continuously pulls 1 message and closes & reopens session
(to simulate continuous failures). This correctly causes subsequent message
to be resent to the broker to be dispatched to another consumer.

The second consumer simply receives messages and acknowledges.

Messages 2-50 are appropriately by the second consumer. But the 1st message
continuously goes to the first consumer UNTIL messages 2-50 are consumed by
the 2nd consumer. Only then is Message 1 dispatched to the 2nd consumer.

My problem is, if the Broker knows Consumer 1 is having problems, and
correctly sent ALL messages to consumer 2, why doens't it do this for
message 1 as well. If the queue never empties, message 1 will continuously
retry on consumer 1, rather than going to another consumer. How can I get it
to try another consumer during this simulated failurefor the 1st message.

PS: I could use a code snippet or example for round robbin dispatching. I
don't want to use xml to configure my broker.
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message