camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roman Kalukiewicz <>
Subject Where exception handling should set a handled exception?
Date Wed, 25 Feb 2009 11:10:29 GMT

Recently I created an issue (CAMEL-1356) about exception handling and
now I'm not really sure if it is really a bug or not. So I'm asking
for your opinions.

The problem is that when exception is caught it is set as a
'caught.exception' header on IN message. It means that if an exception
is thrown on an exchange that already has OUT message it will be lost
after the first step of a pipeline.

We have few possible solutions here:
1) Keep it as it is - then we know where to look for this header in
the first step of the pipeline - we can also use bean integration and
@Header annotation to retrieve it)
2) Put the exception to header on OUT message if it is present - then
it will be preserved in the pipeline. But then first step of the
pipeline has to be clever - it has to look for it in OUT message.
Moreover it is more general problem - if we allow OUT messages there,
then you cannot use for example setHeader("foo") (you can, but it is
useless, as out is propagated anyway)
3) Put it into exchange property - maybe the best solution as it is
propagated, and we always know where to look for the exception. It
will not be lost at some endpoint also.

I believe this change should by put to 2.0 only as it might break
someones exception handling completely, shouldn't it?

This time I don't want to start flame about need for in/out messages
once again, but... ;)


View raw message