Queries the total number of messages in a topic and the status of the topic.
Operation description
API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur.
You can determine the resource usage of a topic based on the information that is returned by this operation. The returned information includes the total number of messages in the topic and the most recent point in time when a message was published to the topic.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mq:QueryTopicStatus |
get |
Topic
Topic
|
None |
|
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Topic |
string |
Yes |
The name of the topic that you want to query. |
test |
| InstanceId |
string |
No |
The ID of the instance that contains the topic you want to query. |
MQ_INST_188077086902****_BXSuW61e |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The message returned. |
||
| RequestId |
string |
The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues. |
427EE49D-D762-41FB-8F3D-9BAC96C3**** |
| Data |
object |
The data structure of the queried topic. |
|
| Perm |
integer |
Indicates the operations that you can perform on the topic. Valid values:
|
6 |
| LastTimeStamp |
integer |
The point in time when the latest message is ready in the topic. If no message exists in the topic, the return value of this parameter is 0. The value of this parameter is a UNIX timestamp in milliseconds. For information about the definition of ready messages and ready time, see Terms. |
1570864984364 |
| TotalCount |
integer |
The total number of messages in all partitions of the topic. |
2310 |
Examples
Success response
JSON format
{
"RequestId": "427EE49D-D762-41FB-8F3D-9BAC96C3****",
"Data": {
"Perm": 6,
"LastTimeStamp": 1570864984364,
"TotalCount": 2310
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.