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
    Author:
    Gary Russell
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.springframework.core.log.LogAccessor LOGGER
      LogAccessor for use in default methods.
    • Field Detail

      • LOGGER

        static final org.springframework.core.log.LogAccessor LOGGER
        LogAccessor for use in default methods.
    • Method Detail

      • onPartitionsRevokedBeforeCommit

        default void onPartitionsRevokedBeforeCommit​(org.apache.kafka.clients.consumer.Consumer<?,​?> consumer,
                                                     java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
        The same as onPartitionsRevoked(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,
                                                    java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
        The same as onPartitionsRevoked(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,
                                      java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
        The same as onPartitionsLost(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,
                                          java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
        The same as onPartitionsAssigned(Collection) with the additional consumer parameter.
        Parameters:
        consumer - the consumer.
        partitions - the partitions.
      • onPartitionsRevoked

        default void onPartitionsRevoked​(java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
        Specified by:
        onPartitionsRevoked in interface org.apache.kafka.clients.consumer.ConsumerRebalanceListener
      • onPartitionsAssigned

        default void onPartitionsAssigned​(java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
        Specified by:
        onPartitionsAssigned in interface org.apache.kafka.clients.consumer.ConsumerRebalanceListener
      • onPartitionsLost

        default void onPartitionsLost​(java.util.Collection<org.apache.kafka.common.TopicPartition> partitions)
        Specified by:
        onPartitionsLost in interface org.apache.kafka.clients.consumer.ConsumerRebalanceListener