Results 1 to 3 of 3

Thread: Problem modifying error channel

Hybrid View

  1. #1

    Default 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. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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

  3. #3

    Default

    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •