Description
In streams we need to reduce the number of rebalances as they cause expensive shuffling of state during onPartitionsAssigned and onPartitionsRevoked. To achieve this we can choose to not send leave the group when a streams consumer is closed. This means that during bounces (with appropriate session timeout settings) we will see at most one rebalance per instance bounce.
As this is an optimization that is only relevant to streams at the moment, initially we will do this by adding an internal config to the consumer leave.group.on.close, this will default to true. When it is set to false AbstractCoordinator won't send the LeaveGroupRequest