Updated on 2025-06-20 GMT+08:00

Querying All Consumer Groups

Function

This API is used to query all consumer groups.

Call Method

For details, see How to Call an API.

URI

GET /v2/{engine}/{project_id}/instances/{instance_id}/groups

Table 1 URI parameters

Parameter

Mandatory

Type

Description

engine

Yes

String

Indicates the message engine.

project_id

Yes

String

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

instance_id

Yes

String

Instance ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Offset, which is the position where the query starts. The value must be greater than or equal to 0.

limit

No

Integer

Maximum number of consumer group IDs returned in the current query. The default value is 10. The value ranges from 1 to 50.

group

No

String

Filtering consumer group names that contain specific keywords.

topic

No

String

If a topic is specified, only the consumer groups of the topic are queried.

Request

None.

Response

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

total

Number

Total number of consumer groups.

groups

Array of ConsumerGroup objects

Consumer group list.

max

Integer

Maximum number of consumer groups that can be created.

remaining

Integer

Number of consumer groups that can still be created.

next_offset

Integer

Offset of the next page.

previous_offset

Integer

Offset of the previous page.

Table 4 ConsumerGroup

Parameter

Type

Description

enabled

Boolean

Whether consumption is allowed.

broadcast

Boolean

Whether to broadcast.

brokers

Array of strings

List of associated brokers.

name

String

Consumer group name. Enter 3 to 64 characters. Use only letters, digits, percent (%), vertical bars (|), hyphens (-), and underscores (_).

group_desc

String

Consumer group description. 0 to 200 characters.

retry_max_time

Integer

Maximum number of retries. The value ranges from 1 to 16.

createdAt

Long

Creation timestamp.

permissions

Array of strings

Permission set.

consume_orderly

Boolean

Whether orderly consumption is enabled.

Example Request

GET https://{endpoint}/v2/{engine}/{project_id}/instances/{instance_id}/groups

Example Response

Status code: 200

Metrics queried successfully.

{
  "total" : 1,
  "groups" : [ {
    "name" : "group-1",
    "enabled" : true,
    "broadcast" : false,
    "brokers" : [ "broker-0" ],
    "createdAt" : 1709087952686,
    "permissions" : [ ],
    "retry_max_time" : 16,
    "consume_orderly" : false
  } ],
  "max" : 4000,
  "remaining" : 3999,
  "next_offset" : -1,
  "previous_offset" : -1
}

Status Code

Status Code

Description

200

Successful

Error Code

See Error Codes.