Spring 集成中的外部消息传递

External Messaging in Spring Integration

想问一下,为什么amqp/jms的实现方式是Inbound and Outbound Channel Adapters
它们的作用与 Message Channel 相同,因此如果将它们实现为 MessageChannel,那么它可以很容易地用于不同的组件,例如直接在服务激活器中:

<integration:service-activator ref="receiver" method="receiveMessage" input-channel="jmsInputChannel"/>

在创建服务激活器的过程中,它会被映射到某个消息侦听器,它将被 JMS/AMQP 系统调用。
配置将直接在 JMSMessageChannel 上完成。

有什么我遗漏的吗?因为在高层次上它看起来确实可以完成并且会简化 API。

看起来您忽略了 Spring 集成 AMQP 和 JMS 确实具有特定的 MesaageChannel 实现这一事实

https://docs.spring.io/spring-integration/docs/5.0.0.RELEASE/reference/html/amqp.html#amqp-channels

https://docs.spring.io/spring-integration/docs/5.0.0.RELEASE/reference/html/jms.html#jms-channel