All Products
Search
Document Center

ApsaraMQ for RocketMQ:OnsDLQMessageGetById

Last Updated:Mar 03, 2024

Queries a dead-letter message based on the message ID. The queried information about the dead-letter message includes the point in time when the message is stored, the message body, and attributes such as the message tag and the message key.

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.

This operation uses the exact match method to query a dead-letter message based on the message ID. You can obtain the message ID that is required to query the information about a dead-letter message from the SendResult parameter that is returned after the message is sent. You can also obtain the message ID by calling the OnsDLQMessagePageQueryByGroupId operation to query multiple messages at a time. The queried information about the dead-letter message includes the point in time when the message is stored, the message body, and attributes such as the message tag and the message key.

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:QueryDLQMessageRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
MsgIdstringYes

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

0BC16699165C03B925DB8A404E2D****
GroupIdstringYes

The ID of the consumer group whose dead-letter message you want to query.

GID_test_group_id
InstanceIdstringYes

The ID of the instance to which the message you want to query belongs.

MQ_INST_111111111111_DOxxxxxx

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request. This parameter is a common parameter. Each request has a unique ID.

A07E3902-B92E-44A6-B6C5-6AA111111****
Dataobject

The data returned.

StoreSizeinteger

The size of the message. Unit: KB.

407
ReconsumeTimesinteger

The number of retries that were performed to send the message to consumers.

1
StoreTimestamplong

The timestamp that indicates the point in time when the ApsaraMQ for RocketMQ broker stored the message. Unit: milliseconds.

1570761026708
InstanceIdstring

The ID of the instance

MQ_INST_111111111111_DOxxxxxx
MsgIdstring

The ID of the dead-letter message.

0BC16699165C03B925DB8A404E2D****
StoreHoststring

The ApsaraMQ for RocketMQ broker that stores the message.

11.220.***.***:10911
Topicstring

The topic to which the message belongs.

test-mq_topic
PropertyListobject []

The attributes of the message.

Valuestring

The value of the attribute.

TagA
Namestring

The name of the attribute. Valid values:

  • TRACE_ON: indicates whether the message trace exists.
  • KEYS: indicates the key of the message.
  • TAGS: indicates the tag that is attached to the message.
  • INSTANCE_ID: indicates the ID of the instance that contains the message.

For information about the terms that are used in ApsaraMQ for RocketMQ, see Terms .

TAGS
BornTimestamplong

The timestamp that indicates the point in time when the message was generated. Unit: milliseconds.

1570761026630
BodyCRCinteger

The cyclic redundancy check (CRC) value of the message body.

914112295
BornHoststring

The producer instance that generated the message.

42.120.**.**:64646

Examples

Sample success responses

JSONformat

{
  "RequestId": "A07E3902-B92E-44A6-B6C5-6AA111111****",
  "Data": {
    "StoreSize": 407,
    "ReconsumeTimes": 1,
    "StoreTimestamp": 1570761026708,
    "InstanceId": "MQ_INST_111111111111_DOxxxxxx",
    "MsgId": "0BC16699165C03B925DB8A404E2D****",
    "StoreHost": "11.220.***.***:10911",
    "Topic": "test-mq_topic",
    "PropertyList": {
      "MessageProperty": [
        {
          "Value": "TagA",
          "Name": "TAGS"
        }
      ]
    },
    "BornTimestamp": 1570761026630,
    "BodyCRC": 914112295,
    "BornHost": "42.120.**.**:64646"
  }
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history

View the information about a dead-letter message in the console

You can also view the information about a dead-letter message in the ApsaraMQ for RocketMQ console. For more information, see Dead-letter queues.