Closed krnkhanna closed 2 years ago
From the way the kafka-stream extension works, configuration entries picked must begin with quarkus.
You should try :
quarkus.kafka.bootstrap.servers=localhost:9092
quarkus.kafka.retry-attempts=2
I think it would work bet if indeed you are using the kafka-streams extension.
I've reproduced the issue. It's the admin client (for health check) that don't get the right retry amount. In the meantime, disable the health check or just the readiness health check:
mp.messaging.incoming.emea-auth-response-topic-incoming.health-readiness-enabled=false
Actually, it won't be enough. The underlying Kafka consumer always attempt to reconnect.
We woulld need https://cwiki.apache.org/confluence/display/KAFKA/KIP-53+-+Add+custom+policies+for+reconnect+attempts+to+NetworkdClient which is not yet integrated.
With https://issues.apache.org/jira/browse/KAFKA-3496 marked as won't fix, there is not much we can do. Closing as it's an upstream client issue.
@cescoffier , we are facing an issue opposite of this.
Once the connection breaks because of network issue or something, Quarkus application is not able to reconnect to the Kafka broker unless and until we explicitly restart the pod.
Are there any ways to fix that?
Describe the bug I am working on a Quarkus application and intend to use Kafka to receive messages, however I want to stop the application if the application is not able to reach Kafka broker after retrying for a certain number of times. The default configuration is to try infinite number of times to reconnect. In the documentation at Smallrye Reactive Messaging Kafka, it says we can use kafka.retry-attempts or mp.messaging.incoming.[channel-name].retry-attempts to configure the number of retries. I have tried both but the application still goes on retring.
Expected behavior Application should stop retrying after a configured number of tries.
Actual behavior Application goes on retrying to connect to the broker.
To Reproduce Start the application without starting the Kafka broker or shut down Kafka broker after starting the application.
Steps to reproduce the behavior:
Configuration
Screenshots (If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
uname -a
orver
:java -version
:mvnw --version
orgradlew --version
):Additional context (Add any other context about the problem here.)