Search code examples
apache-kafkamessage-queueapache-zookeeperhadoop2

Consume kafka from brokers?


./bin/kafka-console-consumer.sh --zookeeper 127.0.0.1:2181 --topic test

./bin/kafka-console-producer.sh --broker-list 127.0.0.1:9092 --topic test

Why to consume kakfa needed zookeeper? could I consume kafka from brokers ?


Solution

  • --zookeeper is an outdated option (for the old Consumer).

    Use the newer --bootstrap-server option with kafka-console-consumer.

    More info: http://kafka.apache.org/documentation/#newconsumerconfigs