public class ListenerContainerIdleEvent extends KafkaEvent
Constructor and Description |
---|
ListenerContainerIdleEvent(java.lang.Object source,
long idleTime,
java.lang.String id,
java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions,
org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
Deprecated.
|
ListenerContainerIdleEvent(java.lang.Object source,
long idleTime,
java.lang.String id,
java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions,
org.apache.kafka.clients.consumer.Consumer<?,?> consumer,
boolean paused)
Construct an instance with the provided arguments.
|
Modifier and Type | Method and Description |
---|---|
org.apache.kafka.clients.consumer.Consumer<?,?> |
getConsumer()
Retrieve the consumer.
|
long |
getIdleTime()
How long the container has been idle.
|
java.lang.String |
getListenerId()
The id of the listener (if
@KafkaListener ) or the container bean name. |
java.util.Collection<org.apache.kafka.common.TopicPartition> |
getTopicPartitions()
The TopicPartitions the container is listening to.
|
boolean |
isPaused()
Return true if the consumer was paused at the time the idle event was published.
|
java.lang.String |
toString() |
@Deprecated public ListenerContainerIdleEvent(java.lang.Object source, long idleTime, java.lang.String id, java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions, org.apache.kafka.clients.consumer.Consumer<?,?> consumer)
ListenerContainerIdleEvent(Object, long, String, Collection, Consumer, boolean)
source
- the container.idleTime
- the idle time.id
- the container id.topicPartitions
- the topics/partitions currently assigned.consumer
- the consumer.public ListenerContainerIdleEvent(java.lang.Object source, long idleTime, java.lang.String id, java.util.Collection<org.apache.kafka.common.TopicPartition> topicPartitions, org.apache.kafka.clients.consumer.Consumer<?,?> consumer, boolean paused)
source
- the container.idleTime
- the idle time.id
- the container id.topicPartitions
- the topics/partitions currently assigned.consumer
- the consumer.paused
- true if the consumer is paused.public long getIdleTime()
public java.util.Collection<org.apache.kafka.common.TopicPartition> getTopicPartitions()
public java.lang.String getListenerId()
@KafkaListener
) or the container bean name.public org.apache.kafka.clients.consumer.Consumer<?,?> getConsumer()
public boolean isPaused()
public java.lang.String toString()
toString
in class java.util.EventObject