You can either put a router as described above at each point where you want to allow the detour and reconfigure the appropriate one.
Another alternative would be to unsubscribe the appropriate endpoint that you want to detour. Something like this
Code:
<si:transformer id="one" input-channel='input' output-channel='channel.a'/>
<si:transformer id="two" input-channel='channel.a' output-channel='channel.b'/>
<si:transformer id="three" input-channel='channel.b' output-channel='channel.c'/>
<si:transformer id="four" input-channel='channel.c' output-channel='channel.d'/>
<si:transformer id="five" input-channel='channel.d' output-channel='output'/>
<control-bus input-channel="control"/>
Then, in the application that imports this file, send a <control-bus /> message to the transformer you want to detour.
Code:
control.send(new GenericMessage<String>("@three.stop()"));
This will unsubscribe "three" from "channel.b".
Then, subscribe your own consumer to "channel.b".
For this to work, you would probably want to configure your initial inbound adapter to auto-startup="false", and start it (with another control bus message) after the reconfiguration has completed,
Gary P. Russell
Spring Integration Team
SpringSource, a division of VMware