Distributed Message Service RocketMQ

Resetting the Subscription Group Consumption Progress to the Specified Timestamp

2024-07-08 08:44:35

API Introduction

Used to reset the subscription group consumption progress to the specified timestamp.

API Restrictions

None.

URl

POST     https://[endpoint]/v2/consumer/resetOffset

Request Parameters

Request Parameters

Required or Not

Position

Parameter Type

Description

prodInstId

Yes

url

String

Instance   ID

groupName

Yes

url

String

Subscription   Group Name

topicName

Yes

url

String

Topic   Name

resetTime

Yes

url

long

Millisecond   timestamp to be reset

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   Number of Reset Messages

diffOffset

Integer

Offset   Difference

rows

List

Queue   Reset List

Description of Return Value rows

Response Parameter

Parameter Type

Description

brokerName

Integer

Total   Number of Reset Messages

queueId

Integer

Offset   Difference

brokerOffset

List

Queue   Reset List

consumerOffset

Integer

Consumption   Progress

timestampOffset

Integer

Reset   Time Offset

rollbackOffset

Integer

Rollback   Offset

Sample Request

POST https://[endpoint]/v2/consumer/resetOffset

{

    "prodInstId":"mq_test",

    "groupName":"group",

    "topicName":"test",

    "resetTime":1661843664000

}

Examples of a Successful Response

{

    "returnObj":{

        "total":4,

        "diffOffset":5,

        "rows":[

            {

                "brokerName":"mq_test_broker_1",

                "queueId":0,

                "brokerOffset":6,

                "consumerOffset":6,

                "timestampOffset":5,

                "rollbackOffset":5

            },

            {

                "brokerName":"mq_test_broker_1",

                "queueId":1,

                "brokerOffset":6,

                "consumerOffset":6,

                "timestampOffset":5,

                "rollbackOffset":5

            },

            {

                "brokerName":"mq_test_broker_1",

                "queueId":2,

                "brokerOffset":7,

                "consumerOffset":7,

                "timestampOffset":6,

                "rollbackOffset":6

            },

            {

                "brokerName":"mq_test_broker_1",

                "queueId":3,

                "brokerOffset":8,

                "consumerOffset":8,

                "timestampOffset":6,

                "rollbackOffset":6

            }

        ]

    },

    "message":"success",

    "statusCode":800

}

Example of a Failed Response

{

    "returnObj": {},

    "message": "...",

    "statusCode": "900"

}


FV6gh_NpZ3bR