All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsDLQMessageResendById

Last Updated:Mar 03, 2024

Resends a dead-letter message based on a specified message ID so that the dead-letter message can be consumed by consumers.

Operation description

Note API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur.
  • 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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
mq:ResendDLQMessageRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
MsgIdstringYes

The ID of the dead-letter message that you want to send to a consumer group for consumption.

0BC16699343051CD9F1D798E7734****
GroupIdstringYes

The ID of the consumer group in which you want to query dead-letter messages.

GID_test_group_id
InstanceIdstringYes

The ID of the instance in which the dead-letter message you want to query resides.

MQ_INST_188077086902****_BXSuW61e

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request. This parameter is a common parameter. Each request has a unique ID. You can use this ID to troubleshoot issues.

D94CC769-4DC3-4690-A868-9D0631B1****
Dataarray

The returned messages.

string

The ID of the message.

0BC16699343051CD9F1D798E7734****
Note If the message fails to be sent, the message ID is returned in the response.

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
No change history

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.