apache-kafka - 尝试删除 Kafka 中的消费者组时出现 GroupNotEmptyException
问题描述
我执行了
"kafka-consumer-groups --bootstrap-server localhost:9092 --list"
这会导致显示一组:console-consumer-961
然后我试图删除这个组:
kafka-consumer-groups --bootstrap-server localhost:9092 --delete --group console-consumer-961
但这会导致异常:
Error: Deletion of some consumer groups failed:
* Group 'console-consumer-961' could not be deleted due to: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.GroupNotEmptyException: The group is not empty.
我猜这个组是在我运行 kafka- 时创建的console-consumer.bat
,但现在这个消费者没有运行。如何删除此消费者组?
解决方案
kafka-consumer-groups
您可以使用命令行工具来验证消费者组的状态。
bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group console-consumer-961 --state
This will show you the state of the consumer. If it is not empty, Kafka will not allow to delete that group. If it still shows that your console consumer is running you need to make sure to properly shut it down (usually by CTRL+C)
推荐阅读
- regex - 正则表达式匹配一个或两个,但不是两次
- html - laravel bootstrap-如何使用媒体查询来对齐每行的两个项目?
- flutter - 带有 onTouched 和 onReleased 回调的内置小部件?
- haskell - 级联绑定 (`>>=`) 运算符
- react-native - React Native 取消链接 Ios 库
- react-native - 对 React 导航版本 5 中的深层链接感到困惑
- android - 如何使用 Espresso 存根 Intent.createChooser Intent
- javascript - 如何确保 Firefox 打印预览中的表头只出现一次?
- javascript - 发布库时是否需要 Angular 库 tslib 对等依赖项?
- canvas - Interactive-Canvas 加载 Js 文件这么慢?