Querying the Consumer List
Function
This API is used to query the consumer list of a consumer group.
URI
GET /v2/rocketmq/{project_id}/instances/{instance_id}/groups/{group}/clients
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Project ID. For details, see Obtaining a Project ID. |
|
instance_id |
Yes |
String |
Instance ID. |
|
group |
Yes |
String |
Consumer group name. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
limit |
No |
Integer |
Number of records to query. The value ranges from 1 to 50. |
|
offset |
No |
Integer |
Offset, which is the position where the query starts. The value must be greater than or equal to 0. |
|
is_detail |
No |
Boolean |
Indicates whether to query the consumer details. The value true indicates that the detailed consumer list is queried. Otherwise, a simple consumer list is queried. |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
group_name |
String |
Consumer group name. |
|
online |
Boolean |
Whether the consumer group is online. |
|
subscription_consistency |
Boolean |
Whether subscriptions are consistent. |
|
total |
Integer |
Total number of consumers. |
|
next_offset |
Integer |
Offset of the next page. |
|
previous_offset |
Integer |
Offset of the previous page. |
|
clients |
Array of ClientData objects |
List of consumer subscription details. |
|
Parameter |
Type |
Description |
|---|---|---|
|
language |
String |
Client language. |
|
version |
String |
Client version. |
|
client_id |
String |
Client ID. |
|
client_addr |
String |
Client address. |
|
subscriptions |
Array of Subscription objects |
Subscription list. |
Example Requests
Querying a list of 10 consumers of a specified consumer group from offset=0
GET https://{endpoint}/v2/rocketmq/{project_id}/instances/{instance_id}/groups/{group}/clients?offset=0&limit=10&is_detail=true
Example Responses
Status code: 200
Consumer subscription details queried.
{
"group_name" : "test",
"online" : true,
"subscription_consistency" : true,
"total" : 1,
"next_offset" : -1,
"previous_offset" : -1,
"clients" : [ {
"client_id" : "192.168.0.1@consumer1",
"language" : "JAVA",
"version" : "V4_8_0",
"client_addr" : "192.168.0.1:65233",
"subscriptions" : [ {
"topic" : "topicA",
"type" : "TAG",
"expression" : "tagA"
} ]
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Consumer subscription details queried. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.