[Question] How to detect connection failures and is there a hard limit for re-connection?
See original GitHub issueThe consumer currently attempts to re-connect to brokers after encountering connectivity issues. Is it possible to apply a global timeout/limit to consumer’s re-connection or disable it completely? Is it possible to somehow detect the connection loss in the user code?
As it stands, the messages processed lately are by definition incorrect in the system I work on, so I have a side channel that can invalidate the output for my clients. In general, I would prefer getting an exception from Consume
to losing time on re-connection attempts that take longer than a few seconds when all brokers are not available.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Client Reconnection - signalr
My understanding of the (JavaScript) hub client is that if a connection is lost, it enters a 'Reconnecting...' phase which attempts to reconnect...
Read more >Reasons for connectivity failures between availability replicas
This article describes the different possible reasons for a connection failure between replicas participating in an Always On availability ...
Read more >Connection state recovery - Ably FAQs
Connection state recovery · How many messages will you store whilst a client is disconnected? There is no hard limit so we will...
Read more >Citrix Director - Failure Reasons Troubleshooting Guide
Check in the Director console to see if the client currently has an active connection, which means no user would be currently impacted....
Read more >Error Handling and Recovery - Bunny
When Bunny detects TCP connection failure, it will try to reconnect every 5 seconds. Currently there is no limit on the number of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@quixoticaxis , so as far as I don’t know for what kind of business your writing codes , I’m suggesting you to use AdminClient to managing your brokers etc… , whenever you get all your brokers or just specific broker is/are unavailable you can clean/delete your topics by this way your clients couldn’t get any more messages from Kafka , meanwhile whenever your brokers come available again , your producer will create topics again and other cycles will occure
hi @quixoticaxis
about your first question (set timeout/limit consumer connection) , you can use SessionTimeoutMs property in ConsumerConfig , E.g
about your second question to detecting the bootstrap server is available or not I’ll refer you to this link. in result , you should use AdminClient to managing your topics , brokers etc…