我正在使用Spring kafka监听器从kafka主题读取消息。
@KafkaListener( id = "member-group", topics = "member-updated" )
我曾经每次创建一个新的消费者组(通过更改上面的组 id(来消费所有记录。 现在我有大约 50 个消费者组,我想删除它们。我试图从卡夫卡窗口客户端中删除 -
kafka-consumer-groups.bat --zookeeper <zookeeper-url> --delete --group <group-name>
但它失败了,输出如下 -
Note: This will only show information about consumers that use ZooKeeper (not those using the Java consumer API).
Error: Delete for group '<group-name>' failed because group does not exist.
那么有没有办法通过代码或其他工具删除这些消费者组。 以及消费者组的默认保留策略是什么。
使用--bootstrap-server host:port
而不是--zookeeper
。
运行没有任何参数的脚本以获取帮助...
--bootstrap-server <String: server to REQUIRED (for consumer groups based on
connect to> the new consumer): The server to
connect to.
...
--zookeeper <String: urls> REQUIRED (for consumer groups based on
the old consumer): The connection
string for the zookeeper connection
in the form host:port. Multiple URLS
can be given to allow fail-over.