从两个JMS Inboundchannel适配器中馈入一个发布订阅通道?

时间:2019-05-13 13:12:20

标签: spring spring-integration spring-jms

从您的角度来看,我只是想问一下以下SI配置是否可以。...

下面是一些订阅者发布的订阅频道...

<int:publish-subscribe-channel id="channelName" ignore-failures="false"/>

并从两个JMS消息驱动的适配器提供它:

<jms:message-driven-channel-adapter channel="channelName"
                                destination="JMSQueue1"
                                connection-factory="JMSQueue1CF1"
                                concurrent-consumers="1"
                                max-concurrent-consumers="10"
                                error-channel="errorChannel"
                                acknowledge="transacted"
                                task-executor="mySimpleTaskExecutor1"/>


<jms:message-driven-channel-adapter channel="channelName"
                                destination="JMSQueue2"
                                connection-factory="JMSQueue2CF2"
                                concurrent-consumers="1"
                                max-concurrent-consumers="10"
                                error-channel="errorChannel"
                                acknowledge="transacted"
                                task-executor="mySimpleTaskExecutor2"/>

如果这两个JMS入站通道适配器都将具有相同的输出通道(“ channelName”),它们是否会以某种方式干扰其处理?

我的猜测是,来自两个队列的每个消息都将在不同的线程中使用,因此来自JMSQueue1的消息处理将不会等待来自JMSQueue2的消息。

是不是真的?

1 个答案:

答案 0 :(得分:1)

在同一频道上拥有多个制作人没有任何问题;线程不会彼此“干扰”。

这与在消息驱动适配器(您拥有的)中具有并发性完全相同。

相关问题