Last active
September 10, 2022 15:27
-
-
Save acmlira/9c7b9e34d3c3e85b0f0f7b38b5761546 to your computer and use it in GitHub Desktop.
Kafka topic sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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