java - Apache Camel, routes added don't throw OnException -
i writing camel , spring world!
i adding routes programmatically using recipe.
basically camel context , add routes using file.
this issue:
routes added @ runtime don't trigger onexception
, set on context file read spring.
to recap:
- i have spring context file looks like:
<camel:camelcontext> <onexception id="exceptions"> <handled> <constant>true</constant> </handled> <process ref="logexceptionprocessor"/> <to uri="activemq:adapterlog"/> <process ref="mailsender"/> </onexception> ...
- after i've added route getting camel context, added route doesn't throw
onexception
set.
do have advice on behavior?
there 2 different scopes error handlers can use. first route level error handler manage error handling route , second global error handling in context. if want few more details go "scopes" section in documentation.
http://camel.apache.org/error-handler.html
for use case when loading in routes won't able leverage global error handler because route definition created separate context , added @ runtime. meaning need have error handling defined every route load separately. note: not mean can't create own common error handling policy , have each of routes reference that.
Comments
Post a Comment