Skip to content

Instantly share code, notes, and snippets.

@clucle
Last active January 28, 2024 14:53
Show Gist options
  • Save clucle/1f1ea17dc737209db89289188c6c45e1 to your computer and use it in GitHub Desktop.
Save clucle/1f1ea17dc737209db89289188c6c45e1 to your computer and use it in GitHub Desktop.
run kafka windows
~/kafka_2.13-3.0.0/bin/kafka-storage.sh random-uuid # hash
kafka-storage.sh format -t ${hash} -c ~/kafka_2.13-3.0.0/config/kraft/server.properties
kafka-server-start.sh ~/kafka_2.13-3.0.0/config/kraft/server.properties
## producer
kafka-console-producer.sh --bootstrap-server localhost:9092 --topic demo_java
# windows
kafka-storage.bat random-uuid
kafka-storage.bat format -t ${hash} -c D:\dev\kafka_2.13-3.6.1\config\kraft\server.properties
kafka-server-start.bat D:\dev\kafka_2.13-3.6.1\config\kraft\server.properties
## producer
kafka-console-producer.bat --bootstrap-server localhost:9092 --topic demo_java
## consumer
kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic demo_java --formatter kafka.tools.DefaultMessageFormatter --property print.timestamp=true --property print.key=true --property print.value=true --property print.partition=true --from-beginning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment