0

I'm trying to delete the consumer from zookeeper who is currently active, but observing following error:

docker run   --net=host   --rm <kafka docker > kafka-consumer-groups --zookeeper localhost:32181  --delete --group consumer1
Delete for group consumer1 failed because its consumers are still active.

Is there a way in Kafka version 0.10.1.1-cp1 where we can delete the active consumers ?

Have tried to stop the active consumers but wasnt able to :

docker run   --net=host   --rm <kafka docker > kafka-consumer-groups --zookeeper localhost:32181  --stop --group consumer1

Exception in thread "main" joptsimple.UnrecognizedOptionException: stop is not a recognized option
    at joptsimple.OptionException.unrecognizedOption(OptionException.java:108)
    at joptsimple.OptionParser.handleLongOptionToken(OptionParser.java:449)
    at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:56)
    at joptsimple.OptionParser.parse(OptionParser.java:381)
    at kafka.admin.ConsumerGroupCommand$ConsumerGroupCommandOptions.<init>(ConsumerGroupCommand.scala:424)
    at kafka.admin.ConsumerGroupCommand$.main(ConsumerGroupCommand.scala:44)
    at kafka.admin.ConsumerGroupCommand.main(ConsumerGroupCommand.scala)
Giorgos Myrianthous
  • 36,235
  • 20
  • 134
  • 156
Pooja
  • 481
  • 1
  • 8
  • 15
  • Possible duplicate of [removing a kafka consumer group in zookeeper](https://stackoverflow.com/questions/29243896/removing-a-kafka-consumer-group-in-zookeeper) – LinPy Aug 06 '19 at 06:43
  • Are you sure all the consumers from this group are stopped? – Val Bonn Aug 06 '19 at 06:48
  • @ValBonn Consumers are still active and i want to delete the consumer which are active. I tried stopping the consumers but wasn't able to. ```docker run --net=host --rm kafka-consumer-groups --zookeeper localhost:32181 --stop --group consumer1``` – Pooja Aug 06 '19 at 07:22
  • 1
    Your command line is about the consumer *groups*. You cannot stop consumers this way. The consumers are apps which connect to Kafka and consume topics. These consumers are part of "consumer groups". If you want to delete a group via the `kafka-consumer-groups --delete`, you have to stop the consumers which are part of this group before deleting the group. – Val Bonn Aug 06 '19 at 07:49
  • Can you please suggest how can I stop the consumers which are part of the group with command line ? – Pooja Aug 06 '19 at 07:52
  • You can only stop the consumers with command line if they run on the same machine. You can already try to identify what are the consumers: `kafka-consumer-groups --zookeeper localhost:32181 --describe --group consumer1 --members` – Val Bonn Aug 06 '19 at 08:08
  • Error is seen when tried to check the consumers members ```Exception in thread "main" joptsimple.UnrecognizedOptionException: members is not a recognized option ``` – Pooja Aug 06 '19 at 10:07
  • You actually have to stop the consumer process, which these commands don't do... You need to find the actual consumer code, its process, then kill it there. – OneCricketeer Aug 06 '19 at 20:51
  • Killing the consumer process will be on client side, I was looking to stop the consumers from server side. – Pooja Aug 07 '19 at 04:02

0 Answers0