Resends a dead-letter message with a specified message ID.

This operation enables consumers to attempt to consume the dead-letter message again.

Before you call this operation, the maximum number of retries for the dead-letter message has been reached. If the message still fails to be consumed after the message is resent, a message with the same message ID is added to the dead-letter queue. You can view the result of this operation on the Dead-Letter Queue page in the console or by calling the query API operations. You can calculate the number of messages with the same message ID to learn the number of times the message fails to be consumed after the message is resent.

Note
  • A dead-letter message is a message that fails to be consumed after consumption retries have been triggered by the retry logic. This generally indicates that the consumption logic may be erroneous. Therefore, you must identify the causes for the consumption failures before you call this operation to resend the message.
  • Message Queue for Apache RocketMQ does not manage the resending status of dead-letter messages. Therefore, dead-letter messages that are consumed after you resend them by calling this operation are not removed from the dead-letter queue. You must manually manage dead-letter messages and determine whether to resend a dead-letter message, to avoid resending dead-letter messages that have been consumed.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes OnsDLQMessageResendById

The operation that you want to perform. Set the value to OnsDLQMessageResendById.

GroupId String Yes GID_test_group_id

The consumer group ID that you want to query.

InstanceId String Yes MQ_INST_188077086902****_BXSuW61e

The ID of the Message Queue for Apache RocketMQ instance that corresponds to the message.

MsgId String Yes 0BC16699343051CD9F1D798E7734****

The message ID of the dead-letter message that you want to resend.

Response parameters

Parameter Type Example Description
Data List 0BC16699343051CD9F1D798E7734****

The message ID of the dead-letter message that was resent.

RequestId String D94CC769-4DC3-4690-A868-9D0631B1****

The ID of the request.

Examples

Sample requests

http(s)://ons.cn-hangzhou.aliyuncs.com/? Action=OnsDLQMessageResendById
&GroupId=GID_test_group_id
&InstanceId=MQ_INST_188077086902****_BXSuW61e
&MsgId=0BC16699343051CD9F1D798E7734****
&<Common request parameters>

Sample success responses

XML format

<OnsDLQMessageResendByIdResponse>
  <Data>0BC16699343051CD9F1D798E7734****</Data>
  <RequestId>D94CC769-4DC3-4690-A868-9D0631B1****</RequestId>
</OnsDLQMessageResendByIdResponse>

JSON format

{
  "Data": [
    "0BC16699343051CD9F1D798E7734****"
  ],
  "RequestId": "D94CC769-4DC3-4690-A868-9D0631B1****"
}

Error codes

For a list of error codes, visit the API Error Center.