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; 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:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors 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 SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.kafka.clients.consumer.Consumer<?,?>getConsumer()Retrieve the consumer.java.lang.StringgetListenerId()The id of the listener (if@KafkaListener) or the container bean name.longgetTimeSinceLastPoll()How long since the last poll.java.util.Collection<org.apache.kafka.common.TopicPartition>getTopicPartitions()The TopicPartitions the container is listening to.java.lang.StringtoString()- 
Methods inherited from class org.springframework.kafka.event.KafkaEventgetContainer, getSource
 
- 
 
- 
- 
- 
Constructor Detail- 
NonResponsiveConsumerEventpublic 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- 
getTimeSinceLastPollpublic long getTimeSinceLastPoll() How long since the last poll.- Returns:
- the time in milliseconds.
 
 - 
getTopicPartitionspublic java.util.Collection<org.apache.kafka.common.TopicPartition> getTopicPartitions() The TopicPartitions the container is listening to.- Returns:
- the TopicPartition list.
 
 - 
getListenerIdpublic java.lang.String getListenerId() The id of the listener (if@KafkaListener) or the container bean name.- Returns:
- the id.
 
 - 
getConsumerpublic 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.
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.util.EventObject
 
 
- 
 
-