Thanks!
Benjamin
--
ben renaud
versly.com
b...@versly.com
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq...@lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Not ATM. I wonder about implementing such a thing since it occasionally
gets asked about, although I'm not sure what it would look like. Are you
talking about something that would send the sort of information that the
management plugin shows for connections, but as events on connect /
disconnect? Or something else?
Cheers, Simon
--
Simon MacMullen
Staff Engineer, RabbitMQ
SpringSource, a division of VMware
On 14/03/11 19:27, Miguel Morales wrote:
> I too would be interested in this. Not sure if anything like this
> exists but basically it could be some sort of callback mechanism where
> we are notified of when a client has connected/disconnected to the broker.
What do you need this for?
And what information would have to be passed to such a callback?
If you are just interested in network-level connect/disconnect events
then a simple TCP proxy could give you that information.
Or you could do some live processing of rabbit's log files, which,
amongst other things, contain all connect/disconnect events. Or you
could get the log events over AMQP by binding to the amq.rabbitmq.log
topic exchange.
Regards,
Matthias.
Miguel,What do you need this for?
On 14/03/11 19:27, Miguel Morales wrote:
I too would be interested in this. Not sure if anything like this
exists but basically it could be some sort of callback mechanism where
we are notified of when a client has connected/disconnected to the broker.
And what information would have to be passed to such a callback?
If you are just interested in network-level connect/disconnect events then a simple TCP proxy could give you that information.
Or you could do some live processing of rabbit's log files, which, amongst other things, contain all connect/disconnect events. Or you could get the log events over AMQP by binding to the amq.rabbitmq.log topic exchange.
Regards,
Matthias.
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.
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.
BR
--
ben renaud
versly.com
b...@versly.com
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?
Unfortunately (for you) there is no log message containing the user name.
'presence' is a highly application dependent concept. Support for it in
the messaging system itself could only accommodate a very restricted set
of use cases. So it's best handled by applications.
One fairly generic and flexible way is to get clients to publish a
presence message every so often to some dedicated exchange. That message
can contain all kinds of application specific information, e.g. to
identify the user, what their status is, etc. An app can then consume
these messages, update some db with status information, send status
change messages to clients interested and authorised to see them (e.g.
'friends'). The app can also detect the absence of the messages and mark
the user as absent.
In this scheme
- the notion of presence is not tied to the lifetime of connections, or
queues, or bindings
- the notion of users (or, more generally, 'the things of which we want
to know the presence') is not tied to that of AMQP users
- presence can be more than just a flag, i.e. all kinds of complex
status information can be transmitted
Regards,
Matthias.
'presence' is a highly application dependent concept. Support for it in the messaging system itself could only accommodate a very restricted set of use cases. So it's best handled by applications.
One fairly generic and flexible way is to get clients to publish a presence message every so often to some dedicated exchange. That message can contain all kinds of application specific information, e.g. to identify the user, what their status is, etc. An app can then consume these messages, update some db with status information, send status change messages to clients interested and authorised to see them (e.g. 'friends'). The app can also detect the absence of the messages and mark the user as absent.
In this scheme
- the notion of presence is not tied to the lifetime of connections, or queues, or bindings
- the notion of users (or, more generally, 'the things of which we want to know the presence') is not tied to that of AMQP users
- presence can be more than just a flag, i.e. all kinds of complex status information can be transmitted
Regards,
Matthias.
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq...@lists.rabbitmq.com
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Yes presence is a very application-specific bit of information.
Being notified of when a client connects or disconnect (even if rabbit
tries to auto-reconnect or other nice features under the covers) would
help application developers develop their own notion of presence.
In other words, rabbit is the one persistent connection we have to our
clients. When the rabbit connection disconnects or reconnects, Rabbit
is the only bit of software with that information.
Without having Rabbit interpret that information (let me do the
interpreting) it would be great to just know the information.
Benjamin
--
ben renaud
versly.com
b...@versly.com