On Apr 15, 2015, at 12:09 AM, Alex Melville <amelvi...@g.hmc.edu> wrote:
> 
> Hi All,
> 
> What is the lightest way to check if the connection to Kafka is up or not?
> Currently I'm having the producer attempt to send a message to a topic, and
> then catching a TimeoutException and handling logic inside of the catch
> statement. This doesn't seem like the right way to do this, though. Is
> there a way to check if the connection is up without resorting to control
> flow through Exceptions?
> 
> I'm using Kafka 0.8.2

What's your use case in particular? Even if you check the status of the 
connection at some point in time, you'll also need to handle exceptions when 
you perform some other operation later because it may have failed since you 
last checked it.

Reply via email to