|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConsumerRebalanceCallback
A callback interface that the user can implement to manage customized offsets on the start and end of
every rebalance operation. This callback will execute in the user thread as part of the
poll(long)
API on every rebalance attempt.
Default implementation of the callback will seek(offsets)
to the last committed offsets in the
onPartitionsAssigned()
callback. And will commit offsets synchronously
for the specified list of partitions to Kafka in the onPartitionsRevoked()
callback.
Method Summary | |
---|---|
void |
onPartitionsAssigned(Consumer consumer,
java.util.Collection<TopicPartition> partitions)
A callback method the user can implement to provide handling of customized offsets on completion of a successful rebalance operation. |
void |
onPartitionsRevoked(Consumer consumer,
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. |
Method Detail |
---|
void onPartitionsAssigned(Consumer consumer, java.util.Collection<TopicPartition> partitions)
For examples on usage of this API, see Usage Examples section of KafkaConsumer
partitions
- The list of partitions that are assigned to the consumer after rebalancevoid onPartitionsRevoked(Consumer consumer, java.util.Collection<TopicPartition> partitions)
For examples on usage of this API, see Usage Examples section of KafkaConsumer
partitions
- The list of partitions that were assigned to the consumer on the last rebalance
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |