On 11 September 2012 22:17, Mitko Kolev wrote:Hi,
the "global" scope mentioned here
http://camel.apache.org/exception-clause.html in this case actually means
"route builder" scope.
For example the rule for ValidationException will trigger for both routes
in the same route builder (at least with the Camel version 2.6.x with which
I did the test to find this out some months ago)
configure(){
...
onException(ValidationException.class).
to("activemq:validationFailed");
from("seda:inputA").
to("validation:foo/bar.xsd", "activemq:someQueue");
from("seda:inputB").to("direct:foo").
to("rnc:mySchema.rnc", "activemq:anotherQueue");
}
However, if you split this in 2 route builders like this
configure(){
...
onException(ValidationException.class).
to("activemq:validationFailed");
from("seda:inputB").to("direct:foo").
to("rnc:mySchema.rnc", "activemq:anotherQueue");
}
&
configure(){
...
from("seda:inputB").to("direct:foo").
to("rnc:mySchema.rnc", "activemq:anotherQueue");
}
the onException will not process ValidationExceptions from the second route
("seda:inputB"). In this sense the onException clause is not context
scoped, but rather route builder scoped.
I guess the confusion comes from the Sping DSL format, as the onException
clause is within the camelContext tag, so you might think the onException
definition is "camel context" scoped (configuration of the camel context).
Regards,
Mitko
On Tue, Sep 11, 2012 at 6:14 PM, Andreas Jacobsen <
andreas@andreasjacobsen.com> wrote:
My understanding is that exception policies defined in global scope
are actually global. You could set up a seperate routebuilder
specifically for the global exception policies.
Claus's suggestion works too, since the same exception policies will
be created several times.
On 11 September 2012 16:26, vishal1981 <
vishal.changrani@ericsson.com>
wrote: