Class NonResponsiveConsumerEvent

All Implemented Interfaces:
Serializable

public class NonResponsiveConsumerEvent extends KafkaEvent
An event that is emitted when a consumer is not responding to the poll; with early versions of the kafka-clients, this was a possible indication that the broker is down.
Since:
1.3.1
Author:
Gary Russell
See Also:
  • Constructor Details

    • NonResponsiveConsumerEvent

      public NonResponsiveConsumerEvent(Object source, Object container, long timeSinceLastPoll, String id, 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 Details

    • getTimeSinceLastPoll

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

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

      public 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 String toString()
      Overrides:
      toString in class EventObject