I wish to create a message chain out of existing channels, without specifically write all the elements again.
Currently I have several long chains that overlaps one another with certain elements. Every time I add a new element, I have to add it in several chains. I wish to create a chain of channels, that can be called as a sequence.
To simplify, my applicationContext at the moment has 3 channels. channel 1 and channel 2, and channel 3 that consist of the two:
<int:chain input-channel="channel-1">
<int:service-activator ref="serviceA" method="doService" />
<int:service-activator ref="serviceB" method="doService" />
<int:service-activator ref="serviceC" method="doService" />
</int:chain>
<int:chain input-channel="channel-2">
<int:service-activator ref="serviceD" method="doService" />
<int:service-activator ref="serviceE" method="doService" />
<int:service-activator ref="serviceF" method="doService" />
</int:chain>
<int:chain input-channel="channel-3">
<int:service-activator ref="serviceA" method="doService" />
<int:service-activator ref="serviceB" method="doService" />
<int:service-activator ref="serviceC" method="doService" />
<int:service-activator ref="serviceD" method="doService" />
<int:service-activator ref="serviceE" method="doService" />
<int:service-activator ref="serviceF" method="doService" />
</int:chain>
What I looking for is a simple solution that will enable me to do something like
<int:chain input-channel="channel-3">
<??? channel-1 />
<??? channel-2 />
</int:chain>
Is there some simple way to do that?