[rabbitmq-discuss] Unbind queue when many consumers work with the same queue

Michael Klishin michael at rabbitmq.com
Fri Sep 20 09:50:29 BST 2013


On sep 20, 2013, at 8:52 a.m., Haster <haster2004 at yandex.ru> wrote:

> And I want to make unbind only when the last consumer will stop.
> How can I do it?

If you make the queue auto-deleted, it will be removed when the last consumer goes
away (if there ever was at least one).

>  
> As I understand If the first stopping consumer make unbind - the server do
> it and others won't get message at all. Or server won't make unbind while
> another consumers are active?

Ignoring restart scenarios for this discussion, RabbitMQ never deletes bindings unless

1. You use queue.unbind
2. A queue or exchange for the binding is deleted

It's also possible to check how many active consumers a queue has
by issuing queue.declare and inspecting the response (queue.declare-ok).

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/20130920/a53aa08d/attachment.pgp>


More information about the rabbitmq-discuss mailing list