You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "Flores, Paul A." <PA...@SAIC.COM> on 2016/10/25 14:22:03 UTC

How, from within a C++ application, is it possible to 'examine' and 'manage' a broker?

Hi,


As the subject line states: "How, from within a C++ application, is it possible to 'examine' and 'manage' a broker?"


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'?



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


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


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


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


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


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.


Thanks


Paul


________________________________

This communication (including any attachments) may contain information that is proprietary, confidential or exempt from disclosure. If you are not the intended recipient, please note that further dissemination, distribution, use or copying of this communication is strictly prohibited. Anyone who received this message in error should notify the sender immediately by telephone or by return email and delete it from his or her computer.

Re: How, from within a C++ application, is it possible to 'examine' and 'manage' a broker?

Posted by Gordon Sim <gs...@redhat.com>.
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).


RE: How, from within a C++ application, is it possible to 'examine' and 'manage' a broker?

Posted by Steve Huston <sh...@riverace.com>.
I believe you can gather all that info using QMF messages to the broker. You can probably "translate" the qpid-stat, qpid-tool tools from python into the equivalent C++.

> -----Original Message-----
> From: Flores, Paul A. [mailto:PAUL.A.FLORES@SAIC.COM]
> Sent: Tuesday, October 25, 2016 10:22 AM
> To: users@qpid.apache.org
> Subject: How, from within a C++ application, is it possible to 'examine' and
> 'manage' a broker?
> 
> Hi,
> 
> 
> As the subject line states: "How, from within a C++ application, is it possible
> to 'examine' and 'manage' a broker?"
> 
> 
> 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'?
> 
> 
> 
>  * How many receivers/subscribers are attached/subscribed to a queue/
> topic?
> 
> 
>  * How many senders/publishers are writing/publishing to a queue/topic?
> 
> 
>      >Is it only one or can their be multiple senders/publishers to a
> queue/topic?
> 
> 
>  *When was the last time a message was retrieved from a queue/topic?
> 
> 
>  *How to 'empty/clear' messages from a queue/topic from within a C++
> application?
> 
> 
> 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.
> 
> 
> Thanks
> 
> 
> Paul
> 
> 
> ________________________________
> 
> This communication (including any attachments) may contain information
> that is proprietary, confidential or exempt from disclosure. If you are not the
> intended recipient, please note that further dissemination, distribution, use
> or copying of this communication is strictly prohibited. Anyone who received
> this message in error should notify the sender immediately by telephone or
> by return email and delete it from his or her computer.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
For additional commands, e-mail: users-help@qpid.apache.org


Re: How, from within a C++ application, is it possible to 'examine' and 'manage' a broker?

Posted by Chuck Rolke <cr...@redhat.com>.
Here is an example of querying a broker using C++ to implement the QMF protocol.

This was posted by Gordon Sim some years ago.

----- Original Message -----
> From: "Paul A. Flores" <PA...@SAIC.COM>
> To: users@qpid.apache.org
> Sent: Tuesday, October 25, 2016 10:22:03 AM
> Subject: How, from within a C++ application, is it possible to 'examine' and 'manage' a broker?
> 
> Hi,
> 
> 
> As the subject line states: "How, from within a C++ application, is it
> possible to 'examine' and 'manage' a broker?"
> 
> 
> 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'?
> 
> 
> 
>  * How many receivers/subscribers are attached/subscribed to a queue/ topic?
> 
> 
>  * How many senders/publishers are writing/publishing to a queue/topic?
> 
> 
>      >Is it only one or can their be multiple senders/publishers to a
>      >queue/topic?
> 
> 
>  *When was the last time a message was retrieved from a queue/topic?
> 
> 
>  *How to 'empty/clear' messages from a queue/topic from within a C++
>  application?
> 
> 
> 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.
> 
> 
> Thanks
> 
> 
> Paul
> 
> 
> ________________________________
> 
> This communication (including any attachments) may contain information that
> is proprietary, confidential or exempt from disclosure. If you are not the
> intended recipient, please note that further dissemination, distribution,
> use or copying of this communication is strictly prohibited. Anyone who
> received this message in error should notify the sender immediately by
> telephone or by return email and delete it from his or her computer.
>