Package org.springframework.kafka.event
Class NonResponsiveConsumerEvent
- java.lang.Object
-
- java.util.EventObject
-
- org.springframework.context.ApplicationEvent
-
- org.springframework.kafka.event.KafkaEvent
-
- org.springframework.kafka.event.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
-
-
Constructor Summary
Constructors Constructor Description 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.kafka.event.KafkaEvent
getContainer, getSource
-
-
-
-
Constructor Detail
-
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 classjava.util.EventObject
-
-