创建“测试”主题后,
kafka-topics --create --zookeeper localhost:2181 --replication-factor 1 --partitions 4 --topic test
我看到的内容已正确创建:
kafka-topics --describe --zookeeper localhost:2181 --topic test
Topic:test PartitionCount:4 ReplicationFactor:1 Configs:
Topic: test Partition: 0 Leader: 0 Replicas: 0 Isr: 0
Topic: test Partition: 1 Leader: 0 Replicas: 0 Isr: 0
Topic: test Partition: 2 Leader: 0 Replicas: 0 Isr: 0
Topic: test Partition: 3 Leader: 0 Replicas: 0 Isr: 0
我有两个控制台窗口,一个Producer
和一个Consumer
控制台。 Producer
适用于:
kafka-console-producer --broker-list localhost:9092 --topic test
>
当我在第二个控制台窗口上尝试以下操作时:
kafka-console-consumer –bootstrap-server localhost:9092 –from-beginning –topic test
我收到错误:
Exactly one of whitelist/topic is required.
Option Description
------ -----------
--blacklist <String: blacklist> Blacklist of topics to exclude from
consumption.
...Lots more text here...
在控制台Producer
中监听来自Consumer
的邮件的正确方法是什么?