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使用过程,一手资料

其他暂时未完待续。。。

相关文章:

  • 2021-04-12
  • 2021-06-30
  • 2022-12-23
  • 2021-06-01
  • 2022-01-03
  • 2021-06-27
  • 2021-12-09
  • 2021-05-25
猜你喜欢
  • 2022-02-09
  • 2022-01-04
  • 2021-08-03
  • 2021-08-25
  • 2022-03-05
  • 2021-12-25
  • 2021-11-06
相关资源
相似解决方案