Announcement Announcement Module
Collapse
No announcement yet.
Problem modifying error channel Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem modifying error channel

    Hallo all:

    I have this simple configuration:

    Code:
    <!-- Chain error handler -->
    	<int:chain input-channel="defaultErrorChannel" output-channel="responseChannel">
    		<int:service-activator ref="errorHandlerActivator" />
    	</int:chain>
    
    	<int:gateway id="gateway" service-interface="it.sample.integration.error.gateway.Gateway" default-request-channel="preProcessingChannel"  error-channel="defaultErrorChannel"/>
    	
    	
    	<int:chain input-channel="preProcessingChannel" output-channel="responseChannel">
    		<int:header-enricher>
    			<int:error-channel ref="customErrorChannel"/>
    		</int:header-enricher>
    		<int:service-activator ref="throwExceptionActivator" method="activate" />
    	</int:chain>
    	
    	<int:chain input-channel="customErrorChannel" output-channel="responseChannel">
    		<int:service-activator ref="customErrorHandlerActivator" method="activate" />
    	</int:chain>
    As you can see I need to redefine the error channel on a chain to handle the exceptions thrown by that chain in a particular way.

    I redefined the error channel property on the chain as follows <int:error-channel ref="customErrorChannel"/> but when the sequent activator throws an exception the message is redirected to the defaultErrorChannel defined on the initial gateway.

    Where am I wrong?

    Kind regards
    Massimo

  • #2
    Right, that is because the initial gateway is considered the entry point into a particular segment of your message flow. A flow segment typically depends on the well defined entry point into such segment. Typically its a Gateway and/or Poller. In your case its the Gateway that manages where the exception goes. So if you need the exception to be handled differently from some other part of he flow you may want to artificially segment your flow into sub-flows.
    Look at this example I showed few years ago at Spring One https://github.com/olegz/s12gx.2011/...n/segmentation

    Comment


    • #3
      Ok, now all takes sense.
      I thought that the gateway was the key point, but the documentation on error handling was a little short.

      Kind regards.
      Massimo

      Comment

      Working...
      X