Kafka Consumer: No entry found for connection

I have found the problem. It was a DNS problem at the end. I was reaching out the Kafka brokers by the IP addresses, but the broker replies with DNS name. After setting the DNS names on the consumer side, it started working again.


It seems the Kafka cluster listener property is not configured in server.properties.

In the remote kafka cluster, this property should be uncommented with the proper host name.

listeners=PLAINTEXT://0.0.0.0:9092

In my case I was receiving that while trying to connect to my Kafka container, I had to pass the following:

-e KAFKA_LISTENERS=PLAINTEXT://0.0.0.0:9092

-e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092

Hope it helps someone


I had this problem (with consumers and producers) when running Kafka and Zookeeper as Docker containers.

The solution was to set advertised.listeners in the config/server.properties file of the Kafka brokers, so that it contains the IP address of the container, e.g.

advertised.listeners=PLAINTEXT://172.15.0.8:9092

See https://github.com/maxant/kafkaplayground/blob/master/start-kafka.sh for an example of a script used to start Kafka inside the container after setting up the properties file correctly.