删除从JavaSpringKafka侦听器创建的使用者组

vwkv1x7d  于 2021-06-08  发布在  Kafka
关注(0)|答案(1)|浏览(367)

我正在使用SpringKafka侦听器来读取来自kafka主题的消息。

@KafkaListener( id = "member-group", topics = "member-updated" )

我每次都会创建一个新的消费组(通过更改上面的组id)来消费所有记录。现在我有大约50个消费者群体,我想删除他们。我试图从kafka windows客户端中删除-

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.

那么有没有办法通过代码或者其他工具来删除这些消费群体呢。什么是消费者组的默认保留策略。

20jt8wwn

20jt8wwn1#

使用 --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.

相关问题