【发布时间】:2022-02-01 14:39:43
【问题描述】:
我想了解如何为 Spring 与 Reactor 核心的集成创建 reactive 通道适配器。我从其他论坛I've read that this Mongo DB reactive adapter can be a good example 了解到,但它包含许多特定于 Mongo 领域的类。
我已阅读文档的 Reactive 部分,我发现需要实现 MessageProducerSupport,但从代码示例看来,需要实现一个扩展 MessageProducerSpec 的类和调用第一个。有人可以举一个最基本的用法示例并解释创建这样一个通道适配器的真正需求吗?我知道我应该做的是:
public IntegrationFlow buildPipe() {
return IntegrationFlows.from(myMessageProducerSpec)
.handle(reactiveMongoDbStoringMessageHandler, "handleMessage")
.handle(writeToKafka)
.get();
}
【问题讨论】:
标签: spring spring-boot spring-integration project-reactor reactor