Announcement Announcement Module
Collapse
No announcement yet.
Chain/Gateway error handling Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Chain/Gateway error handling

    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:
    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>
    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.

    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!

  • #2
    Ok, the issue is that we need to allow error-channel on the <gateway> element within the chain.

    Could you please open a JIRA issue for that?

    Thanks

    Comment


    • #3
      Ok I created a JIRA https://jira.springsource.org/browse/INT-1745
      Should be ready for 2.0.2

      Comment

      Working...
      X