You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Steve <St...@bmc.com> on 2016/12/10 17:49:38 UTC

how to configure a competing consumers Queue

Hello,

I am new to ActiveMQ.  I notice that the broker seems to use a round-robing
algorithm for distributed messages to different consumers on a given queue. 
I am interested in using a competing-consumers algorithm for the
distribution instead if possible.  I found a mention of this in the
associated Camel docs here:

http://camel.apache.org/competing-consumers.html

I don't understand the configuration details in the example however.

Thanks in advance,
Steve



--
View this message in context: http://activemq.2283324.n4.nabble.com/how-to-configure-a-competing-consumers-Queue-tp4720115.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: how to configure a competing consumers Queue

Posted by Steve <St...@bmc.com>.
Thanks I will try that.



--
View this message in context: http://activemq.2283324.n4.nabble.com/how-to-configure-a-competing-consumers-Queue-tp4720115p4720277.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: how to configure a competing consumers Queue

Posted by Tim Bain <tb...@alumni.duke.edu>.
ActiveMQ only round-robins when consumers have available space in their
respective prefetch buffers.  Once all consumers have full prefetch
buffers, the broker will dispatch the next message to whichever consumer
creates available space in their prefetch buffer by consuming a message,
resulting in competing consumers.

So the key to achieving what you want is to set each consumer's prefetch
buffer very small (to zero, for strict competing consumers, or to a small
number such as 1, if you need the performance benefits that prefetch can
provide in certain circumstances such as a high-latency network) so the
broker follows the competing consumers paradigm as soon as possible.

Tim

On Dec 10, 2016 12:53 PM, "Steve" <St...@bmc.com> wrote:

Hello,

I am new to ActiveMQ.  I notice that the broker seems to use a round-robing
algorithm for distributed messages to different consumers on a given queue.
I am interested in using a competing-consumers algorithm for the
distribution instead if possible.  I found a mention of this in the
associated Camel docs here:

http://camel.apache.org/competing-consumers.html

I don't understand the configuration details in the example however.

Thanks in advance,
Steve



--
View this message in context: http://activemq.2283324.n4.
nabble.com/how-to-configure-a-competing-consumers-Queue-tp4720115.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.