On 30/06/2020 7:03 pm, mohank wrote:
Hi Gordon,

The sent request message is reaching 'activeMQ.Management' and getting the
response.
But getcontent always shows empty string.
But when I try to browse the data in Broker getting error * Displying body
as unsupported "Unsupported message body type which cannot be displayed by
hawtio"*

         Connection connection(url, connectionOptions);
        try
        {
                connection.open();
                Session session = connection.createSession();

                Sender managementSender = 
session.createSender("activemq.management");
                Message requestMessage;

                requestMessage.setProperty("_AMQ_ResourceName", 
"EventTracker.R14505");
                requestMessage.setProperty("_AMQ_OperationName", 
"getConsumerCount");

                Receiver managementReceiver = session.createReceiver("#");
                Address managementReplyQueue = managementReceiver.getAddress();
                requestMessage.setReplyTo(managementReplyQueue);
                requestMessage.setContent("'[]'");

                managementSender.send(requestMessage);
                Message ManagementResponse;

                if (managementReceiver.fetch(ManagementResponse, 
Duration::SECOND * 5))
                {
                        Variant content =  
ManagementResponse.getContentObject();
                        
                        VariantType type = content.getType();
                        switch (type)
                        {
                        case VAR_STRING:
                        {
                                std::string data = content.getString();
                                break;
                        }
                        default:
                                break;
                        }
                        printf("");

The printf() above would always print an empty string, I assume that is just a typo?

Can you get the protocol trace (set env var QPID_LOG_ENABLE=trace+:Protocol when running the client).

                }
                managementSender.close();
                managementReceiver.close();

Thanks,
Mohan



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

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



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

Reply via email to