To get the message count from topic, I have invoked the WSO2 MB 3.1.0 AdminService api calls. It worked for queue but not for the topic. When invoking with topic, it doesn't give the correct count (it always gives 0)
(To show the message count in topic in WSO2 MB Management console, I have created an inbound endpoint with suspend state in WSO2 ESB and created a durable subscription to the topic)
- Get Message Count from queue.
url:https://localhost:9447/services/AndesAdminService.AndesAdminServiceHttpsSoap12Endpoint
Request body:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://wso2.org/carbon/andes/admin/xsd">
<soap:Header/>
<soap:Body>
<xsd:getMessageCount>
<!--Optional:-->
<xsd:destinationName>test-queue</xsd:destinationName>
<!--Optional:-->
<xsd:msgPattern>**queue**</xsd:msgPattern>
</xsd:getMessageCount>
</soap:Body>
</soap:Envelope>
- Get Message Count from topic.
url:https://localhost:9447/services/AndesAdminService.AndesAdminServiceHttpsSoap12Endpoint
Request body:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://wso2.org/carbon/andes/admin/xsd">
<soap:Header/>
<soap:Body>
<xsd:getMessageCount>
<!--Optional:-->
<xsd:destinationName>mytopic</xsd:destinationName>
<!--Optional:-->
<xsd:msgPattern>**topic**</xsd:msgPattern>
</xsd:getMessageCount>
</soap:Body>
</soap:Envelope>
I set the messagePattern as "topic" to get the message count in the topic. Is this not correct? If so whats the correct way of getting the message count in a topic using Admin services.
Reference: https://docs.wso2.com/display/MB310/Calling+Admin+Services+from+Apps