Resends a dead-letter message based on a specified message ID so that the dead-letter message can be consumed by consumers.
Operation description
- A dead-letter message is a message that still fails to be consumed after the number of consumption retries reaches the upper limit. If the message still cannot be consumed after you re-send it, a message with the same message ID is added to the corresponding dead-letter queue. You can query the message ID on the Dead-letter Queues page in the ApsaraMQ for RocketMQ console or by calling API operations. You can obtain the number of consumption failures for a message based on the number of dead-letter messages with the same message ID in the dead-letter queue.
- A dead-letter message is a message that fails to be consumed after the number of consumption retries reaches the upper limit. Generally, dead-letter messages are produced because of incorrect consumption logic. We recommend that you troubleshoot the consumption failures and then call this operation to send the message to the consumer group for consumption again.
- ApsaraMQ for RocketMQ does not manage the status of dead-letter messages based on the consumption status of the dead-letter messages. After you call this operation to send a dead-letter message to a consumer group and the message is consumed, ApsaraMQ for RocketMQ does not remove the dead-letter message from the dead-letter queue. You must manage dead-letter messages and determine whether to send a dead-letter message to a consumer group for consumption. This way, you do not resend or reconsume the messages that are consumed.
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:ResendDLQMessage | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
MsgId | string | Yes | The ID of the dead-letter message that you want to send to a consumer group for consumption. | 0BC16699343051CD9F1D798E7734**** |
GroupId | string | Yes | The ID of the consumer group in which you want to query dead-letter messages. | GID_test_group_id |
InstanceId | string | Yes | The ID of the instance in which the dead-letter message you want to query resides. | MQ_INST_188077086902****_BXSuW61e |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "D94CC769-4DC3-4690-A868-9D0631B1****",
"Data": {
"MsgId": [
"0BC16699343051CD9F1D798E7734****"
]
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|
Send a dead-letter message to a consumer group in the console
You can also send a dead-letter message to a consumer group for consumption in the ApsaraMQ for RocketMQ console. For more information, see Dead-letter queues.