activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "" <>
Subject Concurrent consumers
Date Sun, 14 Nov 2010 01:35:52 GMT


I am facing a strange behaviour when running some test clients on 5.4.1
(also the same on 5.3.0).
I first run a producer that sends some messages to a queue. Then I launch
another client that creates two consumers for consuming the messages from
the queue.

The consumers are implemented in a class that creates a connection, session
and queue receiver on the
constructor.  It includes a separate method for starting the connection. It
also has the onMessage method.

The two consumer objects are created. and then their connections can be
started independently. The
problem is that only the first consumer has its onMessage called. If I don't
start the first consumer's
connection and start the connection on the second, no messages are received
by it.

Is this behaviour correct ? Is it possible to have concurrent consumers ?

For anyone that wants to test the example I have posted the source code on
the net :

producer (for producing the messages) :
concurrent consumers (the problem reproduction) :

To use it start the broker from the distribution (running the bin/activemq
script). But before edit the file
conf/activemq.xml and edit the destinationPolicy element and set
producerFlowControl to false.

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

View raw message