Minh
Minh

Reputation: 2310

Kafka Console Producer returns nothing

Hi I'm going through the quick start and I'm running into an error where when I type in bin/kafka-console-producer.sh --broker-list localhost:9093 --topic first

I get nothing back when I'm expecting a text input to send the message to the Kafka producer. I have followed the instructions for a single and multi-broker set up but it doesn't seem like anything is working. My Zookeeper is running and I see the log files created in the correct log directories but nothing regarding my message.

I have also tried piping it like so cat test.txt | bin/kafka-console-producer.sh --broker-list localhost:9093 --topic first or echo test message | bin/kafka-console-producer.sh --broker-list localhost:9093 --topic first

Is there any other gotchas I should check out for?

Upvotes: 3

Views: 1993

Answers (2)

rahul gupta
rahul gupta

Reputation: 1

File size is becoming 0 when we run any kafka batch file like this.

C:\kafka\bin\windows>>kafka-topics.bat --create --bootstrap-server localhost:9092 --topic topicname.

Here, by mistake, we are giving the operator two times (>>), instead of single operator (>) The >> opeartor makes that particular file size with 0.

That's why replacing the file with original file works.

Upvotes: 0

mcelikkaya
mcelikkaya

Reputation: 315

The same thing happened to me. surprisingly bin\windows\kafka-console-producer.bat file had a size of 0. Just replaced with original file and it worked.

Upvotes: 4

Related Questions