-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Spring Kafka - Consumers Detecting Broker Unavailable #637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
After a little more investigation, it looks like the issue is that the "last" variable is meant to capture the last read/commit. What is more apt is a new lastSuccessfulPoll variable that should be updated to System.currentTimeMillis() after each call to this.consumer.poll() in KafkaMessageListenerContainer. |
Yes; this is a bug; thanks; we can't update |
Fixes spring-projects#637 Wrong timestamp used for event publication causing invalid events.
Fixes #637 Wrong timestamp used for event publication causing invalid events.
Fixes #637 Wrong timestamp used for event publication causing invalid events. # Conflicts: # spring-kafka/src/main/java/org/springframework/kafka/listener/KafkaMessageListenerContainer.java
Fixes #637 Wrong timestamp used for event publication causing invalid events. # Conflicts: # spring-kafka/src/main/java/org/springframework/kafka/listener/KafkaMessageListenerContainer.java * Fixed `KafkaMessageListenerContainerTests` for Java 7 and appropriate Mockito version
Fixes spring-projects/spring-kafka#637 Wrong timestamp used for event publication causing invalid events.
@garyrussell |
I no longer work on this project. That event is obsolete (this issue is nearly 6 years old); the event was used with a much older Unfortunately, the consumer API provides no mechanism to check broker liveness. You could use something like |
I understand from https://stackoverflow.com/questions/47524315/handle-failure-in-case-the-kafka-broker-is-down that since 1.3.2, there is a "NonResponsiveConsumerEvent" that triggers when the broker is unavailable.
When trying this, I note that the event is triggered regardless of whether the consumer polling is responsive or not.
Digging deeper into the code, I note that the "last" variable in KafkaMessageListenerContainer.java isn't being updated in the processCommits() method if ackMode = manual, batch, record or count. Because the "last" variable isn't being updated, it looks like the checkConsumer() method in KafkaMessageListenerContainer.java will always trigger the NonResponsiveConsumerEvent.
Would you please be able to take a look to see if this is a bug?
Thanks!
The text was updated successfully, but these errors were encountered: