activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Davies <rajdav...@gmail.com>
Subject Re: Concurrent consumers
Date Sun, 14 Nov 2010 19:18:38 GMT
Yes - you can have concurrent consumers - looks like you've fallen victim to prefetch subscription
- http://activemq.apache.org/what-is-the-prefetch-limit-for.html
I suggest you use a prefetch of 1

cheers,

Rob


Rob Davies
follow me: http://twitter.com/rajdavies
I work here: http://fusesource.com
My Blog: http://rajdavies.blogspot.com/
I wrote this: http://www.manning.com/snyder/




On 14 Nov 2010, at 01:35, daniel.dlds@gmail.com wrote:

> 
> Hello,
> 
> 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) : http://pastebin.com/dmhSExJK
> concurrent consumers (the problem reproduction) :
> http://pastebin.com/tgXh4M83
> 
> 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: http://activemq.2283324.n4.nabble.com/Concurrent-consumers-tp3041439p3041439.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.




Mime
View raw message