[rabbitmq-discuss] Queuing fundamentals.

Andrew aph at repido.co.uk
Mon Aug 1 17:37:57 BST 2011

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

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

(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
(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

Many thanks for your help,

More information about the rabbitmq-discuss mailing list