Skip to content

Instantly share code, notes, and snippets.

@timhugh
Created December 31, 2019 22:08
Show Gist options
  • Save timhugh/0e900dcd44b83786eb95535f7adef8c2 to your computer and use it in GitHub Desktop.
Save timhugh/0e900dcd44b83786eb95535f7adef8c2 to your computer and use it in GitHub Desktop.
Kafka CLI Cheatsheet
# Selecting a server
kafka-topics --bootstrap-server kafka:9092
kafka-console-producer --broker-list kafka:9092
kafka-console-consumer --bootstrap-server kafka:9092
# Managing topics
kafka-topics --list
kafka-topics --describe --topic topic.name
kafka-topics --create --partitions 1 --replication-factor 1 --topic topic.name
kafka-topics --delete --topic topic.name
# producing messages
kafka-console-producer --topic topic.name
# consuming messages
kafka-console-consumer --topic topic.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment