amitabh pandey
amitabh pandey

Reputation: 75

Kafka console Consume Command not accepting bootstrap-servers

I have installed Kafka on my windows machine. My Kafka version is kafka_2.12-2.4.0. I have started the Zookeeper server, then Kafka server then creates the topic and then produces the message to created Topic. Till here everything is fine. But when I run the Consume command, it is giving me below error.

'--bootstrap-servers' is not recognized as an internal or external command, operable program or batch file.

I am using the below command.

.\bin\windows\kafka-console-consumer.bat --bootstrap-servers localhost:9092 --topic TEST_TOPIC --from-beginning

Please suggest me what could be the problem.

Upvotes: 1

Views: 2588

Answers (2)

snowleopard
snowleopard

Reputation: 833

I resolved the issue on my side. The issue was that in the command prompt, for some reason, I had a double arrow >>:

C:\kafka_2.13-2.4.0>> .\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic myTopic '--bootstrap-server' is not recognized as an internal or external command, operable program or batch file.

Once I removed the double arrow, the error went away. Now I appear to have other issues where Kafka is not running on the port I thought it was, but that is a separate issue.

Upvotes: 0

Mark Bramnik
Mark Bramnik

Reputation: 42501

You should use --bootstrap-server instead of --bootstrap-servers (note 's' at the end):

Try:

kafka/bin/kafka-console-consumer.bat \
    --bootstrap-server localhost:9092 \
    --topic TEST_TOPIC \
    --from-beginning

Upvotes: 2

Related Questions