Posts

Showing posts from March, 2023

KAFKA COMMANDS

Image
  Kafka Command line is needed to install these commands Run inside the bin directory of kafka Create a new topic: bash ./kafka-topics.sh --create --bootstrap-server kafka-ip:9092 --replication-factor 1 --partitions 500 --topic topicName Increase number of partitions bash ./kafka-topics.sh --bootstrap-server kafka-ip:9092 --alter --topic topicName --partitions 6000 Describe Topic - Get info about topic bash ./kafka-topics.sh --describe --zookeeper kafka-ip:2181 --topic topicName Delete Topics bash ./kafka-run-class.sh kafka.admin.TopicCommand --delete --topic topicName --bootstrap-server kafka-ip:2181 Producer - Enter command wait for '>' to appear, type/paste message to publish and press Enter bash ./kafka-console-producer.sh --broker-list kafka-ip:9092 --topic topicName Consumer - Starts from the latest message ie message being published after starting consumer bash ./kafka-console-consumer.sh --bootstrap-server kafka-ip:9092 --topic topicName Consumer - Fetch messages f...