[rabbitmq-discuss] Error in declaring a queue.

Brett Cameron brett.r.cameron at gmail.com
Wed Jul 3 09:09:31 BST 2013


Venky,

With AMQP_PASSIVE set you are basically just checking for the existence (or
not) of the queue.

To quote the AMQP 0-9-1 reference (
http://www.rabbitmq.com/amqp-0-9-1-reference.html):

"bit passive
 If set, the server will reply with Declare-Ok if the queue already exists
with the same name, and raise an error if not. The client can use this to
check whether a queue exists without modifying the server state. "

... and the returned error will be "not-found".

Brett



On Wed, Jul 3, 2013 at 6:24 PM, Venky <kvredy87 at gmail.com> wrote:

> Hi All,
>
> I am trying to declare a queue in RabbitMQ with php.
>
> Here is my code
>
> function declareQueue($queue_name)
> {
> $this->queue = new AMQPQueue($this->channel);   //channel is already
> created. am omitting that code from here
> $this->queue->setName($queue_name);
> $this->queue->setFlags(AMQP_DURABLE);
> $this->queue->setFlags(AMQP_PASSIVE);
> $this->queue->declare();
> }
>
> $amqp -> declareQueue("myqueue");
>
>
>
> This part of code is giving an error when there is no queue in RabbitMQ.
> the error is:
>
> PHP Fatal error:  Uncaught exception 'AMQPQueueException' with message
> 'Server channel error: 404, message: NOT_FOUND - no queue 'myqueue' in
> vhost '/''
>
>
>
> Every thing is going fine when the queue is already created in Rabbitmq.
>
>
> Any help please.
>
> Thanks in advance.
>
>
>
>
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130703/c13eecdb/attachment.htm>


More information about the rabbitmq-discuss mailing list