Multiple channel's message comes into single channel

我只是一个虾纸丫 提交于 2019-12-08 10:21:29

问题


i am fresher of Spring Integration, i am confuing one question which i have multiple channels but now i want to assemble messages from those channel into single channel, how to implement it ? my senario is that i have lots of businees modues and each module will corresponding to one channel, those channels will receive the request then assemble the message into one single channel , then output to the jms server:

is below code possible ?

<channel id='a'/> <bridge input-channel='a' out-channel='assembled'/>
<channel id='b'/> <bridge input-channel='b' out-channel='assembled'/>
<channel id='b'/> <bridge input-channel='c' out-channel='assembled'/>
<channel id='c'/> <bridge input-channel='d' out-channel='assembled'/>

<channel id='assembled'/>

<!-- the router will desicde which jms gateway to be sent  -->
<router input-channel='assembled' > 

<channel id='to_jms1'/>
<channel id='to_jms2'/>

<jms-outbound-gateway id='jms1' channel='to_jms1'/>
<jms-outbound-gateway id='jms2' channel='to_jms2'/>

回答1:


If you mean you want to send each individual message arriving on a, b, c etc to the same channel, then what you have above will work.

If you want to merge together the messages on a, b, c, d into a single message then after the bridges, use an <aggregator/> with appropriate correlation and release strategies.

See the reference documentation for more information.



来源:https://stackoverflow.com/questions/18555008/multiple-channels-message-comes-into-single-channel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!