I am listening to the NonResponsiveConsumerEvent event in my spring-kafka (version 2.0.1) consumer like this -
@EventListener
public void eventHandler(NonResponsiveConsumerEvent event) {
LOG.info("Consumer has become non-responsive, no poll for " + event.getTimeSinceLastPoll() + " milliseconds");
}
I am not able to explain some behavior based on the documentation of this event -
This event is called every 30s. Why 30s? The document says it should get called when the 'poll does not return within 3x the pollInterval property'. max.poll.interval.ms = 300000 for the consumer.
If this event indicates a non responsive consumer, why does my consumer that is emitting this event every 30s continue to read messages?
Update - 1 (12/12)
I looked at the spring-kafka code a little closer and found out that the default pollTimeout=1000L. Based on this I still have some questions about what I am observing.
- I get this message as soon as the consumer starts - Consumer has become non-responsive, no poll for 1513093440936 milliseconds. Why?
- Why is this event emitted every 30 secs? I published a message to the topic, it was consumed by the consumer successfully and yet I get this event every 30s. Why?
10:48:51.081 [ThreadPoolTaskScheduler-1] INFO c.t.m.e.r.e.p.k.RequestMessageHandler - Consumer has become non-responsive, no poll for 1513097331080 milliseconds // at the start of the consumer 10:49:21.083 [ThreadPoolTaskScheduler-1] INFO c.t.m.e.r.e.p.k.RequestMessageHandler - Consumer has become non-responsive, no poll for 30002 milliseconds 10:49:51.081 [ThreadPoolTaskScheduler-1] INFO c.t.m.e.r.e.p.k.RequestMessageHandler - Consumer has become non-responsive, no poll for 60000 milliseconds // posted message here, still got the following events 10:50:21.080 [ThreadPoolTaskScheduler-1] INFO c.t.m.e.r.e.p.k.RequestMessageHandler - Consumer has become non-responsive, no poll for 89999 milliseconds 10:50:51.078 [ThreadPoolTaskScheduler-1] INFO c.t.m.e.r.e.p.k.RequestMessageHandler - Consumer has become non-responsive, no poll for 119997 milliseconds 10:51:21.077 [ThreadPoolTaskScheduler-1] INFO c.t.m.e.r.e.p.k.RequestMessageHandler - Consumer has become non-responsive, no poll for 149996 milliseconds