Is there a way to check server health or connectivity? #1041
              
                Unanswered
              
          
                  
                    
                      AngryPirate
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to know this since once I start writing messages to disk once they have 'timed out' on the producer channel, which usually happens when the kafka server is down or unreachable, to check when I can re-queue these messages into the producer.
Basically, a way to periodically check to see if I can connect to the kafka server with my current ConfigMap.
I tried using the AdminClient to create a topic as a check of health, but this seems to exit the program after one failure or just hang up the calling go routine.
A quick, ping test would be useful, using your current ConfigMap values or perhaps there is a better way that already exists?
Thanks for any help.
UPDATE
This is what I did... I got an AdminClient, fetched the Broker metadata and listed the brokerIDs. If no metadata or brokerIDs returned, then the server was still down.
my ConfigMap properties were all of the connection properties in my ConfigMap that I use to publish events, with a couple additional properties that are:
Note:
adminConfigMapis my kafka.ConfigMap object I use for doing AdminClient stuff.Beta Was this translation helpful? Give feedback.
All reactions