You can call this operation to query the total number of messages in the current topic and the time when the topic was last updated.
This operation is used to determine the resource usage of the topic. The information returned for this operation includes the total number of messages in the topic on the current Message Queue for Apache RocketMQ broker and the time when messages were last written to the topic.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | OnsTopicStatus |
The operation that you want to perform. Set the value to OnsTopicStatus. |
InstanceId | String | Yes | MQ_INST_111111111111_DOxxxxxx |
The ID of the Message Queue for Apache RocketMQ instance corresponding to the topic that you want to query. |
Topic | String | Yes | test |
The name of the topic that you want to query. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Data | Struct |
The returned data structure of the queried topic. |
|
LastTimeStamp | Long | 1570864984364 |
The time when the current topic was last updated. |
Perm | Integer | 6 |
The ID of the relationship between the API caller and the topic. Valid values:
|
TotalCount | Long | 2310 |
The total number of messages in all partitions of the current topic. |
RequestId | String | 427EE49D-D762-41FB-8F3D-9BAC96C314B4 |
The ID of the request. This is a common parameter. |
Examples
Sample requests
http(s)://[Endpoint]/? Action=OnsTopicStatus
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&Topic=test
&<Common request parameters>
Sample success responses
XML
format
<OnsTopicStatusResponse>
<Data>
<Perm>6</Perm>
<TotalCount>2310</TotalCount>
<LastTimeStamp>1570864984364</LastTimeStamp>
</Data>
<RequestId>427EE49D-D762-41FB-8F3D-9BAC96C314B4</RequestId>
</OnsTopicStatusResponse>
JSON
format
{
"Data": {
"Perm": 6,
"TotalCount": 2310,
"LastTimeStamp": 1570864984364
},
"RequestId": "427EE49D-D762-41FB-8F3D-9BAC96C314B4"
}
Error codes
For a list of error codes, visit the API Error Center.