You can call OnsMessageDetail to query the details of a specific message.
Operation description
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mq:QueryMessageDetail |
get |
Topic
Topic
|
None |
|
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the ApsaraMQ for RocketMQ instance. |
MQ_INST_184681981******_BXig0x6A |
| Topic |
string |
Yes |
The topic of the message to query. |
test-mq_topic |
| MsgId |
string |
Yes |
The ID of the message to query. This is the message ID. |
1E0578FE110F18B4AAC235C0****** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
A common parameter. The ID of the request. Each request has a unique ID. Use this ID to troubleshoot issues. |
EAE5BE23-37A1-4354-94D6-E44AE17E**** |
| Data |
object |
The query result. |
|
| StoreSize |
integer |
The size of the message. Unit: KB. |
2 |
| ReconsumeTimes |
integer |
The number of times the message consumption is retried. |
0 |
| StoreTimestamp |
integer |
The UNIX timestamp when the message was stored on the server-side. Unit: milliseconds. |
1570761026708 |
| Body |
string |
The message body, which is a Base64-encoded string. |
aGVsbG8= |
| InstanceId |
string |
The ID of the ApsaraMQ for RocketMQ instance. |
MQ_INST_184681981******_BXig0x6A |
| MsgId |
string |
The message ID. |
1E0578FE110F18B4AAC235C05F2***** |
| StoreHost |
string |
The server instance where the message is stored. |
11.220.***.***:10911 |
| Topic |
string |
The topic to which the message belongs. |
test-mq_topic |
| PropertyList |
array<object> |
The list of message attributes. |
|
|
object |
|||
| Value |
string |
The value of the message attribute. |
MSG_REGION |
| Name |
string |
The message attribute. Valid values:
For more information, see Terms. |
cn-hangzhou |
| BornTimestamp |
integer |
The UNIX timestamp when the message was generated. Unit: milliseconds. |
1570761026630 |
| BodyCRC |
integer |
The cyclic redundancy check (CRC) value of the message body. |
907060870 |
| BornHost |
string |
The client instance that generated the message. |
42.120.**.**:64646 |
| BodyStr |
string |
The content of the message body. |
hello |
Examples
Success response
JSON format
{
"RequestId": "EAE5BE23-37A1-4354-94D6-E44AE17E****",
"Data": {
"StoreSize": 2,
"ReconsumeTimes": 0,
"StoreTimestamp": 1570761026708,
"Body": "aGVsbG8=",
"InstanceId": "MQ_INST_184681981******_BXig0x6A",
"MsgId": "1E0578FE110F18B4AAC235C05F2*****",
"StoreHost": "11.220.***.***:10911",
"Topic": "test-mq_topic",
"PropertyList": [
{
"Value": "MSG_REGION",
"Name": "cn-hangzhou"
}
],
"BornTimestamp": 1570761026630,
"BodyCRC": 907060870,
"BornHost": "42.120.**.**:64646",
"BodyStr": "hello"
}
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.