[rabbitmq-discuss] [ Listen event when queue destroy from client ]
Hitesh Dobariya
hitesh at artoonsolutions.com
Mon Jul 7 13:45:56 BST 2014
I don't want listen both queue, i think i have describe you briefly what i
want to achieve.
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.
Whereas *amq.rabbitmq.event *is the exchange, that will monitor all the the
events.
*connection.queue("eventListener", { exclusive: true } , function(q){*
* q.bind("amq.rabbitmq.event","");*
* //i want to listen all events here when queue destroy when client app
killed.*
* q.subscribe(function (message, headers, deliveryInfo, messageObject) {*
* console.log(JSON.stringify(headers));*
* })*
* });*
Above code will generate queue that will listen all the event like exchange
create, exchange delete, binding, queue created, queue delete, etc..
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.
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.
My main purpose is to listen event and get message when queue.js will be
killed or application killed in android.
Hope you understand. if you made any correction in my file then please send
it to me with correction.
On Mon, Jul 7, 2014 at 5:59 PM, Michael Klishin <mklishin at gopivotal.com>
wrote:
> +rabbitmq-discuss: please, please CC the mailing list.
>
> On 7 July 2014 at 16:25:26, Hitesh Dobariya (hitesh at artoonsolutions.com)
> wrote:
> > > is it working only on local server? i added this code in amqp.js
> > file as you mentioned in previous mail. but still i am not getting
> > any other event like queue.created, queue.deleted etc on the
> > amqp.js.
>
> It should not matter whether RabbitMQ node is local or not. I highly
> recommend
> not using passive declares unless you get comfortable with the code. Right
> now
> your scripts depend on their start order, for example.
>
> I only modified queue.js. I see the same code commented out in amqp.js,
> both sharing
> a queue. If you want *both* consumers to get a message copy, you need to
> use two queues.
>
> See http://www.rabbitmq.com/getstarted.html and
> http://www.rabbitmq.com/tutorials/amqp-concepts.html
> if this is not clear.
> --
> MK
>
> Staff Software Engineer, Pivotal/RabbitMQ
>
--
*Thanks,*
Hitesh Dobariya,
Artoon Solutions PVT. LTD
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140707/ce09f715/attachment.html>
More information about the rabbitmq-discuss
mailing list