Queries a dead-letter message based on the message ID. The queried information about the dead-letter message includes the point in time when the message is stored, the message body, and attributes such as the message tag and the message key.
Operation description
This operation uses the exact match method to query a dead-letter message based on the message ID. You can obtain the message ID that is required to query the information about a dead-letter message from the SendResult parameter that is returned after the message is sent. You can also obtain the message ID by calling the OnsDLQMessagePageQueryByGroupId operation to query multiple messages at a time. The queried information about the dead-letter message includes the point in time when the message is stored, the message body, and attributes such as the message tag and the message key.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
mq:QueryDLQMessage | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
MsgId | string | Yes | The ID of the dead-letter message that you want to query. | 0BC16699165C03B925DB8A404E2D**** |
GroupId | string | Yes | The ID of the consumer group whose dead-letter message you want to query. | GID_test_group_id |
InstanceId | string | Yes | The ID of the instance to which the message you want to query belongs. | MQ_INST_111111111111_DOxxxxxx |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "A07E3902-B92E-44A6-B6C5-6AA111111****",
"Data": {
"StoreSize": 407,
"ReconsumeTimes": 1,
"StoreTimestamp": 1570761026708,
"InstanceId": "MQ_INST_111111111111_DOxxxxxx",
"MsgId": "0BC16699165C03B925DB8A404E2D****",
"StoreHost": "11.220.***.***:10911",
"Topic": "test-mq_topic",
"PropertyList": {
"MessageProperty": [
{
"Value": "TagA",
"Name": "TAGS"
}
]
},
"BornTimestamp": 1570761026630,
"BodyCRC": 914112295,
"BornHost": "42.120.**.**:64646"
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|
View the information about a dead-letter message in the console
You can also view the information about a dead-letter message in the ApsaraMQ for RocketMQ console. For more information, see Dead-letter queues.