<div dir="ltr">I don't want listen both queue, i think i have describe you briefly what i want to achieve.<div><br></div><div>1) Amqp.js : This is the server in nodejs. when user connect to server. server will generate the queue, and tell client to listen to that queue in passive mode. in short client don't have access for create queue. if i will listen from both side then queue will not destroy automatically becuase my server (amqp.js) file's queue consuming it. so i want that when client (queue.js) killed or close. at that time server will notify that queue is destroyed, and i will get all data like routing key when it destroy.</div>
<div><br></div><div>Whereas <b>amq.rabbitmq.event </b>is the exchange, that will monitor all the the events.</div><div><div><b>connection.queue("eventListener", { exclusive: true } , function(q){</b></div><div>
<span class="" style="white-space:pre"><b> </b></span></div><div><b><span class="" style="white-space:pre"> </span> q.bind("amq.rabbitmq.event","");</b></div><div><b><span class="" style="white-space:pre"> </span> </b></div>
<div><b><span class="" style="white-space:pre"> </span> //i want to listen all events here when queue destroy when client app killed.</b></div><div><b><span class="" style="white-space:pre"> </span> q.subscribe(function (message, headers, deliveryInfo, messageObject) {</b></div>
<div><b><span class="" style="white-space:pre"> </span> console.log(JSON.stringify(headers));</b></div><div><b><span class="" style="white-space:pre"> </span> })</b></div><div><b><span class="" style="white-space:pre"> </span>});</b></div>
</div><div><br></div><div>Above code will generate queue that will listen all the event like exchange create, exchange delete, binding, queue created, queue delete, etc..</div><div>I read in the documentation of the amqp-event plugin that it will deliver all the event which are happing to all exchanges on the rabbitmq server.</div>
<div><br></div><div><br></div><div>2) queue.js : it is the simple client that have only read access to queue in passive mode only. if any event goes to this client like queue delete then it's not helpful to me. </div>
<div>My main purpose is to listen event and get message when queue.js will be killed or application killed in android.</div><div><br></div><div>Hope you understand. if you made any correction in my file then please send it to me with correction.</div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 7, 2014 at 5:59 PM, Michael Klishin <span dir="ltr"><<a href="mailto:mklishin@gopivotal.com" target="_blank">mklishin@gopivotal.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">+rabbitmq-discuss: please, please CC the mailing list.<br>
<div class=""><br>
On 7 July 2014 at 16:25:26, Hitesh Dobariya (<a href="mailto:hitesh@artoonsolutions.com">hitesh@artoonsolutions.com</a>) wrote:<br>
> > is it working only on local server? i added this code in amqp.js<br>
> file as you mentioned in previous mail. but still i am not getting<br>
> any other event like queue.created, queue.deleted etc on the<br>
> amqp.js.<br>
<br>
</div>It should not matter whether RabbitMQ node is local or not. I highly recommend<br>
not using passive declares unless you get comfortable with the code. Right now<br>
your scripts depend on their start order, for example.<br>
<br>
I only modified queue.js. I see the same code commented out in amqp.js, both sharing<br>
a queue. If you want *both* consumers to get a message copy, you need to use two queues.<br>
<br>
See <a href="http://www.rabbitmq.com/getstarted.html" target="_blank">http://www.rabbitmq.com/getstarted.html</a> and <a href="http://www.rabbitmq.com/tutorials/amqp-concepts.html" target="_blank">http://www.rabbitmq.com/tutorials/amqp-concepts.html</a><br>
if this is not clear.<br>
<div class="HOEnZb"><div class="h5">--<br>
MK<br>
<br>
Staff Software Engineer, Pivotal/RabbitMQ<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><b>Thanks,</b><div>Hitesh Dobariya,</div><div><font color="#333333">Artoon Solutions PVT. LTD</font></div>
</div>