DESCRIBE CONSUMER GROUP
语法用于展示Lindorm消息引擎中已创建的消费者组信息,方便您对消费者组进行管理。
引擎与版本
DESCRIBE CONSUMER GROUP
语法仅适用于消息引擎。消息引擎3.8.0及以上版本支持
DESCRIBE CONSUMER GROUP
语法。
要求Lindorm SQL为2.7.0以上版本。如何查看Lindorm SQL的版本,请参见SQL版本说明。
语法
describe_consumers_statement ::= DESCRIBE CONSUMER GROUP group_identifier
使用说明
消费者组名(group_identifier)
group_identifier必须是已存在的消费者组名。
返回结果集说明
语句执行结果会通过表的形式进行呈现,表的字段如下:
字段 | 说明 |
CONSUMER_GROUP | 消费者组的名称。唯一标识,将消费者作为一组进行管理。 |
TOPIC | 消费者组正在订阅并正在消费消息的主题或流表名称。 |
CURRENT_OFFSET | 当前偏移量。消费者组在特定主题的某个分区上最后一条成功消费的消息的偏移量。 |
LOG_END_OFFSET | 日志末端偏移量。在特定主题分区中消息日志末尾的偏移量,也是该分区中新消息将要被写入的地方。 |
LAG | 消费滞后量,即当前偏移量( |
CONSUMER_ID | 消费者的内部标识符。 |
HOST | 运行消费者实例的主机名或IP地址。 |
CLIENT_ID | 由客户端提供的一个可选标识符,用于标识发送请求的消费者。在日志和监控指标中通常会显示。 |
STATE | 消费者组的状态,表示消费者群组的整体健康和行为状态。 包括以下状态:
|
示例
展示一个名为console-consumer-52014
的消费者组的当前状态。
DESCRIBE CONSUMER GROUP console-consumer-52014;
返回结果如下:
+------------------------+-------+----------------+----------------+------+------------------------------------------------------------------------+---------------+-----------------------------------+--------+
| CONSUMER_GROUP | TOPIC | CURRENT_OFFSET | LOG_END_OFFSET | LAG | CONSUMER_ID | HOST | CLIENT_ID | STATE |
+------------------------+-------+----------------+----------------+------+------------------------------------------------------------------------+---------------+-----------------------------------+--------+
| console-consumer-52014 | test | -1 | 1 | -1 | consumer-console-consumer-52014-1-9e5xxxxx-xxxx-xxxx-xxxx-8182bbdaxxxx | /1xx.xx.xx.xx | consumer-console-consumer-52014-1 | Stable |
| console-consumer-52014 | test | -1 | 2 | -1 | consumer-console-consumer-52014-1-9e5xxxxx-xxxx-xxxx-xxxx-8182bbdaxxxx | /1xx.xx.xx.xx | consumer-console-consumer-52014-1 | Stable |
| console-consumer-52014 | test | -1 | 1 | -1 | consumer-console-consumer-52014-1-9e5xxxxx-xxxx-xxxx-xxxx-8182bbdaxxxx | /1xx.xx.xx.xx | consumer-console-consumer-52014-1 | Stable |
| console-consumer-52014 | test | -1 | 0 | -1 | consumer-console-consumer-52014-1-9e5xxxxx-xxxx-xxxx-xxxx-8182bbdaxxxx | /1xx.xx.xx.xx | consumer-console-consumer-52014-1 | Stable |
| console-consumer-52014 | test | -1 | 0 | -1 | consumer-console-consumer-52014-1-9e5xxxxx-xxxx-xxxx-xxxx-8182bbdaxxxx | /1xx.xx.xx.xx | consumer-console-consumer-52014-1 | Stable |
| console-consumer-52014 | test | -1 | 0 | -1 | consumer-console-consumer-52014-1-9e5xxxxx-xxxx-xxxx-xxxx-8182bbdaxxxx | /1xx.xx.xx.xx | consumer-console-consumer-52014-1 | Stable |
| console-consumer-52014 | test | -1 | 1 | -1 | consumer-console-consumer-52014-1-9e5xxxxx-xxxx-xxxx-xxxx-8182bbdaxxxx | /1xx.xx.xx.xx | consumer-console-consumer-52014-1 | Stable |
| console-consumer-52014 | test | -1 | 0 | -1 | consumer-console-consumer-52014-1-9e5xxxxx-xxxx-xxxx-xxxx-8182bbdaxxxx | /1xx.xx.xx.xx | consumer-console-consumer-52014-1 | Stable |
| console-consumer-52014 | test | -1 | 1 | -1 | consumer-console-consumer-52014-1-9e5xxxxx-xxxx-xxxx-xxxx-8182bbdaxxxx | /1xx.xx.xx.xx | consumer-console-consumer-52014-1 | Stable |
| console-consumer-52014 | test | -1 | 0 | -1 | consumer-console-consumer-52014-1-9e5xxxxx-xxxx-xxxx-xxxx-8182bbdaxxxx | /1xx.xx.xx.xx | consumer-console-consumer-52014-1 | Stable |
+------------------------+-------+----------------+----------------+------+------------------------------------------------------------------------+---------------+-----------------------------------+--------+