How to introduce delay in rebalancing in case of kafka consumer group?
Olivia Zamora
I want to give some time to my consumer to restart so that unnecessary rebalance doesnt happen. How can I do that? In case of shutdown, I want replication to come in picture and after some time if consumer is not back up, rebalance should occur else not.
41 Answer
There's broker level config called group.initial.rebalance.delay.ms you can tweak.
3The amount of time the group coordinator will wait for more consumers to join a new group before performing the first rebalance. A longer delay means potentially fewer rebalances, but increases the time until processing begins.