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

Matthias Radestock matthias at rabbitmq.com
Wed May 28 10:10:33 BST 2014


Patrick,

On 27/05/14 15:09, Patrick Long wrote:
>   I am mostly concerned with BasicGet not causing a log entry.If the
> queue is not there I don't care just don't error.

There is no way to do that in AMQP.

> Are you guys saying I should always check the queue exist

That won't help since a passive queue.declare will *still* result in an 
error and log entry when the queue doesn't exist.

> The change should be passing true for NoWait?

What Simon suggested is that you make sure that the queue *does* exist 
prior to the basic.get by (actively) declaring it with queue.declare. 
The nowait flag is only there to make that more efficient, by turning 
the command into an asynchronous request.

> It does not look like the RabbitMQ .NET Client Library supports passing
> nowait to QueueDeclare.

Correct. You'd have to drop to the internal API by casting to 
RabbitMQ.Client.Impl.IFullModel and invoking _Private_QueueDeclare(...).

Matthias.


More information about the rabbitmq-discuss mailing list