[rabbitmq-discuss] Client connect/disconnect events on the server side
matthias at rabbitmq.com
Mon Mar 14 20:42:19 GMT 2011
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.
More information about the rabbitmq-discuss