public class NoOpConsumerRebalanceListener extends java.lang.Object implements ConsumerRebalanceListener
ConsumerRebalanceListener
Constructor and Description |
---|
NoOpConsumerRebalanceListener() |
Modifier and Type | Method and Description |
---|---|
void |
onPartitionsAssigned(java.util.Collection<TopicPartition> partitions)
A callback method the user can implement to provide handling of customized offsets on completion of a successful
partition re-assignment.
|
void |
onPartitionsRevoked(java.util.Collection<TopicPartition> partitions)
A callback method the user can implement to provide handling of offset commits to a customized store on the start
of a rebalance operation.
|
public void onPartitionsRevoked(java.util.Collection<TopicPartition> partitions)
ConsumerRebalanceListener
For examples on usage of this API, see Usage Examples section of Consumer
NOTE: This method is only called before rebalances. It is not called prior to Consumer.close()
.
onPartitionsRevoked
in interface ConsumerRebalanceListener
partitions
- The list of partitions that were assigned to the consumer on the last rebalancepublic void onPartitionsAssigned(java.util.Collection<TopicPartition> partitions)
ConsumerRebalanceListener
It is guaranteed that all the processes in a consumer group will execute their
ConsumerRebalanceListener.onPartitionsRevoked(Collection)
callback before any getInstance executes its
ConsumerRebalanceListener.onPartitionsAssigned(Collection)
callback.
onPartitionsAssigned
in interface ConsumerRebalanceListener
partitions
- The list of partitions that are now assigned to the consumer (may include partitions previously
assigned to the consumer)