Skip to content

Instantly share code, notes, and snippets.

@steklopod
Last active February 4, 2020 08:45
Show Gist options
  • Save steklopod/511aeaef0fd498444cfac2e29893338a to your computer and use it in GitHub Desktop.
Save steklopod/511aeaef0fd498444cfac2e29893338a to your computer and use it in GitHub Desktop.
Kafka

Start

Windows

  • zookeeper-server-start.bat config/zookeeper.properties
  • kafka-server-start.bat config/server.properties

Create

kafka-topics.bat --bootstrap-server localhost:9092 --topic first --create --partitions 6 --replication-factor 1

List

kafka-topics.bat --bootstrap-server localhost:9092 --list

Delete

kafka-topics.bat --bootstrap-server localhost:9092 --topic first_topic --delete

Producer

kafka-console-producer.bat --broker-list localhost:9092 --topic first

kafka-console-producer.bat --broker-list localhost:9092 --topic first --producer-property acks=all

Consumer

kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic first --from-beginning

kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic first --group

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