Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring integration Message handler chain usage?

I am new to spring integration. i have few channels configured in my configuration file as below.

<int:channel id="channelOne" />
<int:channel id="channelTwo" />
<int:channel id="channelThree" />

can i use MessageHandlerChain ( http://static.springsource.org/spring-integration/docs/2.0.0.RC1/reference/html/chain.html ) in this scenario?

Thanks!

like image 611
user1016403 Avatar asked Dec 03 '12 14:12

user1016403


1 Answers

A chain is a convenience to simplify configuration when endpoints are connected by direct channels:

Instead of

<int:channel id="foo1"/>

<int:service-activator input-channel="foo1" output-channel="foo2" ref="s1" />

<int:channel id="foo2"/>

<int:service-activator input-channel="foo2" output-channel="foo3" ref="s2/>

<int:channel id="foo3"/>

<int:service-activator input-channel="foo3" output-channel="foo4" ref="s3" />

<int:channel id="foo4"/>

You can use

<int:channel id="foo1"/>

<int:chain input-channel="foo1" output-channel="foo4">    
    <int:service-activator ref="s1" />
    <int:service-activator ref="s2" />
    <int:service-activator ref="s3" />
</int:chain>

<int:channel id="foo4"/>

Please use the current documentation.

like image 81
Gary Russell Avatar answered Sep 19 '22 23:09

Gary Russell