[rabbitmq-discuss] Ghost consumers problem

Dmitry Andrianov dmitry.andrianov at alertme.com
Fri Jul 5 23:10:50 BST 2013

But what is your problem exactly? Yes, for some time that "ghost" connection may be present until server realises the client has gone but I do not see how it prevents your service from successfully restarting.
If you declare queue as auto-delete, non-durable, non-exclusive and your user is permitted to do it the first time, then later when your service restarts and the queue already exists, you will still be able to declare it again with the same parameters. It won't cause error. So your second service will be able to start consuming from the same queue.

However, I have a strong feeling that what you really need instead is exclusive queue which you declare without providing a name so the server chooses a random name for you. So each time your service starts - a new queue is created and it ceases to exist when connection disappears. (Which can still take long but it should not be a problem as when new service starts - a new queue is created for it)

What is wrong with this approach?

On 4 Jul 2013, at 17:27, Jose Ramon Palanco <jpalanco at gmail.com> wrote:

> Michael,
> Thank you for your quick reponse. We only need one consumer per queue. We already have AD (autodelete) and durable is setted to false. We tried exclusive and non-exclusive. We still have ghost connections and consumers even when the computers running the clients are powered off.
> Console:
> http://img827.imageshack.us/img827/9159/pce2.png
> I read that it could be due the NAT, but I have reproduced the same issue connected directly.
> Regards
> 2013/7/4 Michael Klishin <michael.s.klishin at gmail.com>
>> 2013/7/4 Jose Ramon Palanco <jpalanco at gmail.com>
>>> After reboot, the service starts and when trying to create the queue, it conflicts with the former queue. We tried to create the queue as exclusive, but it doesn't allow us to connect because we haven't permission.
>> Is it because you have multiple connections using the queue?
>> If you consumer from the queue, you can declare it as auto-delete and non-durable instead of exclusive. Then as soon as the last consumer (registered with basic.consume, not using basic.get) is gone, it will be deleted.
>> -- 
>> MK
>> http://github.com/michaelklishin
>> http://twitter.com/michaelklishin
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

This email is for the use of the intended recipient(s) only.
If you have received this email in error, please notify the sender immediately and then delete it.
If you are not the intended recipient, you must not use, disclose or distribute this email without the
author's prior permission. AlertMe.com Ltd. is not responsible for any personal views expressed
in this message or any attachments that are those of the individual sender.

AlertMe.com Ltd, 30 Station Road, Cambridge, CB1 2RE, UK.
Registered in England, Company number 578 2908, VAT registration number GB 895 9914 42.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130705/5f76ceee/attachment.htm>

More information about the rabbitmq-discuss mailing list