Kafka consumer groups deletion

Viewed 618

I have a large number of consumer groups created in Kafka. When I check the status most of them are with Empty status and without active consumers.

I have two questions

  1. Automatic deletion of consumer group is supported in Kafka and can we configure a time period to delete the empty consumer groups?
  2. Is there any specific Kafka version which supports automatic deletion of empty Consumer groups?
1 Answers

To delete empty consumer groups, you have 2 options:

  • Do nothing and wait offsets.retention.minutes. This settings defaults to 7 days. Groups without any members for this duration are automatically deleted. This mechanism exists since Kafka 0.8.2!

  • Use the delete consumer group API. This can be used via the Admin API's deleteConsumerGroups method or the kafka-consumer-groups.sh script. This API exists since Kafka 1.1.

Related