Package org.springframework.kafka.event
Class ListenerContainerPartitionNoLongerIdleEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.springframework.context.ApplicationEvent
-
- org.springframework.kafka.event.KafkaEvent
-
- org.springframework.kafka.event.ListenerContainerPartitionNoLongerIdleEvent
-
- All Implemented Interfaces:
java.io.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ListenerContainerPartitionNoLongerIdleEvent(java.lang.Object source, java.lang.Object container, long idleTime, java.lang.String id, org.apache.kafka.common.TopicPartition topicPartition, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
Construct an instance with the provided arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.kafka.clients.consumer.Consumer<?,?>
getConsumer()
Retrieve the consumer.long
getIdleTime()
How long the partition was idle.java.lang.String
getListenerId()
The id of the listener (if@KafkaListener
) or the container bean name.org.apache.kafka.common.TopicPartition
getTopicPartition()
The idle TopicPartition.java.lang.String
toString()
-
Methods inherited from class org.springframework.kafka.event.KafkaEvent
getContainer, getSource
-
-
-
-
Constructor Detail
-
ListenerContainerPartitionNoLongerIdleEvent
public ListenerContainerPartitionNoLongerIdleEvent(java.lang.Object source, java.lang.Object container, long idleTime, java.lang.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 Detail
-
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 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 classjava.util.EventObject
-
-