[rabbitmq-discuss] How RabbitMQ handles the messages in case of crash ?

Michael Klishin michael at rabbitmq.com
Fri Oct 4 11:57:30 BST 2013


On oct 4, 2013, at 2:52 p.m., Mandy <mandyce2006 at gmail.com> wrote:

> How receiver program come to know if there are any messages in its queue ?

You can use queue.declare and check the number of messages on queue.declare-ok
(the response).

> Since when sender sends any message on receiver's queue, its callback method
> gets called.

If you don't want messages to be pushed to the consumer, use basic.get (which
is very similar to HTTP GET) instead of basic.consume.

> While creating the exchange do I need to set any flags? ( flags like
> durable, auto_delete )

Exclusive queues can be only be used on one connection and will be removed
what that connection is closed. Auto-delete queues will be automaticlly deleted when the last
consumer disconnects (but never if there was never was a consumer).

Sounds like you want a non-exclusive, non-autodelete queue. Make it durable
if you want it to survive RabbitMQ restart.

I recommend that you take a look at the tutorials that explain queue attributes
and much more: http://www.rabbitmq.com/getstarted.html.

MK



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131004/dffa7846/attachment.pgp>


More information about the rabbitmq-discuss mailing list