All Products
Search
Document Center

ApsaraMQ for RocketMQ:ListConsumerGroups

Last Updated:Dec 19, 2025

Lists the consumer groups in a specified instance.

Operation description

Important The Alibaba Cloud OpenAPI is a management API. You can use this API to manage and query resources for Alibaba Cloud services. Integrate this API only into your management link. Do not use this API in the core data link for sending and receiving messages. This helps prevent potential threats to your data link.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

rocketmq:ListConsumerGroups

list

*ConsumerGroup

acs:rocketmq:{#regionId}:{#accountId}:instance/{#InstanceId}/consumergroup/*

None None

Request syntax

GET /instances/{instanceId}/consumerGroups HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

The ID of the instance.

rmq-cn-7e22ody****

Request parameters

Parameter

Type

Required

Description

Example

filter

string

No

The filter condition. If you do not specify this parameter, all consumer groups in the instance are returned.

CID-TEST

pageNumber

integer

No

The page number of the results to return.

1

pageSize

integer

No

The number of entries to return on each page.

Valid values: 10 to 100.

10

Response elements

Element

Type

Description

Example

object

Result<MyPage<ConsumerGroupDto>>

requestId

string

The request ID. Each request has a unique ID. You can use this ID to troubleshoot issues.

5503A460-98ED-5543-92CF-4853DE28****

success

boolean

Indicates whether the request was successful.

true

data

object

The returned data.

pageNumber

integer

The current page number.

1

pageSize

integer

The number of entries returned per page.

10

totalCount

integer

The total number of entries returned.

1

list

array<object>

The data returned on the current page.

object

regionId

string

The ID of the region where the instance resides.

cn-hangzhou

instanceId

string

The instance ID.

rmq-cn-7e22ody****

consumerGroupId

string

The consumer group ID.

GID-TEST

status

string

The status of the consumer group.

Valid values:

  • RUNNING :

    The consumer group is running.

  • CREATING :

    The consumer group is being created.

RUNNING

remark

string

The remarks on the consumer group.

This is the remark for test.

createTime

string

The time when the consumer group was created.

2022-08-01 20:05:50

updateTime

string

The time when the consumer group was last updated.

2022-08-01 20:05:50

maxReceiveTps

integer

The maximum transactions per second (TPS) for message consumption.

1000

messageModel

string

The consumption mode.

LITE_SELECTIVE

topicName

string

The name of the topic for a lite consumer group.

test1

code

string

The error code.

MissingInstanceId

message

string

The error message.

Parameter InstanceId is mandatory for this action .

httpStatusCode

integer

The HTTP status code.

400

dynamicCode

string

The dynamic error code.

InstanceId

dynamicMessage

string

The dynamic error message.

instanceId

Examples

Success response

JSON format

{
  "requestId": "5503A460-98ED-5543-92CF-4853DE28****",
  "success": true,
  "data": {
    "pageNumber": 1,
    "pageSize": 10,
    "totalCount": 1,
    "list": [
      {
        "regionId": "cn-hangzhou",
        "instanceId": "rmq-cn-7e22ody****",
        "consumerGroupId": "GID-TEST",
        "status": "RUNNING",
        "remark": "This is the remark for test.",
        "createTime": "2022-08-01 20:05:50",
        "updateTime": "2022-08-01 20:05:50",
        "maxReceiveTps": 1000,
        "messageModel": "LITE_SELECTIVE",
        "topicName": "test1"
      }
    ]
  },
  "code": "MissingInstanceId",
  "message": "Parameter InstanceId is mandatory for this action .",
  "httpStatusCode": 400,
  "dynamicCode": "InstanceId",
  "dynamicMessage": "instanceId"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.