You can call the OnsDLQMessageGetById API to query dead-letter messages with a specified Message ID. The queried information includes the storage time, body, Key, Tag, and other attributes of the dead-letter message.

An exact query is performed by querying dead-letter messages by Message ID. You can obtain the Message ID required for the query condition from SendResult after the Message is sent or by calling the batch query operation.


You can directly run this interface in OpenAPI Explorer, saving you from the trouble of calculating the signature. After the SDK runs successfully, OpenAPI Explorer automatically generates SDK code examples.

Request parameters

Name Type Required or not Sample value 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 Group ID of the consumer you want to query.

MsgId String Yes Number of frontend servers *

The ID of the Message you want to query, that is, the Message ID.

InstanceId String No Mq_inst_1111111111_doxxxxxx

The ID of the instance for which you want to query messages. This parameter is required for instances with independent namespaces.

Response Data

Name Type Sample value Description
RequestId String A07E3902-B92E-44A6-B6C5-6AA1111111799

A common parameter. Each request has a unique ID.

Data Struct

Query Results

Topic String test-mq_topic

The Topic of the message.

Body String Renewal

Message body

StoreSize Integer 407

Message Size

BornTimestamp Long 1570761026630

The timestamp stored by the server.

BornHost String 42.120. **. **: 64646

The client instance that generates the message.

StoreTimestamp Long 1570761026708

The timestamp stored by the server.

StoreHost String 11.220. Special questions *. ***: 10911

The server instance that stores the message.

MsgId String Number of frontend servers *

The message ID.

BodyCRC Integer 914112295

The message body CRC value.

ReconsumeTimes Integer 1

The number of retries for message consumption.

InstanceId String Mq_inst_1111111111_doxxxxxx

Instance ID

PropertyList Array

The list of message properties.

Name String TAGS

The message property. Valid values:

  • TRACE_ON: Whether the message trace is enabled
  • KEYS: The Key attribute of the message.
  • TAGS: The Tag attribute of the message.
  • INSTANCE_ID: ID of the instance where the message is located.

For more information, see Terms.

Value String TagA

The value of the message property.


Request example

http(s)://[Endpoint]/? Action=OnsDLQMessageGetById
& <Common request parameters>

Normal response example


  &quot;Data&quot;: {
    &quot;MsgId&quot;: &quot;0BC16699165C03B925DB8A404E2D****&quot;,
    &quot;Body&quot;: &quot;SGVsbG8gTVEg5raT7oWf5p6D5ai05ayt55iv&quot;,
    &quot;InstanceId&quot;: &quot;MQ_INST_111111111111_DOxxxxxx&quot;,
    &quot;ReconsumeTimes&quot;: 1,
    &quot;BornHost&quot;: &quot;42.120. Cause *. **: 64646 &quot;,
    &quot;BodyCRC&quot;: 914112295,
    &quot;StoreHost&quot;: &quot;11.220. Supported regions *. ***: 10911 &quot;,
    &quot;StoreTimestamp&quot;: 1570761026708,
    &quot;BornTimestamp&quot;: 1570761026630,
    &quot;Topic&quot;: &quot;test-mq_topic&quot;,
    &quot;StoreSize&quot;: 407,
    &quot;PropertyList&quot;: {
  &quot;RequestId&quot;: &quot;A07E3902-B92E-44A6-B6C5-6AA1111111799&quot;


        <BornHost>42.120. Cause *. **:64646</BornHost>
        <StoreHost>11.220. Supported regions *. ***:10911</StoreHost>

Error code