Hi<div><br></div><div>I have been playing with rabbitmq and am thinking through some common scenarios I think I will need to deal with, I was wondering if anyone would be able to take the time to read my thoughts and validate them or throw a few more options in/give me some article links?�</div>
<div><br></div><div>I have a topic exchange and need to attach some consumers to process messages.</div><div><br></div><div>If I attach a consumer with no queue name, a unique one time queue will be created and I can bind the exchange to this queue using a routing key like &#39;animal.mammals.#&#39;.</div>
<div><br></div><div>This is great until�</div><div><br></div><div>- the consumer crashes, meaning the exchange will drop all messages (or they get rejected depending on the publish settings I use)</div><div>or</div><div>- I need another consumer to process animals.mammals.#, which I can&#39;t do as I am using a one time queue and adding another will mean each message is delivered to 2 queues.</div>
<div><br></div><div>Are the above assumptions correct?</div><div><br></div><div><br></div><div>So my second option is to use a named queue. I attach a consumer with a queue name and bind the exchange to this queue using�a routing key like &#39;animal.mammals.#&#39;.�</div>
<div><br></div><div>Now if I need another consumer I simply bring another one up and attach it to the same queue name, and they get the messages in round robin which is great.</div><div><br></div><div>What&#39;s not so great is if I then decide to attach a consumer to this queue name (maybe by accident) and bind the exchange to a routing key &#39;animal.mammals.rabbit&#39;</div>
<div><br></div><div>Then the queue gets 2 copies of each message. Is there any way to avoid this other than careful management of bindings? Maybe a way of telling the exchange to only deliver the message once to a given queue?</div>
<div><br>My worry is developers who will create bindings willy nilly without realising the consequences of what is happening.</div><div><br></div><div><br></div><div>Any help would be appreciated, I am just trying to piece what&#39;s happening together in my mind at the moment so I can understand what&#39;s happening in the background.</div>
<div><br></div><div>Thanks</div><div><br></div><div>Pete</div><div><br></div><div><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div><br></div>