I am new to camel (v 2.10.0) and searching for a problem that i have due to exceptions that we throw in routes which are called by wireTap().
PROBLEM: is that when exception are thrown from wiretap routes then error handling do not run for these exceptions. When we change calls to direct "to()" calls then we have proper error handling. WireTap as per my understanding should also use same ErrorHandlerBuilder that is working for other routes in same RouteBuilder class.
We have our ErrorHandlerBuilder, that is configured per camel context as (in OSGI blueprints)
<camelContext id="ourHandlerContext" trace="false" errorHandlerRef="ourErrorHandlerBuilder"
xmlns="http://camel.apache.org/schema/blueprint">
<routeBuilder ref="ourHandlerRouteBuilder"/>
</camelContext>
But our camel routes are in Java ourHandlerRouteBuilder class configure() method have something like this:
from("direct-vm:start").routeId("start")
.wireTap("direct-vm:wiretap_exception")
.to("direct-vm:endroute_last");
from("direct-vm:wiretap_exception").routeId("wiretap_exception")
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
throw new Exception("I AM EXCEPTION");
}
})
;
from("direct-vm:endroute_last").routeId("endroute_last")
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
throw new Exception("I AM ALSO EXCEPTION");
}
})
;
The "I AM EXCEPTION" never caught alone when thrown but when i throw also "I AM ALSO EXCEPTION" then i can see it in ErrorHandler.
We have our some complex translators over these exceptions to translate to some http error code that i think not necessary here to share.
But from above scenario if some body can share his thoughts will be helping.