简体   繁体   中英

Feeding one publish subscribe channel from two JMS Inboundchannel adapters?

I just want to ask whether following SI configuration is OK from your point of view....

Let's have following publish subscribe channel with some subscribers...

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

and feed it from two JMS message driven adapters:

<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"/>

If both of these JMS Inbound channel adapters are going to have same output channel ("channelName"), are they going to interfere their processing somehow?

My guess is that every message from both queues is going to be consumed in the different thread so processing of message from JMSQueue1 won't be waiting on message from JMSQueue2.

True or not true?

There are no issues with having multiple producers on the same channel; the threads won't "interfere" with each other.

It's exactly the same as having concurrency in the message-driven adapter (which you have).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM