liveBook · Manning

Static group membership

As explained in Kafka Streams in Action, Second Edition

Static membership is a Kafka consumer-group membership mode that assigns each consumer a persistent identity so it can rejoin with its previous partition assignment without an immediate rebalance.

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.
figure

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

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Explains identity-based assignment recovery, timeout configuration, and the rebalance tradeoff without implementation code.
Examples
Uses rolling application upgrades and cloud nodes that temporarily disappear before returning online.
What it assumes
Assumes familiarity with Kafka consumers, consumer groups, partitions, assignments, and rebalancing.
What you can do after
Operate/configure consumers with unique group.instance.id values and a deliberately chosen session.timeout.ms.
How it connects
Connects consumer groups with partition assignment, rebalancing, cooperative rebalancing, and session timeouts.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka Streams in Action, Second Edition. The section links point to the parts of the book it draws on.