Queries the detailed information about the status of a specified consumer group. This operation returns the transactions per second (TPS) for message consumption, load balancing status, consumer connection status, and whether all consumers in the consumer group subscribe to the same topics and tags.
Operation description
- You can call this operation in scenarios in which consumers are online and messages are accumulated. You can troubleshoot errors based on the information that is returned by this operation. You can check whether all consumers in the consumer group subscribe to the same topics and tags, and whether load balancing is performed as expected. You can also obtain the information about thread stack traces of online consumers.
- This operation uses multiple backend operations to query and aggregate data. The system requires a long period of time to process a request. We recommend that you do not frequently call this operation.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
mq:QueryConsumerStatus | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
GroupId | string | Yes | The ID of the consumer group whose details you want to query. | GID_test_group_id |
Detail | boolean | No | Specifies whether to query the details of the consumer group. Valid values:
| true |
NeedJstack | boolean | No | Specifies whether to query the information about thread stack traces. Valid values:
Note
If you want to obtain the information about thread stack traces, make sure that the Detail parameter in the request is set to true.
| true |
InstanceId | string | Yes | The ID of the instance to which the consumer group belongs. | MQ_INST_111111111111_DOxxxxxx |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "10EDC518-10E7-4B34-92FB-171235FA****",
"Data": {
"ConsumeTps": 0,
"ConsumeModel": "CLUSTERING",
"ConnectionSet": {
"ConnectionDo": [
{
"RemoteIP": "42.120.74.**",
"Version": "V4_3_6_SNAPSHOT",
"ClientAddr": "30.5.121.**",
"Language": "JAVA",
"ClientId": "30.5.121.**@25560#-1999745829#-1737591554#458773089270275"
}
]
},
"TotalDiff": 197,
"ConsumerConnectionInfoList": {
"ConsumerConnectionInfoDo": [
{
"ConsumeModel": "CLUSTERING",
"RunningDataList": {
"ConsumerRunningDataDo": [
{
"GroupId": "0",
"Rt": 0,
"Topic": "test-mq_topic",
"FailedCountPerHour": 0,
"OkTps": 0,
"FailedTps": 0
}
]
},
"SubscriptionSet": {
"SubscriptionData": [
{
"SubString": "*",
"SubVersion": 1570701364301,
"Topic": "test-mq_topic",
"TagsSet": {
"Tag": [
"ff"
]
}
}
]
},
"Jstack": {
"ThreadTrackDo": [
{
"TrackList": {
"Track": [
"TID: 52 STATE: WAITING"
]
},
"Thread": "ConsumeMessageThread_0"
}
]
},
"LastTimeStamp": 1570701368114,
"StartTimeStamp": 1570701361528,
"Language": "JAVA",
"ClientId": "30.5.**.**@25560#-1999745829#-1737591554#458773089270275",
"Connection": "**",
"Version": "V4_3_6",
"ConsumeType": "PUSH",
"ThreadCount": 20
}
]
},
"InstanceId": "MQ_INST_111111111111_DOxxxxxx",
"DetailInTopicList": {
"DetailInTopicDo": [
{
"DelayTime": 0,
"TotalDiff": 0,
"LastTimestamp": 1570701259403,
"Topic": "test-mq_topic"
}
]
},
"SubscriptionSame": true,
"DelayTime": 100857,
"LastTimestamp": 1566883844954,
"Online": true,
"RebalanceOK": true
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||
---|---|---|---|---|
2023-12-08 | The response structure of the API has changed | see changesets | ||
|
View the details of a consumer group in the console
You can also view the details of a consumer group in the ApsaraMQ for RocketMQ console. For more information, see View the status of consumers.