Skip to main content
PreparationZone Logo
PrepZone

Rebalance: Cooperative Sticky vs Range

What happens when consumers join or leave — cooperative sticky rebalancing minimizes duplicate processing.

Pass checkpoint below

Why this matters

  • VaultCommerce rolling deploys triggered 30-second rebalance storms with eager protocol — fixed with cooperative sticky.
  • During rebalance, partitions may be revoked before reassignment — handle revocation gracefully.
  • Rebalance listener hooks let VaultCommerce flush in-flight work before partition loss.
  • Frequent rebalances often indicate slow poll loops or unstable membership.
New consumer joins
Partition reassignment
Resume consumption
Group coordinator pauses consumption, reassigns partitions, then resumes — cooperative sticky minimizes movement.

Eager vs cooperative

Eager (range, round-robin): all partitions revoked, then reassigned — full stop. Cooperative sticky: only moved partitions revoked incrementally. VaultCommerce sets partition.assignment.strategy=CooperativeStickyAssignor on all Java consumers.

Key points

  • Rebalance — partition ownership transfer among group members
  • CooperativeStickyAssignor — incremental rebalance (Kafka 2.4+)
  • onPartitionsRevoked — callback to commit offsets before losing partitions
  • group.instance.id — static member identity across restarts
  • max.poll.interval.ms — max time between poll() calls before considered dead

The rest of this guide is part of Pro

Free covers every fresher guide in full. Pro unlocks Senior, Staff and Architect guides across every track.

Still to come · 2 sections

  • Triggers and mitigation
  • VaultCommerce rollout checklist

Test yourself

Answer these before moving on — recall is what makes it stick.