Kafka Commands

Start kafka server. For this you need to go inside kafka folder.

/bin/kafka-server-start.sh config/server.properties

List topics on kafka broker

bin/kafka-topics.sh --list --zookeeper localhost:2181

Create topic

bin/kafka-topics.sh --create --zookeeper localhost:9092 --replication-factor 1 --partitions 1 --topic topic_name
bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic failedtransactions

Command line producer

bin/kafka-console-producer.sh --broker-list localhost:9092 --topic topic_name

Leave a Comment

Your email address will not be published. Required fields are marked *