Hi,
I have a custom camel component (a producer) that works like this

try {
   doSomething();
   exchange.getIn().setHeader("result", "123");
} catch(...) {
    exchange.getIn().setHeader("problem", "this");
    throw new SomeException(...);
}

Now in my route I never see the "problem" header when something goes wrong.
Is this expected?

I'd like to use an exception because in this way I can handle error in the
route in a clean way.

I could use a custom exception with a "problem" field and add a specific
onException block to catch this exception and copy the value to an header
but this means to complicate a lot all the routes.

How can I solve this?


Thanks in advance, bye

Lorenzo

Reply via email to