Kafka
快速上手¶
安装¶
wget https://raw.githubusercontent.com/zhenyuanlau/zhenyuanlau.github.io/gh-pages/code/env/kafka/docker-compose.yml
docker-compose up -d
使用¶
brew install kcat
# 写消息到主题 `quickstart-events`
echo test-event | kcat -b localhost:9092 -P -t quickstart-events
# 读消息
kcat -b localhost:9092 -C -t quickstart-events
# 查看元信息
kcat -L -b localhost:9092
基本概念¶
生产者、消费者、消费者组、服务器、主题、分区、副本(主/从)。
资源¶
- Apache Kafka® Docker Quick Start Guide by Confluent
- [kcat Utility](https://docs.confluent.io/platform/current/app-development/kafkacat-usage.html#kcat-formerly-kafkacat-utility)
最后更新: September 10, 2023