Kafka: Cooperative rebalancing avoids the stop-the-world pause

Only the partitions that actually move are revoked, so most consumers keep working.

Code
props.put(ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG,
          CooperativeStickyAssignor.class.getName());
Output
Eager:       every consumer stops, everything is reassigned
Cooperative: one partition moves, the other five consumers never pause
Advertisement

Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.

Published 2026-08-11