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
