Class NonResponsiveConsumerEvent

  • All Implemented Interfaces:
    java.io.Serializable

    public class NonResponsiveConsumerEvent
    extends KafkaEvent
    An event that is emitted when a consumer is not responding to the poll; a possible indication that the broker is down.
    Since:
    1.3.1
    Author:
    Gary Russell
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.EventObject

        source
    • Constructor Summary

      Constructors 
      Constructor Description
      NonResponsiveConsumerEvent​(java.lang.Object source, long timeSinceLastPoll, java.lang.String id, java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions, org.apache.kafka.clients.consumer.Consumer<?,​?> consumer)
      Deprecated.
      NonResponsiveConsumerEvent​(java.lang.Object source, java.lang.Object container, long timeSinceLastPoll, java.lang.String id, java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions, org.apache.kafka.clients.consumer.Consumer<?,​?> consumer)
      Construct an instance with the provided properties.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      org.apache.kafka.clients.consumer.Consumer<?,​?> getConsumer()
      Retrieve the consumer.
      java.lang.String getListenerId()
      The id of the listener (if @KafkaListener) or the container bean name.
      long getTimeSinceLastPoll()
      How long since the last poll.
      java.util.Collection<org.apache.kafka.common.TopicPartition> getTopicPartitions()
      The TopicPartitions the container is listening to.
      java.lang.String toString()  
      • Methods inherited from class org.springframework.context.ApplicationEvent

        getTimestamp
      • Methods inherited from class java.util.EventObject

        getSource
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NonResponsiveConsumerEvent

        @Deprecated
        public NonResponsiveConsumerEvent​(java.lang.Object source,
                                          long timeSinceLastPoll,
                                          java.lang.String id,
                                          java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions,
                                          org.apache.kafka.clients.consumer.Consumer<?,​?> consumer)
        Deprecated.
      • NonResponsiveConsumerEvent

        public NonResponsiveConsumerEvent​(java.lang.Object source,
                                          java.lang.Object container,
                                          long timeSinceLastPoll,
                                          java.lang.String id,
                                          java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions,
                                          org.apache.kafka.clients.consumer.Consumer<?,​?> consumer)
        Construct an instance with the provided properties.
        Parameters:
        source - the container instance that generated the event.
        container - the container or the parent container if the container is a child.
        timeSinceLastPoll - the time since the last poll.
        id - the container id.
        topicPartitions - the topic partitions.
        consumer - the consumer.
        Since:
        2.2.1
    • Method Detail

      • getTimeSinceLastPoll

        public long getTimeSinceLastPoll()
        How long since the last poll.
        Returns:
        the time in milliseconds.
      • getTopicPartitions

        public java.util.Collection<org.apache.kafka.common.TopicPartition> getTopicPartitions()
        The TopicPartitions the container is listening to.
        Returns:
        the TopicPartition list.
      • getListenerId

        public java.lang.String getListenerId()
        The id of the listener (if @KafkaListener) or the container bean name.
        Returns:
        the id.
      • getConsumer

        public org.apache.kafka.clients.consumer.Consumer<?,​?> getConsumer()
        Retrieve the consumer. Only populated if the listener is consumer-aware. Allows the listener to resume a paused consumer.
        Returns:
        the consumer.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.EventObject