You can call this operation to resend a dead-letter message with a specified message ID so that the message can be consumed again.

The maximum number of retries for a dead-letter message has been reached. If the message still fails to be consumed after being resent, a message with the same message ID will be 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 corresponding operation. You can identify the number of consumption failures after resending a message according to the number of messages with the same message ID.

Note:
  • A dead-letter message is a message that stills fails to be consumed after consumption retries. This generally indicates that the consumption logic may have errors. Therefore, identify the causes for the consumption failures and then call this operation to resend the message.
  • Message Queue for Apache RocketMQ does not manage the resending status of dead-letter messages. If a message is successfully consumed after being resent, the message will not be removed from the dead-letter queue. You need to manually manage the resending status of dead-letter messages and determine whether to resend a message, to avoid repeated consumptions caused by meaningless resending.

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 for the dead-letter message that you want to resend.

InstanceId String Yes MQ_INST_111111111111_DOxxxxxx

The ID of the Message Queue for Apache RocketMQ instance corresponding to the dead-letter message that you want to resend.

MsgId String Yes 1E0578FE110F18B4AAC235C0C******

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

Response parameters

Parameter Type Example Description
Data List 1E0578FE110F18B4AAC235C0C******

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

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

The ID of the request. This is a common parameter.

Examples

Sample requests

http(s)://[Endpoint]/? Action=OnsDLQMessageResendById
&GroupId=GID_test_group_id
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&MsgId=1E0578FE110F18B4AAC235C0C******
&<Common request parameters>

Sample success responses

XML format

<OnsDLQMessageResendByIdResponse>
  <Data>1E0578FE110F18B4AAC235C0C******</Data>
  <RequestId>D94CC769-4DC3-4690-A868-9D0631B*****</RequestId>
</OnsDLQMessageResendByIdResponse>

JSON format

{
  "Data": [
    "1E0578FE110F18B4AAC235C0C******"
  ],
  "RequestId": "D94CC769-4DC3-4690-A868-9D0631B*****"
}

Error codes

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