Interface ConsumerAwareRebalanceListener
- All Superinterfaces:
org.apache.kafka.clients.consumer.ConsumerRebalanceListener
public interface ConsumerAwareRebalanceListener
extends org.apache.kafka.clients.consumer.ConsumerRebalanceListener
A rebalance listener that provides access to the consumer object. Starting with version
2.1.5, as a convenience, default no-op implementations are provided for all methods,
allowing the user to implement just those (s)he is interested in.
- Since:
- 2.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
onPartitionsAssigned
(Collection<org.apache.kafka.common.TopicPartition> partitions) default void
onPartitionsAssigned
(org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, Collection<org.apache.kafka.common.TopicPartition> partitions) The same asonPartitionsAssigned(Collection)
with the additional consumer parameter.default void
onPartitionsLost
(Collection<org.apache.kafka.common.TopicPartition> partitions) default void
onPartitionsLost
(org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, Collection<org.apache.kafka.common.TopicPartition> partitions) The same asonPartitionsLost(Collection)
with an additional consumer parameter.default void
onPartitionsRevoked
(Collection<org.apache.kafka.common.TopicPartition> partitions) default void
onPartitionsRevokedAfterCommit
(org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, Collection<org.apache.kafka.common.TopicPartition> partitions) The same asonPartitionsRevoked(Collection)
with the additional consumer parameter.default void
onPartitionsRevokedBeforeCommit
(org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, Collection<org.apache.kafka.common.TopicPartition> partitions) The same asonPartitionsRevoked(Collection)
with the additional consumer parameter.
-
Method Details
-
onPartitionsRevokedBeforeCommit
default void onPartitionsRevokedBeforeCommit(org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, Collection<org.apache.kafka.common.TopicPartition> partitions) The same asonPartitionsRevoked(Collection)
with the additional consumer parameter. It is invoked by the container before any pending offsets are committed.- Parameters:
consumer
- the consumer.partitions
- the partitions.
-
onPartitionsRevokedAfterCommit
default void onPartitionsRevokedAfterCommit(org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, Collection<org.apache.kafka.common.TopicPartition> partitions) The same asonPartitionsRevoked(Collection)
with the additional consumer parameter. It is invoked by the container after any pending offsets are committed.- Parameters:
consumer
- the consumer.partitions
- the partitions.
-
onPartitionsLost
default void onPartitionsLost(org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, Collection<org.apache.kafka.common.TopicPartition> partitions) The same asonPartitionsLost(Collection)
with an additional consumer parameter.- Parameters:
consumer
- the consumer.partitions
- the partitions.- Since:
- 2.4
-
onPartitionsAssigned
default void onPartitionsAssigned(org.apache.kafka.clients.consumer.Consumer<?, ?> consumer, Collection<org.apache.kafka.common.TopicPartition> partitions) The same asonPartitionsAssigned(Collection)
with the additional consumer parameter.- Parameters:
consumer
- the consumer.partitions
- the partitions.
-
onPartitionsRevoked
- Specified by:
onPartitionsRevoked
in interfaceorg.apache.kafka.clients.consumer.ConsumerRebalanceListener
-
onPartitionsAssigned
- Specified by:
onPartitionsAssigned
in interfaceorg.apache.kafka.clients.consumer.ConsumerRebalanceListener
-
onPartitionsLost
- Specified by:
onPartitionsLost
in interfaceorg.apache.kafka.clients.consumer.ConsumerRebalanceListener
-