camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rburdet <rodrigo.bur...@semperti.com>
Subject Extrange behaviour of exceptions
Date Fri, 12 Aug 2016 15:02:23 GMT
Hi. i have some doubts about the execution of these camel routes: 

        <route id="route1">
            <from uri="direct:start"/>
            <onException>
            	<exception>java.lang.Exception</exception>
           	<bean ref="exceptionUtil" method="handleException"/>
            </onException>
           <to uri="direct:invokerMainRoute"/>
           <to uri="mock:result"/>
        </route>

        <route id="route2">
            <from uri="direct:start"/>
            <onException>
            	<exception>javax.ws.rs.ServiceUnavailableException</exception>
           	<bean ref="exceptionUtil" method="handleException"/>
          </onException>
           <to uri="direct:invokerMainRoute"/>
           <to uri="mock:result"/>
        </route>

        <route id="route3">
            <from uri="direct:start"/>
            <doTry>
            	<to uri="direct:invokerMainRoute"/>
            	<to uri="mock:result"/>
            	<camel:doCatch>
            		<exception>javax.ws.rs.ServiceUnavailableException</exception>
            		<bean ref="exceptionUtil" method="handleException"/>
            	</camel:doCatch>
	        </doTry>
        </route>

route1 and route3 throws and catch the exception and expected. 
But it doesnt happen the same with route2. The exception is not catch at all
and is very similar as route3.

for more information it would be better to say that invokerMainRoute throws
a javax.ws.rs.ServiceUnavailableException.

Thanks ! 



--
View this message in context: http://camel.465427.n5.nabble.com/Extrange-behaviour-of-exceptions-tp5786363.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message