[rabbitmq-discuss] Naive Question
jerryk at vmware.com
Sat Feb 11 01:15:50 GMT 2012
Nope: Redeclarations of a queue with the same name and properties, within a
vhost, are idempotent. Redeclaring the thing before you start using it is
a fairly common idiom. If the resource didn't exist, then it's created;
otherwise you've verified its existence.
Redeclaring a queue with a given name with different properties fails, so you
can't accidentally vandalize some existing piece of messaging fabric that
somebody else might be using.
On point b: producers publish messages to *exchanges*, not to queues.
Which queues, if any, the messages end up in depends on how queues
are bound to the exchange in question, and the properties of the message.
With regard to your specific scenario with MGMT and HB messages, are you
sure you want them in the same queue? It's not really possible in any
graceful way for a consumer to selectively read some but not other messages
from a queue unless one does something obnoxious like basic.get-ing and then
rejecting the messages you weren't interested in so that they're requeued.
More information about the rabbitmq-discuss