Hi

Yeah that is intended as when an exception occurs the exchange does
not include any partial changes/updates that may have happened.
Camel does a defensive copy of the information from the message in its
error handler.



On Mon, Jan 20, 2014 at 12:41 PM, Lorenzo Bolzani <l.bolz...@gmail.com> wrote:
> 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



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Reply via email to