[rabbitmq-discuss] Queuing fundamentals.

Eugene Kirpichov ekirpichov at gmail.com
Mon Aug 1 17:41:09 BST 2011


I suppose that you haven't set the prefetch count to 1.

So in fact you had messages 3,4,5,6 all delivered to you (so thought
the broker) and when the consumer died, the broker requeued all of
them in no particular sequence.

2011/8/1 Andrew <aph at repido.co.uk>:
> Hi everybody,
>
> I wondered if somebody might be able to clarify some behaviour for me
> as I am getting confused about whether the scenario I am experiencing
> is due to a lack of understanding of how RabbitMQ works or something
> else.
>
> I have one reader process which may die due to system failure and at
> restart I'd like the same single consumer process to start up again
> and pick up where it left off. So a summary of what I'd like to happen
> is:
>
> (1) My transmitter process sends and queues up messages 1, 2, 3, 4, 5
> & 6.
> (2) My single consumer process reads and acknowledges messages 1 and 2
> in sequence.
> (3) My consumer process reads message 3 and then dies without
> acknowledging.
> (4) I restart my consumer process which will request the next message,
> which should be the unacknowledged message (3).
> (5) My consumer process would then continue reading messages from the
> queue (4, 5, & 6) in sequence.
>
> What I am experiencing is that when my consumer process is restarted
> messages 3, 4, 5 & 6 are delivered out of sequence and all with a
> redelivery count of 1. I understand that message 3 might be out of
> sequence because it was unacknowledged and from what I have read, when
> a message is redelivered then it's sequence is no longer guaranteed.
> However I'm not clear as to why the remaining queued messages are out
> of sequence too.
>
> More importantly is what I am trying to do is something that is
> contrary to how RabbitMQ works, or am I just going about it the wrong
> way?
>
> Many thanks for your help,
> Andrew
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>



-- 
Eugene Kirpichov
Principal Engineer, Mirantis Inc. http://www.mirantis.com/
Editor, http://fprog.ru/


More information about the rabbitmq-discuss mailing list