更新时间:2023-08-16 GMT+08:00
查询消费列表或详情
功能介绍
查询消费列表或详情。
URI
GET /v2/{project_id}/instances/{instance_id}/groups/{group}/topics
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
String |
项目ID,获取方式请参见获取项目ID。 |
|
instance_id |
是 |
String |
实例ID。 |
|
group |
是 |
String |
消费组名称。 |
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
topic |
否 |
String |
待查询的topic,不指定时查询topic列表,指定时查询详情。 |
|
limit |
否 |
Integer |
当次查询返回的最大个数,默认值为10,取值范围为1~50。 最小值:1 最大值:50 缺省值:10 |
|
offset |
否 |
Integer |
偏移量,表示从此偏移量开始查询, offset大于等于0。 最小值:0 缺省值:0 |
请求参数
无
响应参数
状态码: 200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
topics |
Array of strings |
Topic列表(当查询topic消费“列表”时才显示此参数)。 |
|
total |
Integer |
Topic总数(当查询topic消费“列表”时才显示此参数)。 |
|
brokers |
Array of Brokers objects |
Topic关联代理(当查询topic消费“详情”才显示此参数)。 |
请求示例
-
查询消费组的topic列表。
GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/groups/{group}/topics -
查询消费组指定topic消费详情。
GET https://{endpoint}/v2/{project_id}/instances/{instance_id}/groups/{group}/topics?topic=test0001
响应示例
状态码: 200
查询消费列表或详情成功。
# 响应示例 查询消费组的topic列表时显示topics和total参数,查询详情时显示brockers参数
{
"topics": [
"test0001"
],
"total": 1,
"brokers": [
{
"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": 2,
"lag": 0,
"broker_offset": 0,
"consumer_offset": 0,
"last_message_time": 0
}
],
"broker_name": "broker-0"
}
]
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
查询消费列表或详情成功。 |
错误码
请参见错误码。
父主题: 消费组管理