Querying the Consumer Group List or Details
Function
This API is used to query the consumer group list or details.
URI
GET /v2/{project_id}/instances/{instance_id}/groups/{group}/topics
|
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 |
|---|---|---|---|
|
topic |
No |
String |
Topic to be queried. If this parameter is not specified, the entire topic list is queried. If this parameter is specified, details of the topic are queried. |
|
limit |
No |
Integer |
Maximum number of records returned in the current query. The default value is 10. 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. |
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
topics |
Array of strings |
Topic list. This parameter is displayed only when you query the topic consumption list. |
|
total |
Integer |
Total number of topics. This parameter is displayed only when you query the topic consumption list. |
|
lag |
Long |
Total number of accumulated messages. |
|
max_offset |
Long |
Total number of messages. |
|
consumer_offset |
Long |
Number of consumed messages. |
|
brokers |
Array of Brokers objects |
Associated brokers of topics. This parameter is displayed only when you query the topic consumption list. |
|
Parameter |
Type |
Description |
|---|---|---|
|
broker_name |
String |
Names of the associated brokers. |
|
queues |
Array of Queue objects |
Queue details of the associated brokers. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
Integer |
Queue ID. |
|
lag |
Long |
Total number of accumulated messages in the queue. |
|
broker_offset |
Long |
Total number of messages in the queue. |
|
consumer_offset |
Long |
Number of consumed messages. |
|
last_message_time |
Long |
Time (UNIX, in millisecond) when the latest consumed message was stored. |
Example Requests
GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/groups/{group}/topics?topic=test0001
Example Responses
Status code: 200
Consumer group list or details queried successfully.
-
Successful
{ "topics" : [ "topic-test" ], "total" : 1 } -
Consumer group details are queried successfully.
{ "lag" : 0, "max_offset" : 1, "consumer_offset" : 1, "brokers" : [ { "broker_name" : "broker-0", "queues" : [ { "id" : 0, "lag" : 0, "broker_offset" : 0, "consumer_offset" : 0, "last_message_time" : 0 }, { "id" : 1, "lag" : 0, "broker_offset" : 1, "consumer_offset" : 1, "last_message_time" : 1679398537088 }, { "id" : 0, "lag" : 0, "broker_offset" : 0, "consumer_offset" : 0, "last_message_time" : 0 } ] } ] }
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Consumer group list or details queried successfully. |
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.