Class ListenerContainerPartitionNoLongerIdleEvent

All Implemented Interfaces:
Serializable

public class ListenerContainerPartitionNoLongerIdleEvent extends KafkaEvent
An event that is emitted when a partition is no longer idle if configured to publish idle events.
Since:
2.6.2
Author:
Gary Russell
See Also:
  • Constructor Details

    • ListenerContainerPartitionNoLongerIdleEvent

      public ListenerContainerPartitionNoLongerIdleEvent(Object source, Object container, long idleTime, String id, org.apache.kafka.common.TopicPartition topicPartition, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
      Construct an instance with the provided arguments.
      Parameters:
      source - the container instance that generated the event.
      container - the container or the parent container if the container is a child.
      idleTime - how long the container was idle.
      id - the container id.
      topicPartition - the idle topic/partition.
      consumer - the consumer.
  • Method Details

    • getTopicPartition

      public org.apache.kafka.common.TopicPartition getTopicPartition()
      The idle TopicPartition.
      Returns:
      the TopicPartition.
    • getIdleTime

      public long getIdleTime()
      How long the partition was idle.
      Returns:
      the time in milliseconds.
    • 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