启动zookeeper
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
启动kafka
.\bin\windows\kafka-server-start.bat .\config\server.properties
创建名为prq的topic,副本为1,分区为1
.\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic iomsHeartBeat
查看topic列表
.\bin\windows\kafka-topics.bat --list --zookeeper localhost:2181
启动生产者
.\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic SX2_ALM_BUSINESSDATA --producer.config .\config\producer.properties
启动消费者
.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic SX2_ALM_BUSINESSDATA --consumer.config .\config\consumer.properties
.\bin\windows\kafka-console-producer.bat --broker-list localhost:9092 --topic SX2_ALM_BUSINESSDATA --producer.config .\config\producer.properties
.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic SX2_ALM_BUSINESSDATA --consumer.config .\config\consumer.properties
03-01
1249
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-17
506
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-01
8466
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-16
1859
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)