Skip to content

Instantly share code, notes, and snippets.

@Ruhshan
Last active May 1, 2024 02:54
Show Gist options
  • Save Ruhshan/28aefae81da26b615aeee1bf4f47ee2e to your computer and use it in GitHub Desktop.
Save Ruhshan/28aefae81da26b615aeee1bf4f47ee2e to your computer and use it in GitHub Desktop.
Kafka cheeat sheet

List kafka topics

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

Delete kafka topic

kafka-topics --bootstrap-server localhost:9092 --delete --topic topic-message

Consume topic from beginning

kafka-console-consumer --bootstrap-server localhost:9092 --topic topic-message --from-beginning

Consume topic with headers, keys etc properties

kafka-console-consumer --bootstrap-server localhost:9092 --topic topic-message --from-beginning --property print.headers=true --property print.timestamp=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment