Queries the information about consumer groups within the current account.
Note
This operation returns a consumer group list and does not return the details of consumer groups.
QPS limit
Each Alibaba Cloud account can call this operation up to 10 times per second. If the number of requests that you send to call this operation within a second exceeds the queries per second (QPS) limit, throttling is triggered. This may interrupt your business. For information about the QPS limit of each operation, see API rate limits.
Authorization
By default, Alibaba Cloud accounts can call this operation. A Resource Access Management (RAM) user can call this operation only after the RAM user is granted the required permissions. The following table describes the permissions that must be granted to a RAM user to call this operation.
API |
Action |
Resource |
---|---|---|
OnsGroupList |
mq:QueryInstanceBaseInfo |
acs:mq:*:*:{instanceId} |
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | OnsGroupList |
The operation that you want to perform. Set the value to OnsGroupList. |
InstanceId | String | Yes | MQ_INST_111111111111_DOxxxxxx |
The ID of the Message Queue for Apache RocketMQ instance to which the consumer groups you want to query belong. |
GroupId | String | No | GID_test_group_id |
This parameter is required only when you query specific consumer groups by using the fuzzy query method. If this parameter is not configured, the system queries all consumer groups that can be accessed by the current account. If you set this parameter to GID_ABC, the information about the consumer groups whose IDs contain GID_ABC is returned. For example, the information about the GID_test_GID_ABC_123 and GID_ABC_356 consumer groups is returned. |
GroupType | String | No | tcp |
The protocol over which the queried consumer groups consume messages. All clients in a consumer group communicate with the Message Queue for Apache RocketMQ broker over the same protocol. A consumer group cannot contain TCP clients and HTTP clients at the same time. You must create different consumer groups for TCP clients and HTTP clients. Valid values:
|
Tag.N.Key | String | Yes | CartService |
The key of a tag that is attached to the consumer group. This parameter is not required. If you configure this parameter, you must configure the Tag.N.Value parameter. If you specify tags, the system filters consumer groups based on the specified tags. If you do not specify tags, the system queries all consumer groups that can be accessed by the current account.
|
Tag.N.Value | String | Yes | ServiceA |
The value of the tag that is specified by the Tag.N.Key parameter. This parameter is not required. If you configure this parameter, you must configure the Tag.N.Value parameter. If you specify tags, the system filters consumer groups based on the specified tags. If you do not specify tags, the system queries all consumer groups that can be accessed by the current account.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 16996623-AC4A-43AF-9248-FD9D2D75**** |
The ID of the request. The system generates a unique ID for each request. You can troubleshoot issues based on the request ID. |
Data | Array of SubscribeInfoDo |
The data that is returned. |
|
SubscribeInfoDo | |||
Owner | String | 138015630679**** |
The ID of the user who created the consumer group. |
UpdateTime | Long | 1570700979000 |
The most recent point in time when the consumer group was updated. |
IndependentNaming | Boolean | true |
Indicates whether a namespace is configured for the Message Queue for Apache RocketMQ instance to which the consumer group belong. Valid values:
|
GroupId | String | GID_test_group_id |
The ID of the consumer group. |
Remark | String | test |
The description of the consumer group. |
CreateTime | Long | 1568896605000 |
The point in time when the consumer group was created. |
Tags | Array of Tag |
The tags that are attached to the consumer group. |
|
Tag | |||
Key | String | CartService |
The key of the tag. |
Value | String | ServiceA |
The value of the tag. |
InstanceId | String | MQ_INST_111111111111_DOxxxxxx |
The ID of the instance. |
GroupType | String | tcp |
The protocol over which the queried consumer groups consume messages. All clients in a consumer group communicate with the Message Queue for Apache RocketMQ broker over the same protocol. A consumer group cannot contain TCP clients and HTTP clients at the same time. You must create different consumer groups for TCP clients and HTTP clients. Valid values:
|
Examples
Sample requests
http(s)://ons.cn-hangzhou.aliyuncs.com/?Action=OnsGroupList
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&Tag.1.Key=CartService
&Tag.1.Value=ServiceA
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<OnsGroupListResponse>
<RequestId>16996623-AC4A-43AF-9248-FD9D2D75****</RequestId>
<Data>
<SubscribeInfoDo>
<Owner>138015630679****</Owner>
<GroupType>tcp</GroupType>
<InstanceId>MQ_INST_111111111111_DOxxxxxx</InstanceId>
<CreateTime>1568896605000</CreateTime>
<UpdateTime>1570700979000</UpdateTime>
<IndependentNaming>true</IndependentNaming>
<GroupId>GID_test_group_id</GroupId>
<Remark>test</Remark>
<Tags>
<Tag>
<Value>ServiceA</Value>
<Key>CartService</Key>
</Tag>
</Tags>
</SubscribeInfoDo>
</Data>
</OnsGroupListResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "16996623-AC4A-43AF-9248-FD9D2D75****",
"Data" : {
"SubscribeInfoDo" : [ {
"Owner" : "138015630679****",
"GroupType" : "tcp",
"InstanceId" : "MQ_INST_111111111111_DOxxxxxx",
"CreateTime" : 1568896605000,
"UpdateTime" : 1570700979000,
"IndependentNaming" : true,
"GroupId" : "GID_test_group_id",
"Remark" : "test",
"Tags" : {
"Tag" : [ {
"Value" : "ServiceA",
"Key" : "CartService"
} ]
}
} ]
}
}
Error codes
For a list of error codes, visit the API Error Center.