qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: How, from within a C++ application, is it possible to 'examine' and 'manage' a broker?
Date Tue, 25 Oct 2016 15:03:32 GMT
On 25/10/16 15:22, Flores, Paul A. wrote:
> Hi,
>
>
> As the subject line states: "How, from within a C++ application, is it possible to 'examine'
and 'manage' a broker?"

It depends which broker you are using. The c++ broker uses a message 
based management protocol (called QMF). The java broker has an HTTP 
based protocol.

The rest of the answers assume the c++ broker is used.

> The requirements are rather straightforward we would like to be able to answer the following
questions.:
>
>
>  * How many 'clients' (senders and receivers) are 'connected' to a 'broker'?

You can easily get a list of connections. With AMQP 0-10 there is no 
explicit concept of a 'sender'. However the connection stats track the 
number of messages sent to or from a the client over that connection.

>  * How many receivers/subscribers are attached/subscribed to a queue/ topic?

For a queue, you can list the subscriptions. For a topic, you would 
instead need to list the queues bound to the underlying exchange.

>  * How many senders/publishers are writing/publishing to a queue/topic?

Unfortuantely this is not available for AMQP 0-10 based connections. 
(AMQP 1.0 has the concept of a sending link - analogous to a 
subscription - that does allow this to be tracked for connections using 
that version of the protocol)

>      >Is it only one or can their be multiple senders/publishers to a queue/topic?

You can get the details of a queue which would indicate whether it was 
an exclusive queue. If it is, that doesn't strictly preclude anyone 
sending to it, but it would mean it could not be declared in AMQP 0-10.

>  *When was the last time a message was retrieved from a queue/topic?

I don't believe this information is available for the c++ broker.

>  *How to 'empty/clear' messages from a queue/topic from within a C++ application?

There is a purge method on queues that will just drop the messages. 
(Alternatively there is also a reroute method that lets you route those 
messages through another exchange if desired).

> As stated earlier we are replacing CORBA messaging with QPID.  To that regard the client
has a considerable amount of message channel 'management' that is 'baked'  into their 'framework'.
While the goal is to shift away from the CORBA paradigm we are faced with task of identifying.
developing and implementing 'like' functionality and this is one area we would like some 'sage'
advice and guidance.

Using QMF is fairly easy, if a little verbose at times, as it just 
involves sending map messages and getting back map- or list- messages 
with the requested content in them.

See the attached example which lists management objects of various types 
(connections by default, but you can pass in another type as the first 
argument, e.g. queue or subscription).


Mime
View raw message