0

I would like to know how to verify the connection to kafka: let me to explain better:

I have one KafkaConsumer is waiting to consume messages, let's assume that kafka connection meantime is down. While I am trying to consume messages with my iteration on my consumer and connection is lost, it will go on Exception.
Is there any way to check connection? I am using kafka-python version 1.3.3.

This is a pieace of code:

consumer = KafkaConsumer(....)
for msg in consumer:
    DO....

This is the execpetion I have during my iteration:

getaddrinfo failed for kafka:9092, exception was [Errno -2] Name or service not known

Thank you all

Prisco
  • 653
  • 1
  • 15
  • 30

1 Answers1

0

If you are using Linux OS then you can check Kafka connection from your Linux terminal that, whether it is working or not. You can use the telnet command and define kafka-ip and kafka-port

telnet 127.0.0.1 9092