Static membership gives each Kafka consumer a unique group.instance.id. The controller remembers that identity and can restore the consumer’s previous partition assignment when it rejoins, avoiding an immediate rebalance. section 4.3.4
Use static membership when consumers disappear temporarily and return soon:
- During rolling upgrades, stopping and restarting each consumer does not automatically trigger a rebalance for every instance. section 4.3.4
- When a consumer leaves, it does not send a leave group request; on rejoining, its unique membership ID lets the controller recover the original assignment. section 4.3.4
- Set session.timeout.ms high enough to cover expected transient unavailability, but low enough to detect genuine failures and trigger a rebalance. section 4.3.4
Figure 4.16 Static members don’t issue leave group requests when dropping out of a group, and a static ID allows the controller to remember them.
The membership flow shows how static IDs let the controller remember consumers that temporarily drop out without issuing leave group requests. section 4.3.4
