Support Questions

Find answers, ask questions, and share your expertise

Kafka console consumer nor reading messages when used with bootstrap servers option

avatar

I am using kafka console consumer script to read messages from a kafka topic. but it is showing the following behavior.

If i use the zookeeper option, the consumer reads messages, whereas if i use bootstrap-server option i am not able to read messages. any thoughts.

using HDP 2.6

 bin/kafka-console-consumer.sh --bootstrap-server 172.16.3.196:6667 --topic test1 --from-beginning 
bin/kafka-console-consumer.sh --zookeeper 172.16.3.196:2181 --topic test1 --from-beginning
Using the ConsoleConsumer with old consumer is deprecated and will be removed in a future major release. Consider using the new consumer by passing [bootstrap-server] instead of [zookeeper].
Hello
How are you
this is a test message
Hope this helps
11 REPLIES 11

avatar
New Contributor

I got it working.

It seems there were some phantom borkers in zookeeper because I reconfigured the location of the kafka nodes after installation.

Removing the brokers from zookeeper and restarting the kafka nodes solved the issue:

bin/zookeeper-shell <zk-host>:2181
rmr /borker

Br.,

Istvan

avatar
New Contributor

you saved my day!