Distributed Message Service RocketMQ

Querying the Dead-letter Messages in a Subscription Group Within a Specified Period

2024-07-08 08:53:38

API Introduction

Used to query the dead-letter messages in a subscription group within a specified period.

API Restrictions

None.

URl

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

Request Parameters

Request Parameters

Required or Not

Position

Parameter Type

Description

prodInstId

Yes

url

String

Instance   ID

groupName

Yes

url

String

Subscription   Group Name

beginTime

Yes

url

long

Millisecond   timestamp of start time

endTime

Yes

url

long

Millisecond   timestamp for end time

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

total

Integer

Total

rows

List

List   of Dead-letter Messages

Description of Return Value rows

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/getByTime getById?prodInstId=70687660456281088&groupName=group&beginTime=1661047215767&endTime=1661947215767

Examples of a Successful Response

{

    "returnObj":{

        "total":1,

        "rows":[

            {

                "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":{

                    "MIN_OFFSET":"0",

                    "REAL_TOPIC":"%DLQ%group1",

                    "ORIGIN_MESSAGE_ID":"C0A847BC000020E600000000000109F2",

                    "RETRY_TOPIC":"test1",

                    "MAX_OFFSET":"1",

                    "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"

}


ouIcfYwBeY15