Skip to content

Instantly share code, notes, and snippets.

@AshishKapoor
Last active December 7, 2020 08:30
Show Gist options
  • Save AshishKapoor/10ec9968c2735634be6a4d84d82624db to your computer and use it in GitHub Desktop.
Save AshishKapoor/10ec9968c2735634be6a4d84d82624db to your computer and use it in GitHub Desktop.
Quick Kafka

Install kafka/zookeeper and start servers

$ brew install kafka
$ brew install zookeeper

$ zkServer start
$ kafka-server-start /usr/local/etc/kafka/server.properties

Create a topic

$ kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test

Send a message

$ kafka-console-producer --broker-list localhost:9092 --topic test
>HELLO Kafka

Receive a message

$ kafka-console-consumer --bootstrap-server localhost:9092 --topic test --from-beginning
HELLO Kafka

--

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment