I am trying out the kafka-console-producer.sh. I type something to the console and hit enter and I get tons of stack traces to the console like this. Appreciate any pointers.
This is because you are starting your consumer in a wrong way. If you will check the official documentation, you can see that you have to:
start Zookeper
bin/zookeeper-server-start.sh config/zookeeper.properties
start Kafka
bin/kafka-server-start.sh config/server.properties
create a topic
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
start producing messages for a topic
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
Notice the difference: you are connecting to zookeper (port 2181) you need to connect to a broker (port 9092)
Your broker-list
argument is pointing to Zookeeper instead of the actual broker.
The proper usage would be:
./bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test
assuming your broker runs on port 9092
(default).
You can refer here for more information (your issue is described in Step 4: Send some messages
)