On 28/02/17 18:58, mottese wrote:
Hi, I'm using the Qpid 1.36 C++ client and I'm trying to use QMF to get
information about how many producers/consumers a queue has. Currently, I can
get how many consumers a queue has by using this request:

    request.setReplyTo(receiver.getAddress());
    request.setProperty("x-amqp-0-10.app-id", "qmf2");
    request.setProperty("qmf.opcode", "_query_request");
    Variant::Map schemaId, content;
    schemaId["_class_name"] = "queue";
    schemaId["_object_name"] = "org.apache.qpid.broker:queue:" + queueName;
    content["_what"] = "OBJECT";
    content["_object_id"] = schemaId;
    request.setContentObject(content);

And then doing this to get the number of consumers:

    Variant::List list = response.getContentObject().asList();
    Variant::Map item = list.begin()->asMap();
    Variant::Map values = item["_values"].asMap();
    int consumers = values["consumerCount"];

How can I modify this to get the number of producers? I tried subbing
consumerCount for producerCount but then values["producerCount"] returned a
void, even though in my test I know I had a sender set up.

AMQP 0-10 had no concept of producers, so there isn't a general producer count. AMQP 1.0 does have sending links and you can get the list of 'incoming' links to a given queue (but these will only exist if you are using AMQP 1.0).

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to