Users can opt-in cooperative rebalancing by specifying CooperativeStickyAssignor in partition.assignment.strategy config or implementing ConsumerPartitionAssignor which returns RebalanceProtocol.COOPERATIVE from supportedProtocols
If cooperative rebalancing is enabled, Kafka consumer will invoke ConsumerRebalanceListener as like below:
onPartitionsRevoked : called only when there's at least one partition that revoked from current assignment
onPartitionsAssigned: called with newly assigned partitions
onPartitionsAssigned's behavior change makes Decaton to not working, because AssignmentManager assumes partitions which previously assigned and kept assigned after rebalance as revoked unintentionally.
cooperative rebalancing protocol
, which mitigates the stop-the-world effect upon rebalancingCooperativeStickyAssignor
inpartition.assignment.strategy
config or implementingConsumerPartitionAssignor
which returnsRebalanceProtocol.COOPERATIVE
fromsupportedProtocols
ConsumerRebalanceListener
as like below:onPartitionsRevoked
: called only when there's at least one partition that revoked from current assignmentonPartitionsAssigned
: called with newly assigned partitionsonPartitionsAssigned
's behavior change makes Decaton to not working, becauseAssignmentManager
assumes partitions which previously assigned and kept assigned after rebalance asrevoked
unintentionally.