分布式消息服务-RocketMQ

查询指定时间段内订阅组内存在的死信消息

2024-07-02 09:10:45

接口介绍

查询指定时间段内消息服务订阅组内存在的死信消息。

接口约束

无。

URl

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

请求参数

请求参数

是否必填

位置

参数类型

说明

prodInstId

url

String

实例ID

groupName

url

String

订阅组名称

beginTime

url

long

开始时间的毫秒时间戳

endTime

url

long

结束时间的毫秒时间戳

响应参数

响应参数

参数类型

描述

statusCode

String

接口系统层面状态码。成功:800,失败:900

message

String

描述状态

returnObj

String

返回对象。此参数所包含的参数请见“响应示例"里面的注释

返回值returnObj参数说明

响应参数

参数类型

描述

total

Integer

总数

rows

List

死信消息列表

返回值rows参数说明

响应参数

参数类型

描述

queueId

Int

队列ID

storeSize

Int

消息大小

queueOffset

Long

队列偏移量

sysFlag

Int

系统标识

bornTimestamp

Long

产生时间戳(毫秒)

bornHost

String

产生主机

storeTimestamp

Long

存储时间戳(毫秒)

msgId

String

消息ID

commitLogOffset

Long

物理偏移量

bodyCRC

Int

包体CRC

reconsumeTimes

Int

重试次数

preparedTransactionOffset

Long

事务偏移量

properties

Map<String, String>

UNIQ_KEY:消息唯一key

ORIGIN_MESSAGE_ID:原始msgid

REAL_TOPIC:死信队列主题

RETRY_TOPIC:重试主题

messageBody

String

消息体

status

String

消费状态:

TO_CONSUME 未消费

CONSUMING  消费中

CONSUMED   已消费

 

请求示例

GET       https://[endpoint]/v2/dlq/getByTime getById?prodInstId=70687660456281088&groupName=group&beginTime=1661047215767&endTime=1661947215767

响应成功示例

{

    "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

}

响应失败示例

{

    "returnObj": {},

    "message": "...",

    "statusCode": "900"

}


oLthzKF0_pEy