[rabbitmq-discuss] Check Queues Exist on Publish (and Read?)

Simon MacMullen simon at rabbitmq.com
Tue May 27 14:28:14 BST 2014


On 27/05/14 14:21, Michael Klishin wrote:
>   On 27 May 2014 at 17:18:51, Patrick Long (pat at munkiisoft.com) wrote:
>>> 1. Is there a way to tell RabbitMQ to chill out about queues not
>> being found?
>
> You can do that queue.declare with passive = true on a separate channel or via HTTP API

Well, both passive=true and passive=false will assert that the queue 
exists, but passive=true will fail rather than create the queue if it is 
missing. Since the OP is mostly concerned with making sure the basic.get 
works, then it makes more sense to declare the queue passive=false.

Ultimately the AMQPish way to do things is declare what you need

> If you use basic.get, you need to perform declaration and so on once. Every time you
> declare a queue, it's a network roundtrip, so it will affect throughput.

Unless you issue the declare with nowait=true, in which case the client 
will just send the declare request and not wait for a response. If the 
queue already exists, this is almost free. Obviously if it doesn't you 
incur the cost of creating it, but you probably wanted that anyway :-)

Cheers, Simon


-- 
Simon MacMullen
RabbitMQ, Pivotal


More information about the rabbitmq-discuss mailing list