Anypoint MQ Stats
home
The Anypoint MQ Stats API provides access to statistical information about Anypoint MQ message queues. See About Anypoint MQ for more information.
More Info
The Anypoint MQ Stats API allows you to browse statistics for queues and exchanges. Live statistics allow you to view real-time data, including the number of messages currently in a queue. You may also view historical data to know queue activity over time. You can also view your entire organization's usage of MQ to get a clear picture of how much you are consuming the service on a month by month basis for billing purposes.
Getting Started
Before using the Anypoint MQ Stats API, you should be familiar with the following:
- Anypoint MQ concepts -- Describes queues, message exchanges, and clients.
Use this API in conjunction with the following APIs:
- Anypoint MQ Broker API. This API allows clients to publish and receive messages from queues.
- Anypoint MQ Administration API. This API allows users to manage their destinations.
To access the Anypoint MQ Stats API, you must first authenticate and obtain a token by using Anypoint Access Management API. Typically you would use your Anypoint Platform user credentials to obtain the access token, and then you would use the obtained token to call the MQ Stats API. See examples of this authentication at the Anypoint Access Management link above.
Example API Calls
The following example describes how to retrieve real-time statistics for a queue. Notice the following variables in the API call:
- The Authorization header includes the bearer token obtained from Anypoint Access Management.
- ORG_ID is the ID of the business group where your queue resides
- ENV_ID is the ID of the environment where your queue resides
- REGION_ID is the region where your queue resides (i.e. us-east-1)
Request:
curl -X GET \
-H 'Authorization: Bearer xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx' \
'https://anypoint.mulesoft.com/mq/stats/api/v1/organizations/${ORG_ID}/environments/${ENV_ID}/regions/${REGION_ID}/queues?destinationIds=orders-received'
Response:
[
{
"destination": "orders-received",
"messages": 716,
"inflightMessages": 3
}
]
Support
Support for this API is provided through the Anypoint Platform support portal.