Distributed Message Service RocketMQ

Querying Dead-letter Messages by Specific Message ID

2024-07-08 08:52:41

API Introduction

Used to query dead-letter messages by specific message ID.

API Restrictions

None.

URl

GET       https://[endpoint]/v2/dlq/getById

Request Parameters

Request Parameters

Required or Not

Position

Parameter Type

Description

prodInstId

Yes

url

String

Instance ID

groupName

Yes

url

String

Subscription Group Name

msgId

Yes

url

String

Message ID

Response Parameter

Response Parameter

Parameter Type

Description

statusCode

String

The   status code of the interface on the system layer. Success: 800; failure: 900.

message

String

Status   Description

returnObj

String

Return   the object. The parameters included in this parameter are described in the   comments in Response Examples.

Description of Return Value returnObj

Response Parameter

Parameter Type

Description

data

Json

Dead-letter   message data

 

Description of Return Value data

Response Parameter

Parameter Type

Description

queueId

Int

Queue ID

storeSize

Int

Message Size

queueOffset

Long

Queue Offset

sysFlag

Int

System Flag

bornTimestamp

Long

Generation Timestamp, in milliseconds.

bornHost

String

Generation Host

storeTimestamp

Long

Storage Timestamp, in milliseconds.

msgId

String

Message ID

commitLogOffset

Long

Physical Offset

bodyCRC

Int

Body CRC

reconsumeTimes

Int

Number of Retries

preparedTransactionOffset

Long

Transaction Offset

properties

Map<String,   String>

UNIQ_KEY: indicates the unique key

ORIGIN_MESSAGE_ID: original msgid

REAL_TOPIC: Dead-letter queue topic

RETRY_TOPIC: Retry topic

messageBody

String

Message body

status

String

Consumption Status:

TO_CONSUME: Not consumed

CONSUMING: Consuming

CONSUMED: Consumed

 

Sample Request

GET       https://[endpoint]/v2/dlq/getById? prodInstId=70687660456281088&groupName=group&msgId=C0A847BC000020E600000000000794D8

Examples of a Successful Response

{

    "returnObj":{

        "data":{

            "queueId":0,

            "storeSize":280,

            "queueOffset":0,

            "sysFlag":0,

            "bornTimestamp":1661947215767,

            "bornHost":"192.168.71.1:64222",

            "storeTimestamp":1661947567107,

            "storeHost":"192.168.71.188:8422",

            "msgId":"C0A847BC000020E600000000000794D8",

            "commitLogOffset":496856,

            "bodyCRC":1335308324,

            "reconsumeTimes":4,

            "preparedTransactionOffset":0,

            "topic":"%DLQ%group1",

            "properties":{

                "REAL_TOPIC":"%DLQ%group1",

                "ORIGIN_MESSAGE_ID":"C0A847BC000020E600000000000109F2",

                "RETRY_TOPIC":"test1",

                "UNIQ_KEY":"0505948D1C9C18B4AAC29EC9A7950000",

                "WAIT":"false",

                "DELAY":"5",

                "REAL_QID":"0"

            },

            "messageBody":"GZ2BfSrWuAinKs"

        }

    },

    "message":"success",

    "statusCode":800

}

Example of a Failed Response

{

    "returnObj": {},

    "message": "...",

    "statusCode": "900"

}


G0x_wuFGqzQt