All Products
Search
Document Center

ApsaraMQ for RocketMQ:GetConsumerGroupSubscription

Last Updated:Aug 28, 2026

Queries subscription details of a consumer group, including client connections.

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:GetConsumerGroupSubscription

get

*ConsumerGroup

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

None None

Request syntax

GET /instances/{instanceId}/consumerGroups/{consumerGroupId}/subscriptions/{topicName} HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

The instance ID.

rmq-cn-uqm32kqyy11

consumerGroupId

string

Yes

The consumer group ID.

common_dev

topicName

string

Yes

The topic name.

mq003

Request parameters

Parameter

Type

Required

Description

Example

No parameters required.

Response elements

Element

Type

Description

Example

object

The response parameters.

requestId

string

The request ID.

157DF7D4-53FB-58C6-BEBC-A9400E7EF68A

success

boolean

Indicates whether the request was successful.

true

data

array<object>

The data returned.

array<object>

The subscriptions.

subscriptionDTO

object

The subscription details.

consumerGroupId

string

The consumer group ID.

GID_inspector_group

topicName

string

The topic to which the consumer group subscribes.

Topic_normal_inspector

messageModel

string

The consumption mode of the consumer group. Valid values:

  • BROADCASTING: broadcasting consumption

  • CLUSTERING: clustering consumption

BROADCASTING

subscriptionStatus

string

The subscription status. Valid values:

  • ONLINE: The consumer group is online. If the consumer group contains multiple consumers, this value is returned if at least one of the consumers is online.

  • OFFLINE: The consumer group is offline. If the consumer group contains multiple consumers, this value is returned only if all consumers are offline.

ONLINE

filterExpression

string

The filter expression.

*

filterExpressionType

string

The type of the filter expression. Valid values:

  • SQL: filters messages by using SQL expressions.

  • TAG: filters messages by using tags.

UNSPECIFIED

connectionDTO

object

The connection details.

clientId

string

The client ID.

192.168.50.191@19908#-2093249153#1534215565#40385215750900

hostname

string

The hostname.

nginx

egressIp

string

The public IP address of the host.

xx.xx.xx.xx

language

string

The language of the client.

zh

version

string

The client version.

1.0.0

messageModel

string

The consumption mode of the consumer group. Valid values:

  • BROADCASTING: broadcasting consumption

  • CLUSTERING: clustering consumption

BROADCASTING

code

string

The error code.

Instance.NotFound

message

string

The error message.

Parameter instanceId is mandatory for this action .

httpStatusCode

integer

The HTTP status code.

200

dynamicCode

string

The dynamic error code.

InstanceId

dynamicMessage

string

The dynamic error message.

instanceId

Examples

Success response

JSON format

{
  "requestId": "157DF7D4-53FB-58C6-BEBC-A9400E7EF68A",
  "success": true,
  "data": [
    {
      "subscriptionDTO": {
        "consumerGroupId": "GID_inspector_group",
        "topicName": "Topic_normal_inspector",
        "messageModel": "BROADCASTING",
        "subscriptionStatus": "ONLINE",
        "filterExpression": "*",
        "filterExpressionType": "UNSPECIFIED"
      },
      "connectionDTO": {
        "clientId": "192.168.50.191@19908#-2093249153#1534215565#40385215750900",
        "hostname": "nginx",
        "egressIp": "xx.xx.xx.xx",
        "language": "zh",
        "version": "1.0.0",
        "messageModel": "BROADCASTING"
      }
    }
  ],
  "code": "Instance.NotFound",
  "message": "Parameter instanceId is mandatory for this action .",
  "httpStatusCode": 200,
  "dynamicCode": "InstanceId",
  "dynamicMessage": "instanceId"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.