[rabbitmq-discuss] know when a consumer disconnect from a node

Kilian C. kilian.ciuffolo at gmail.com
Tue Nov 15 00:26:43 GMT 2011


actually i am using https://github.com/postwait/node-amqp (nodejs)
the only way is to write a custom exchange? the topic exchange doesn't have the bind/unbind event?

i am not so good at erlang :)



-- 
Kilian C.


On Monday, November 14, 2011 at 7:59 PM, Matthias Radestock wrote:

> Kilian,
> 
> On 14/11/11 18:39, Kilian C. wrote:
> > is it possible to know when a client is disconnected from a rabbitmq node?
> > 
> > This is my env:
> > 
> > 1 rabbitmq node.
> > 3 client (publishers/subscribers) severs
> > 
> > when a server crashes/shutdown/disconnects from the rabbitmq server,
> > other client server needs to be notified about that.
> > 
> > Is there a way to route/publish a simple (dis)connection message to a
> > certain queue/exchange?
> > 
> 
> 
> There is nothing built-in, but you could implement a custom exchange 
> type for this.
> 
> The basic idea is that a client, after connecting, creates an exclusive 
> queue and binds it to an exchange of the custom exchange type. Due to 
> the exclusivity, the queue and hence the binding will get removed when 
> the connection is closed. The exchange sees both the bind and unbind 
> events and can publish notification messages when it gets them.
> 
> See https://github.com/tonyg/presence-exchange for an exchange type that 
> does s.t. like that. Warning: this may need some tweaking to get to work 
> with recent versions of RabbitMQ.
> 
> 
> Regards,
> 
> Matthias. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20111115/e284ac25/attachment.htm>


More information about the rabbitmq-discuss mailing list