Oleg,
It turns out the issue was more involved than I thought. Below is a configuration you posted back on Jan. 28th. This example is essentially what I’m trying to do.
Code:
<int:channel id="errorChannelA"/>
<int:service-activator input-channel="errorChannelA" expression="'ERROR from errorChannelA'"/>
<int:channel id="errorChannelB"/>
<int:service-activator input-channel="errorChannelB" expression="'ERROR from errorChannelB'"/>
<int:gateway id="testGateway"
service-interface="org.springframework.integration.gateway.InnerGatewayWithChainTests.TestGateway"
default-request-channel="requestChannelA"
error-channel="errorChannelA"/>
<int:chain input-channel="requestChannelA">
<int:service-activator expression="1/(payload-5)"/>
<int:gateway request-channel="requestChannelB" error-channel="errorChannelB"/>
</int:chain>
<int:service-activator input-channel="requestChannelB" expression="10/payload"/>
The above example works as I’d expect, but if you make a small change to wrap the handling of the message from errorChannelB in a chain, then you should see the behaivor that I’m seeing.
Code:
<int:channel id="errorChannelA"/>
<int:service-activator input-channel="errorChannelA" expression="'ERROR from errorChannelA'"/>
<int:channel id="errorChannelB"/>
<int:chain input-channel=”errorChannelB”>
<int:service-activator expression="'ERROR from errorChannelB'"/>
</int:chain>
<int:gateway id="testGateway"
service-interface="org.springframework.integration.gateway.InnerGatewayWithChainTests.TestGateway"
default-request-channel="requestChannelA"
error-channel="errorChannelA"/>
<int:chain input-channel="requestChannelA">
<int:service-activator expression="1/(payload-5)"/>
<int:gateway request-channel="requestChannelB" error-channel="errorChannelB"/>
</int:chain>
<int:service-activator input-channel="requestChannelB" expression="10/payload"/>
I know from reading section 7.2 of the Spring Integration Reference Manual that there are times that the expected behavior of a Gateway is for the Gateway method call to hang indefinitely, but I can’t determine why changing the from being handled by a service-activator to a chain should cause this behavior.