You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by dimitry12 <di...@pletnikov.com> on 2013/12/11 18:29:30 UTC

Request for clarification: strictOrderDispatch="true" vs Exclusive Consumers - for queues

Hello! I'd like to confirm my understanding of dispatch policies in ActiveMQ.

When we deal with *queues* and have strictOrderDispatch="true" set in
policyEntry - then ActiveMQ ensures that all messages are processed strictly
in order. If there are multiple consumers then:
- ActiveMQ will feed #prefetch-limit messages to the first consumer
- wait until this consumer acknowledges/processes all prefetched messages
- after that: feed messages to the next consumer
- wait.. repeat..
Is the above description generally correct?

If we deal with queues and have an exclusive consumer, then (ignoring
priorities for now) ActiveMQ feeds all messages to this consumer and all
other consumers get nothing. Thus effectively messages are processed
strictly in order.

My understanding is: for queues both strictOrderDispatch and exclusive
consumer produce the same effect = messages are processed strictly in order.
Please, correct me if I'm wrong.

Thanks!



--
View this message in context: http://activemq.2283324.n4.nabble.com/Request-for-clarification-strictOrderDispatch-true-vs-Exclusive-Consumers-for-queues-tp4675408.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Request for clarification: strictOrderDispatch="true" vs Exclusive Consumers - for queues

Posted by dimitry12 <di...@pletnikov.com>.
Thank you for your response.

My experience was slightly different: with normal dispatch (not
strictOrderDispatch) and several consumers they were prefetching the
messages.

I even got into situation, when with few messages in the queue, with normal
dispatch, the first consumer was prefetching everything and other consumers
were doing nothing.

What do you think could make the normal dispatch do prefetch? In my case I
could observe one-by-one round-robin dispatch only when I explicitly set
prefetchSize to 1.

Thanks!





--
View this message in context: http://activemq.2283324.n4.nabble.com/Request-for-clarification-strictOrderDispatch-true-vs-Exclusive-Consumers-for-queues-tp4675408p4675867.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: Request for clarification: strictOrderDispatch="true" vs Exclusive Consumers - for queues

Posted by Gary Tully <ga...@gmail.com>.
strictOrderDispatch does not wait for acks. Given 2 consumers(c),
normal dispatch would round robin to each consumer, m0 to c0, m1 to
c1, m2 to c0 etc.
With strictOrderDispatch, m0-N (where N = c0's prefetch Value)  will
go to c0, then c1 will get any remaining messages up to its prefetch,
etc. So prefetch has a big bearing, a really large prefetch would make
c0 effectively exclusive.
With exclusive consumer, only one of c0 or c1 will be considered active.

On 11 December 2013 17:29, dimitry12 <di...@pletnikov.com> wrote:
> Hello! I'd like to confirm my understanding of dispatch policies in ActiveMQ.
>
> When we deal with *queues* and have strictOrderDispatch="true" set in
> policyEntry - then ActiveMQ ensures that all messages are processed strictly
> in order. If there are multiple consumers then:
> - ActiveMQ will feed #prefetch-limit messages to the first consumer
> - wait until this consumer acknowledges/processes all prefetched messages
> - after that: feed messages to the next consumer
> - wait.. repeat..
> Is the above description generally correct?
>
> If we deal with queues and have an exclusive consumer, then (ignoring
> priorities for now) ActiveMQ feeds all messages to this consumer and all
> other consumers get nothing. Thus effectively messages are processed
> strictly in order.
>
> My understanding is: for queues both strictOrderDispatch and exclusive
> consumer produce the same effect = messages are processed strictly in order.
> Please, correct me if I'm wrong.
>
> Thanks!
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Request-for-clarification-strictOrderDispatch-true-vs-Exclusive-Consumers-for-queues-tp4675408.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
http://redhat.com
http://blog.garytully.com