Skip to content

Commit c20b0fb

Browse files
committed
Non-Responsive Consumer Doc Polishing
This was a problem with early versions of the clients; the code remains in case some other reason causes the poll to hang. Clarify the docs.
1 parent 1c045a2 commit c20b0fb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

spring-kafka-docs/src/main/asciidoc/kafka.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2875,8 +2875,8 @@ public ConcurrentKafkaListenerContainerFactory kafkaListenerContainerFactory() {
28752875

28762876
In each of these cases, an event is published once per minute while the container is idle.
28772877

2878-
In addition, if the broker is unreachable, the consumer `poll()` method does not exit, so no messages are received and idle events cannot be generated.
2879-
To solve this issue, the container publishes a `NonResponsiveConsumerEvent` if a poll does not return within `3x` the `pollTimeout` property.
2878+
If, for some reason, the consumer `poll()` method does not exit, no messages are received and idle events cannot be generated (this was a problem with early versions of the `kafka-clients` when the broker wasn't reachable).
2879+
In this case, the container publishes a `NonResponsiveConsumerEvent` if a poll does not return within `3x` the `pollTimeout` property.
28802880
By default, this check is performed once every 30 seconds in each container.
28812881
You can modify this behavior by setting the `monitorInterval` (default 30 seconds) and `noPollThreshold` (default 3.0) properties in the `ContainerProperties` when configuring the listener container.
28822882
The `noPollThreshold` should be greater than `1.0` to avoid getting spurious events due to a race condition.

spring-kafka/src/main/java/org/springframework/kafka/event/NonResponsiveConsumerEvent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2020 the original author or authors.
2+
* Copyright 2017-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,8 +25,8 @@
2525
import org.apache.kafka.common.TopicPartition;
2626

2727
/**
28-
* An event that is emitted when a consumer is not responding to
29-
* the poll; a possible indication that the broker is down.
28+
* An event that is emitted when a consumer is not responding to the poll; with early
29+
* versions of the kafka-clients, this was a possible indication that the broker is down.
3030
*
3131
* @author Gary Russell
3232
* @since 1.3.1

0 commit comments

Comments
 (0)