0
votes

I'm using Spring kafka listener to read messages from kafka topic.

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

I used to create a new consumer group each time(by changing above group id) to consume all records. Now I've around 50 consumer group and I want to delete them. I tried to delete from kafka windows client -

kafka-consumer-groups.bat --zookeeper <zookeeper-url> --delete --group <group-name>

but it failed with following output -

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.

So is there any way to delete these consumer group either by code or by some other tool. And what is default retention policy for consumer group.

1
what version of kafka?Natalia
@Natalia apache kafka client 1.1.0Shivanshu Bagga

1 Answers

0
votes

Use --bootstrap-server host:port instead of --zookeeper.

Run the script without any parameters to get help...

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