[rabbitmq-discuss] Client connect/disconnect events on the server side

Benjamin Renaud br at versly.com
Mon Mar 14 20:51:06 GMT 2011

So we need it because our clients collaborate on the same resource,
and we want to use the connection essentially as 'presence'
information - that someone is working on the the same resource.

Ideally, we'd pass in a user id when connecting, and we could register
(on the exchange perhaps) to know when that a client comes in and out.

We have to deal with the issue where a user shuts their laptop and the
client goes away. It seems like Rabbit would be well positioned to
tell us that.


On Mon, Mar 14, 2011 at 1:42 PM, Matthias Radestock
<matthias at rabbitmq.com> wrote:
> Miguel,
> Miguel Morales wrote:
>> Well I haven't researched this, but it's something that I need to
>> implement in the near future. Basically, I have a public broker which
>> clients (android devices in my case) connect and disconnect.  When
>> they log-in it would be considered that they are 'active' if they
>> log-out it would be considered that they are 'inactive.'
>> This is important because other clients need to know information
>> about 'active' clients.
> Ah, so this is about 'presence'. That has come up a few times before. Might
> be worth searching the archives.
>> I am indeed interested in network connects/disconnects, but I would
>> also need to know the username of the client that just logged in. (for
>> example, if the client suddenly disconnects I need to set their
>>  status to 'inactive' in my global database.)
> Is the fact that a client has connected with a particular user name really
> indicating presence? Or is their presence perhaps only established when they
> start consuming from a queue?
>> Other than that, I think my best choice would be to bind to the
>> amq.rabbitmq.log exchange (didn't know about it before) and parse the
>>  log messages. However, that seems a bit brittle for me (might change
>> between versions), but it would work well.
> Unfortunately (for you) there is no log message containing the user name.
> Matthias.
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

ben renaud
br at versly.com

More information about the rabbitmq-discuss mailing list