记录kafka使用过程,一手资料

1. https://kafka.apache.org/quickstart  按照步骤操作即可

2.Download the 2.5.0 release and un-tar it. 我下载的是windows版本的。

记录kafka使用过程,一手资料

3.启动本地zookeeper 。如果你本地没有安装zookeeper,可以使用kafka提供的脚本启动。(Kafka uses ZooKeeper so you need to first start a ZooKeeper server if you don't already have one. You can use the convenience script packaged with kafka to get a quick-and-dirty single-node ZooKeeper instance.)

记录kafka使用过程,一手资料

再启动kafka-server-start.bat ..\..\config/server.properties

记录kafka使用过程,一手资料

4.创建主题

kafka-topics.bat --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test

查看主题

kafka-topics.bat --list --bootstrap-server localhost:9092

记录kafka使用过程,一手资料

5.发送消息

kafka-console-producer.bat --bootstrap-server localhost:9092 --topic test

记录kafka使用过程,一手资料

6.消费消息

kafka-console-producer.bat --bootstrap-server localhost:9092 --topic test

记录kafka使用过程,一手资料

其他暂时未完待续。。。