Uploaded image for project: 'FUSE Mediation Router'
  1. FUSE Mediation Router
  2. MR-828

Camel RecipientList ignores doTry and doCatch error handlers

    XMLWordPrintable

Details

    Description

      When using a recipient list contained in a doTry/doCatch, the error handling of the doTry/doCatch is ignored and the exception is handled by the global error handler.

      The following is a sample route:

      <onException>
      		<exception>java.lang.Exception</exception>
      		<handled>
      			<constant>true</constant>
      		</handled>
      		<log message="GLOBAL error handling"/>
      		<setBody>
      			<constant>Global error handling</constant>
      		</setBody>
      	</onException>
      
      <route id="router">
      
              <from uri="direct:inner-router"/>
      		<log message="parameter IN: ${header.useHandler}"/>
      		
      		<doTry>
      			<log message="trying...."/>
      
      			<when>
      				<simple>${header.useCamelRouter} == 'recipient-list'</simple>				
      				<setProperty propertyName="destination">
      					<constant>direct:force-error</constant>
      				</setProperty>				
      				<camel:recipientList>
      					<simple>${property.destination}</simple>
      				</camel:recipientList>				
      			</when>
      
      			<when>
      				<simple>${header.useCamelRouter} == 'to'</simple>
      				<to uri="direct:force-error"/>
      			</when>			
      			
      			<doCatch>
      				<exception>java.lang.Exception</exception>
      				<handled><constant>true</constant></handled>
      				<setBody>
      					<constant>Try-Catch error handling</constant>
      				</setBody>
      			</doCatch>
      			
      		</doTry>
      		
          </route>
      

      When the route is executed using the recipient list the exception get handled by the global error handler rather than using the doTry/doCatch error handler.

      Attachments

        Activity

          People

            cibsen@redhat.com Claus Ibsen
            rhn-support-jsherman Jason Sherman
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: