DirectChannel 可以无阻塞地用于 Spring 与 Project Reactor 的集成吗?

Can DirectChannel be used in Spring Integration with Project Reactor without blocking?

FluxMessageChannel 上下文中的 documentation of Spring Integration specifies that

To achieve fully reactive behavior for the whole integration flow, such a channel must be placed between all the endpoints in the flow.

这让我想到在使用 Reactive Streams 时是否也可以使用 DirectChannel,或者它是否会导致事件循环出现任何问题?

这取决于 MessageHandler 订阅 DirectChannel 的阻塞程度。其目的是直接在已向 DirectChannel 发送消息的线程上调用 MessageHandler。所以,如果你做 .map(e -> directChannel.send(e)),你需要确保 MessageHandler 没有阻塞。