below is the code:
<route id="StartMyRoute">
<from uri="direct:StartMyRoute"/>
<to uri="direct:myRoute2"/>
<onException>
<exception>SpecificException</exception>
<to uri="direct:myRoute3"/>
</onException>
</route>
I was trying the same thing with Java DSL:
from("direct:StartMyRoute")
.routeId("StartMyRoute")
.to("direct:myRoute2")
.onException(SpecificException.class)
.to("direct:myRoute3");
which didn't work but later I tried onException
at the global scope which worked.
I have some route specific functionality that should be executed in onException(...)
handler so I can't use global scope.
Below is my code which has global scope:
onException(SpecificException.class)
.to("direct:myRoute3");
from("direct:StartMyRoute")
.routeId("StartMyRoute")
.to("direct:myRoute2");
Can someone help me understand why route-specific onException(...)
is not triggered?