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:

  1. 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>     ... 
  1. 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

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -