You can spin up a kafka cluster with the docker-compose.yaml file by running docker-compose up -d
You can then start a consumer with:
docker exec -it broker kafka-console-consumer --bootstrap-server localhost:9092 --topic new_topic --from-beginningOr do it with a consumer group:
docker exec -it broker kafka-console-consumer --bootstrap-server localhost:9092 --topic new_topic --group new_group --from-beginningCreate a new topic in the cluster with:
docker exec broker kafka-topics --bootstrap-server localhost:9092 --topic new_topic --create --partitions 3 --replication-factor 1Delete a topic in the cluster with:
docker exec broker kafka-topics --bootstrap-server localhost:9092 --topic new_topic --deleteAnd start an interactive producer with:
docker exec --interactive --tty broker \
kafka-console-producer --bootstrap-server localhost:9092 \
--topic new_topic