Updated on 2025-12-31 GMT+08:00

Querying the Offset of a Consumer Group

Function

This API is used to query the offset of a consumer group.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{engine}/{project_id}/instances/{instance_id}/groups/{group}/message-offset

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

engine

Yes

String

Message engine.

project_id

Yes

String

Project ID. For details, see Obtaining a Project ID.

instance_id

Yes

String

Instance ID.

group

Yes

String

Consumer group name.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

topic

Yes

String

Topic name. Mandatory for querying offset of a consumer group.

partition

No

String

Partition name.

offset

No

String

Offset.

limit

No

String

Maximum value.

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

group_message_offsets

Array of GroupMessageOffsetsDetailEntity objects

Consumer group offset details.

total

Integer

Total.

Table 4 GroupMessageOffsetsDetailEntity

Parameter

Type

Description

partition

String

Partition.

message_current_offset

String

Current offset.

topic

String

Topic name.

message_log_start_offset

Integer

Start offset.

lag

Integer

Number of remaining messages that can be consumed, that is, the number of accumulated messages.

message_log_end_offset

Integer

End offset.

consumer_id

String

Consumer ID.

host

String

Host name.

client_id

String

Client ID.

Example Requests

Querying the offset of a consumer group

GET https://{endpoint}/v2/{engine}/{project_id}/instances/{instance_id}/groups/{group}/message-offset?topic=topic-189717555

Example Responses

Status code: 200

Successful

{
  "group_message_offsets" : [ {
    "partition" : 0,
    "lag" : 0,
    "topic" : "topic-189717555",
    "message_current_offset" : 0,
    "message_log_start_offset" : 0,
    "message_log_end_offset" : 0,
    "consumer_id" : "",
    "host" : "",
    "client_id" : ""
  } ],
  "total" : 1
}

Status Codes

Status Code

Description

200

Successful

Error Codes

See Error Codes.