Queries a dead-letter message by specifying the message ID.

Usage notes

It is an exact search to query a dead-letter message based on a specified message ID. You can query the message ID required for the query condition from SendResult after the message is sent or by calling the operation for batch query. The queried information includes properties such as the storage time, message body, message key, and message tag.

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

OnsDLQMessageGetById

mq:QueryDLQMessage

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

acs:mq:*:*:{groupId}

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 OnsDLQMessageGetById

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

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 that corresponds to the message you want to query.

MsgId String Yes 0BC16699165C03B925DB8A404E2D****

The ID of the message that you want to query.

Note For more information about these parameters, see Common parameters and Make API requests.

Response parameters

Parameter Type Example Description
Data Struct

The query results.

BodyCRC Integer 914112295

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

BornHost String 42.120.**. **:64646

The producer instance that produced the message.

BornTimestamp Long 1570761026630

The timestamp that indicates when the Message Queue for Apache RocketMQ broker stored the message.

InstanceId String MQ_INST_111111111111_DOxxxxxx

The ID of the Message Queue for Apache RocketMQ instance.

MsgId String 0BC16699165C03B925DB8A404E2D****

The ID of the message.

PropertyList Array of MessageProperty

A returned list of properties of the message.

MessageProperty
Name String TAGS

The property of the message. Valid values:

  • TRACE_ON: indicates whether a trace of the message exists.
  • KEYS: indicates the key property of the message.
  • TAGS: indicates the tag property of the message.
  • INSTANCE_ID: indicates the ID of the Message Queue for Apache RocketMQ instance that corresponds to the message.

For more information about the terms, see Terms.

Value String TagA

The value of the message property.

ReconsumeTimes Integer 1

The number of consumption retries of the message.

StoreHost String 11.220.***. ***:10911

The Message Queue for Apache RocketMQ broker that stored the message.

StoreSize Integer 407

The size of the message.

StoreTimestamp Long 1570761026708

The timestamp that indicates when the Message Queue for Apache RocketMQ broker stored the message.

Topic String test-mq_topic

The topic of the message.

RequestId String A07E3902-B92E-44A6-B6C5-6AA111111****

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

Examples

Sample requests

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

Sample success responses

XML format

<OnsDLQMessageGetByIdResponse>
  <Data>
        <MsgId>1E0578FE110F18B4AAC235C0C8460BA2</MsgId>
        <InstanceId>MQ_INST_111111111111_DOxxxxxx</InstanceId>
        <ReconsumeTimes>1</ReconsumeTimes>
        <BornHost>42.120. **. **:64646</BornHost>
        <BodyCRC>914112295</BodyCRC>
        <StoreHost>11.220. ***. ***:10911</StoreHost>
        <StoreTimestamp>1570761026708</StoreTimestamp>
        <BornTimestamp>1570761026630</BornTimestamp>
        <Topic>test-mq_topic</Topic>
        <StoreSize>407</StoreSize>
        <PropertyList>
              <MessageProperty>
                    <Name>TRACE_ON</Name>
                    <Value>true</Value>
              </MessageProperty>
              <MessageProperty>
                    <Name>RETRY_TOPIC</Name>
                    <Value>MQ_INST_111111111111_DOxxxxxx%test-mq_topic</Value>
              </MessageProperty>
              <MessageProperty>
                    <Name>KEYS</Name>
                    <Value>ORDERID_993</Value>
              </MessageProperty>
              <MessageProperty>
                    <Name>UNIQ_KEY</Name>
                    <Value>1E0578FE110F18B4AAC235C0C84*****</Value>
              </MessageProperty>
              <MessageProperty>
                    <Name>WAIT</Name>
                    <Value>false</Value>
              </MessageProperty>
              <MessageProperty>
                    <Name>TAGS</Name>
                    <Value>TagA</Value>
              </MessageProperty>
              <MessageProperty>
                    <Name>INSTANCE_ID</Name>
                    <Value>MQ_INST_111111111111_DOxxxxxx</Value>
              </MessageProperty>
        </PropertyList>
  </Data>
  <RequestId>A07E3902-B92E-44A6-B6C5-6AA111111****</RequestId>
</OnsDLQMessageGetByIdResponse>

JSON format

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

Error codes

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

Operations in the console

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