Validate Kafka

Let us go ahead and validate Kafka by creating a topic and then publishing messages to a topic as well as consuming messages from a topic.

  • Create Kafka Topic

kafka-topics --create --zookeeper bigdataserver-2:2181,bigdataserver-3:2181,bigdataserver-4:2181 --replication-factor 2 --partitions 3 --topic testing

  • Produce the message to the topic

kafka-console-producer --broker-list bigdataserver-5:9092,bigdataserver-6:9092 --topic testing

  • Consume the message from the topic

kafka-console-consumer --bootstrap-server bigdataserver-5:9092,bigdataserver-6:9092 --topic testing --from-beginning

https://gist.github.com/dgadiraju/51f604ce442165a31b8d44ee01737a9b

Share this post