我查看了以下文档:https ://github.com/akka/reactive-kafka ,我看到了以下代码片段:
implicit val actorSystem = ActorSystem("ReactiveKafka")
implicit val materializer = ActorMaterializer()
val kafka = new ReactiveKafka()
val publisher: Publisher[StringConsumerRecord] = kafka.consume(ConsumerProperties(
bootstrapServers = "localhost:9092",
topic = "lowercaseStrings",
groupId = "groupName",
valueDeserializer = new StringDeserializer()
))
我知道“发布者”应该向 Kafka 写消息。然而,Kafka 中的 Consumer 的含义恰恰相反,即消费者从 Kafka 中读取消息。如果是这样,'publisher' 与 kafka.consume(ConsumerProperties...) 有什么关系?