Reputation: 1
I have a scenario where if the size of queue exceeds from the 10 queues it should send email alert to the client the logice should be done in Anypoint Studio
Upvotes: 0
Views: 787
Reputation: 25812
You can develop a Mule application in Anypoint Studio that calls Anypoint MQ REST API (using the HTTP Request connector) to read the number of messages in a queue. Note that this information is not updated in realtime as the documentation mentions.
Example URL:
https://anypoint.mulesoft.com/mq/stats/api/v1/organizations/ORGANIZATION_ID/environments/ENVIRONMENT_ID/regions/REGION_URL
/queues?destinationIds=DESTINATION_ID
Example OUTPUT:
[
{
"destination": "95bgpyxYsVyFE",
"messages": 0,
"inflightMessages": 0
}
]
Note that you need to get an access token from Anypoint Platform to authorize the HTTP request.
Upvotes: 0