[rabbitmq-discuss] AMQP ack with multiple subscribers

Colin Z theczintheroc2007 at gmail.com
Thu Oct 15 15:18:40 BST 2009


Thanks Marek and Tony,

Sorry to belabor the question, but I just want to make sure I understand.

Say I have Consumers A and B subscribed to queue Q which has 10 messages in
it.

"A" would get message 1 and let's say it takes 10 seconds to process before
it ACKs. At what time would "B" get message 2: immediately, or after 10
seconds?


On Thu, Oct 15, 2009 at 6:15 AM, majek04 <majek04 at gmail.com> wrote:

> On Thu, Oct 15, 2009 at 01:28, Colin Z <theczintheroc2007 at gmail.com>
> wrote:
> > If I have a queue with multiple subscribers/consumers and it also
> requires
> > acks for the messages, what is the resulting behavior?
> >
> > Will the queue round robin the messages out to the subscribers regardless
> of
> > whether the messages have been ack'ed yet or not? Or will the first
> message
> > basically stall the delivery of the other messages in the queue until the
> > first message has been ack'ed?
>
> By default, if you have two consumers that are reading from one
> queue, they will receive exactly every second message. No matter
> if the messages were "light" or "heavy". For example, if queue looks like:
> [light, heavy, light, heavy, light, heavy]
> The first consumer will get all the "light" messages, and the second
> one will get all the "heavy" ones. No matter when they will be
> acknowledged.
> See this code:
> http://ai.pjwstk.edu.pl/~majek/dump/qos_no.py<http://ai.pjwstk.edu.pl/%7Emajek/dump/qos_no.py>
>
>
> Basic.qos is used to fight this limitation. Using it you can specify
> how many messages are allowed to be unacknowledged for a channel.
> Here you can see how to use it:
> http://ai.pjwstk.edu.pl/~majek/dump/qos_yes.py<http://ai.pjwstk.edu.pl/%7Emajek/dump/qos_yes.py>
>
> Cheers!
>  Marek Majkowski
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20091015/999e08ff/attachment.htm 


More information about the rabbitmq-discuss mailing list