Skip to content

Instantly share code, notes, and snippets.

@sshaaf
Last active April 1, 2021 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sshaaf/aeb9a19ae66e8b53b91595c336cf721e to your computer and use it in GitHub Desktop.
Save sshaaf/aeb9a19ae66e8b53b91595c336cf721e to your computer and use it in GitHub Desktop.
Setting up Kafka and..
# starting the server
kafka_2.12-2.1.1> bin/zookeeper-server-start.sh config/zookeeper.properties
kafka_2.12-2.1.1> bin/kafka-server-start.sh config/server.properties
# Adding topics
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic-mission-event
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic-mission-command
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic-responder-location-update
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic-incident-event
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic-incident-command
# Listening to topics on cmd
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic topic-responder-loc-event --from-beginning
# Writing to topics from cmd
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic topic-mission-command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment