Skip to content

Instantly share code, notes, and snippets.

@acmlira
Last active September 10, 2022 15:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acmlira/9c7b9e34d3c3e85b0f0f7b38b5761546 to your computer and use it in GitHub Desktop.
Save acmlira/9c7b9e34d3c3e85b0f0f7b38b5761546 to your computer and use it in GitHub Desktop.
Kafka topic sample
# Clone and start
git clone git@github.com:conduktor/kafka-stack-docker-compose.git
cd kafka-stack-docker-compose
docker-compose -f zk-single-kafka-single.yml up -d
# Open kafka container
docker exec -it kafka1 /bin/bash
# Inside container Create topic
kafka-topics --bootstrap-server localhost:9092 --list
kafka-topics --bootstrap-server localhost:9092 --topic decks --create --partitions 3 --replication-factor 1
kafka-topics --bootstrap-server localhost:9092 --describe --topic decks
# Produce test messages
kafka-console-producer --bootstrap-server localhost:9092 --topic decks
# Consume test messages
kafka-console-consumer --bootstrap-server localhost:9092 --topic decks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment