liveBook · Manning

Cooperative rebalance

As explained in Kafka Streams in Action, Second Edition

Cooperative rebalancing is a Kafka rebalance protocol that incrementally changes partition assignments while allowing unaffected assignments to continue.

Cooperative rebalancing is a Kafka consumer-group protocol that incrementally changes topic-partition ownership after membership changes, allowing unaffected processing to continue. section 4.3.2

Use the protocol to reduce disruption during consumer-group changes:

  • When a consumer joins or leaves, reassign only the partitions marked for movement instead of stopping every partition. section 4.3.2
  • Select CooperativeStickyAssignor through partition.assignment.strategy; it preserves existing assignments where possible while using the cooperative protocol. section 4.3.3
  • Prefer CooperativeStickyAssignor for newer direct KafkaConsumer applications, while Kafka Connect and Kafka Streams already use cooperative protocols with recommended defaults. section 4.3.3
  • Expect substantially less downtime than eager rebalancing, where all members relinquish assignments and processing stops during reassignment. section 4.3.2 section 4.7

How Kafka Streams in Action, Second Edition covers it

How deep it goes
Explains eager and cooperative assignment behavior, assignor selection, and framework defaults without detailing the complete protocol exchange.
Examples
Uses consumer joins and departures, eager-versus-cooperative diagrams, and CooperativeStickyAssignor configuration as concrete examples.
What it assumes
Assumes consumer-group, topic-partition, and KafkaConsumer concepts while contrasting eager and cooperative behavior.
What you can do after
Configure it via CooperativeStickyAssignor and choose a lower-disruption rebalance strategy for Kafka consumer groups.
How it connects
Connects consumer groups, topic partitions, eager rebalancing, partition assignment strategies, and CooperativeStickyAssignor.

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.