<div dir="ltr"><div>Venky,<br><br></div><div>With AMQP_PASSIVE set you are basically just checking for the existence (or not) of the queue. <br><br>To quote the AMQP 0-9-1 reference (<a href="http://www.rabbitmq.com/amqp-0-9-1-reference.html">http://www.rabbitmq.com/amqp-0-9-1-reference.html</a>):<br>
<span title="do not create queue" class=""><br>"bit passive</span><br> 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. "<br><br></div><div>... and the returned error will be "not-found".<br><br></div><div>Brett<br><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 3, 2013 at 6:24 PM, Venky <span dir="ltr"><<a href="mailto:kvredy87@gmail.com" target="_blank">kvredy87@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<div><br></div><div>I am trying to declare a queue in RabbitMQ with php.</div><div><br></div><div>Here is my code</div>
<div><br></div><div><div>function declareQueue($queue_name)</div><div><span style="white-space:pre-wrap">        </span>{</div><div><span style="white-space:pre-wrap">                </span>$this->queue = new AMQPQueue($this->channel); //channel is already created. am omitting that code from here</div>
<div><span style="white-space:pre-wrap">                </span>$this->queue->setName($queue_name);</div><div><span style="white-space:pre-wrap">                </span>$this->queue->setFlags(AMQP_DURABLE);</div><div><span style="white-space:pre-wrap">                </span>$this->queue->setFlags(AMQP_PASSIVE);</div>
<div><span style="white-space:pre-wrap">                </span>$this->queue->declare();</div><div><span style="white-space:pre-wrap">        </span>}</div></div><div><br></div><div><div>$amqp -> declareQueue("myqueue");</div>
</div><div><br></div><div><br></div><div><br></div><div>This part of code is giving an error when there is no queue in RabbitMQ. the error is:</div><div><br></div><div><font color="#000000">PHP Fatal error: Uncaught exception 'AMQPQueueException' with message 'Server channel error: 404, message: NOT_FOUND - no queue 'myqueue' in vhost '/''</font><br>
</div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Every thing is going fine when the queue is already created in Rabbitmq.</font></div>
<div><font color="#000000"><br></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Any help please.</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">Thanks in advance.</font></div>
<div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><br>_______________________________________________<br>
rabbitmq-discuss mailing list<br>
<a href="mailto:rabbitmq-discuss@lists.rabbitmq.com">rabbitmq-discuss@lists.rabbitmq.com</a><br>
<a href="https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss" target="_blank">https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss</a><br>
<br></blockquote></div><br></div>