- kafka
- host: 0.0.0.0:9092
- topic: test
- partition: 0
- kafka Web 管理
- 0.0.0.0:9000
Docker Compose 配置文件:
- 进入 kafka 容器:
docker exec -it kafka /bin/bash
- 查看话题:
kafka-topics.sh --list --zookeeper zookeeper:2181
- 生产消息:
kafka-console-producer.sh --broker-list kafka:9092 --topic=test
- 消费消息:
kafka-console-consumer.sh --bootstrap-server kafka:9092 --from-beginning --topic test