kafka-topics.sh --zookeeper code example
Example 1: kafka list topics
bin/kafka-topics.sh --list --zookeeper localhost:2181
Example 2: kafka create topic
$ bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092
bin/kafka-topics.sh --list --zookeeper localhost:2181
$ bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092