I have a chain that uses gateways to call other chains and I want to ensure that if one gateway call fails from an error the other items in the chain still execute.
Here is my current configuration:
As you can see I've tried using the header-enricher in both places but it never seems to get called. I am able to catch the error (caused in service-activator ref=hmkUserService) at the profileGateway but by that time it is too late and the error has causes the chain to exit.Code:<gateway id="profileGateway" service-interface="someInterface" error-channel="profileHmkFailureChannel"> <!-- global catch --> <method name="login" request-channel="profileServicesInputChannel" reply-channel="profileServicesOutputChannel" reply-timeout="40" request-timeout="40"/> </gateway> <!-- ROOT CHAIN --> <chain input-channel="profileServicesInputChannel" output-channel="profileServicesOutputChannel"> <header-enricher> <header name="profile" ref="profile"/> <error-channel ref="profileHmkFailureChannel"/> </header-enricher> <transformer method="transform" ref="profileToHmkUserTransformer"/> <gateway request-channel="profileHmkInputChannel" request-timeout="10"/> <transformer method="transform" ref="profileToHmkOrgTransformer"/> <gateway request-channel="profileHmkOrgInputChannel" request-timeout="10"/> <transformer method="transform" ref="profileToAcsTransformer"/> <gateway request-channel="profileAcsInputChannel" request-timeout="10"/> </chain> <!-- START - Info --> <chain input-channel="profileHmkInputChannel"> <header-enricher> <error-channel ref="profileHmkFailureChannel"/> </header-enricher> <service-activator method="getUser" ref="hmkUserService"/> <transformer expression="@profileHmkTransform.transform(payload, headers.profile)"/> </chain>
My questions are:
1) Is there a way to tell the 'root' chain to keep going even if there is an exception in one of the gateway calls?
2) Is there a way to have each gateway send errors to their own error-channels (the header-enricher doesn't seem to be working)
3) Could I be doing this a better way?
Thanks in advance!


Reply With Quote
