qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: Is it possible to write a client that gets notified of connections/disconnections to broker?
Date Fri, 17 Jun 2011 14:34:34 GMT
On 06/17/2011 03:08 PM, fadams wrote:
> Hello all,
> I'd like to write a client that connects to the c++ broker and
> asynchronously gets notified of other connection attempts being made to the
> broker.
> The idea is that this client can write audit logs that shows info about
> connections IP address, queues, bindings, connection time etc.
> I'm guessing that it's going to involve QMF so some of Gordon Sim's recent
> QMF2 Java Examples are going to help me I'm sure, but the last piece in the
> puzzle is really how do I get notified asynchronously.
> I guess that I could poll and maintain differences of queues etc. but it is
> more elegant if I could be notified of connections/disconnections.

You can create a receiver/message consumer with address 

The messages you receive on that will be amqp-list formatted messages 
(from JMS you would need to decode these as per my previous example as 
the library won't yet do it for you). Each entry will be an event 
represented as a map.

event["_schema_d"]["_class_name"] will contain the class of the event. 
In your case you are interested in clientConnect and clientDisconnect 
(events are defined in qpid/specs/management.xml).

Let me know if you have trouble with this and I'll try to knock up a JMS 

Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org

View raw message