Apache Kafka: Programmatic monitoring of consumer groups

If your Kafka clients and brokers are modern enough you can accomplish this by monitoring the __consumer-offsets topic, defining some level of lag threshold which causes you to scale your consumer groups. This would be out of scope for the AdminClient to handle, as it’s related to how many consumers you’re launching on the application layer, and really doesn’t have anything to do with broker operations.

I would also ensure your Kafka topics have enough partitions to be able to elastically scale your consumer groups.

Read more here: Source link