[rabbitmq-discuss] rabbitmqctl stop_app start_app loses all messages

Matthias Radestock matthias at rabbitmq.com
Mon Jul 23 19:08:16 BST 2012


Farshad,

please keep the list on 'cc'...

On 23/07/12 18:18, Farshad Meshkinpour wrote:
> Thanks for your response.  I read this document and I am still a bit
>  puzzled.  The document says:
>
> If the mirrored-queue was declared /durable/ then, if its last
> remaining node is shutdown, durable messages in the queue will
> survive the restart of that node.
>
> But I noticed if stop and start the second node in the cluster (last
>  node), the messages do not survive.

So you are doing the following?

1) start two nodes (A&B)
2) declare a durable mirrored queue, mirrored on all nodes
3) publish messages that get routed to the queue
4) shut down node A
5) shut down node B
6) start up node B

?

That should not lose any messages provided the messages are published as
*persistent*. See the 'Message durability' section in 
http://www.rabbitmq.com/tutorials/tutorial-two-python.html. Are you 
doing that?

> It seems that there needs to be some wait time before
> stopping/starting of last node.  Otherwise, the last node does not
> know that it is the last node.   Is it correct?  If so, what is this
> time period.

Publishing is async, so in general a client doesn't know when the
server has taken responsibility for a message. The time it takes for
that to happen is typically very short though, unless the server is
heavily loaded. Publisher confirms - 
http://www.rabbitmq.com/extensions.html#confirms - notify the publishing 
client when messages have been accepted by the server.

Regards,

Matthias.


More information about the rabbitmq-discuss mailing list