Resends a dead-letter message with a specified message ID so that this message can be re-consumed by a consumer.

Usage notes

A dead-letter message is a message that stills fails to be consumed after the number of consumption retries reaches the maximum limit. If the message still cannot be consumed after you resend it, a message with the same message ID will be added to the corresponding dead-letter queue. You can view the result on the Dead-Letter Queues page in the Message Queue for Apache RocketMQ console or by calling related API operations. You can determine the number of consumption failures for a message after you resend it, based on the number of messages with the same message ID.

Note
  • A dead-letter message is a message that stills fails to be consumed after the number of consumption retries reaches the maximum limit. This generally means that the consumption logic may have errors. Therefore, first identify the causes of 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. Therefore, dead-letter messages that are consumed after you resend them by calling this operation are not removed from dead-letter queues. You must manually manage dead-letter messages and determine whether to resend a dead-letter message. This way, you do not need to repeatedly resend dead-letter messages that are consumed.

QPS limit

The queries-per-second (QPS) limit on this operation is 10 per user. Throttling is triggered when the number of calls to this operation per second exceeds the QPS limit. Throttling may affect your business. Therefore, call this operation based on your needs. For more information, see QPS limits.

Authorization information

By default, only Alibaba Cloud accounts can call this operation. RAM users can call this operation only after they are authorized to use it. The following table lists the authorization information of this operation. For more information, see Policies and examples.

API

Action

Resource with a namespace

Resource without a namespace

OnsDLQMessageResendById

mq:ResendDLQMessage

acs:mq:*:*:{instanceId}%{groupId}

acs:mq:*:*:{groupId}

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_188077086902****_BXSuW61e

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

MsgId String Yes 0BC16699343051CD9F1D798E7734****

The ID of the message that you want to resend.

Response parameters

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

The ID of the message.

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

The ID of the request, which is a common parameter. Each request has a unique ID to facilitate troubleshooting and fault locating.

  • If the message fails to be resent, the ID of the message is returned.

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>
  <RequestId>D94CC769-4DC3-4690-A868-9D0631B1****</RequestId>
</OnsDLQMessageResendByIdResponse>

JSON format

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

Error codes

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

Operations in the console

In addition to calling the OnsDLQMessageResendById operation, you can resend specified dead-letter messages in the Message Queue for Apache RocketMQ console. For more information, see Dead-letter queues.