Hi,

I have also woked with the onException clause recently and it worked for me. I used the spring dsl though. It surely would help if you can create a small example project that shows your problem and post it for example to a jira ticket. Once there is some code that can be debugged it is ususally quite easy to find a solution.

Greetings

Christian


DRy schrieb:
Hi,

we use one of the latest 2.1 snapshots (I will have a look at the exact date
tomorrow).

We use the onException-expressions (from the example below) in a
RouteBuilder-class with one defined route. Both onException are placed
before the route definition. So far the scope is global.


DRy


Claus Ibsen-2 wrote:
What version of Camel are you using?

And do you use global or route scoped onException ?

On Thu, Nov 5, 2009 at 3:28 PM, DRy <[email protected]> wrote:
Hi,

if I use two onException expressions in a route definition like this

       onException(UnmarshalException.class)
           .useOriginalBody()
           .handled(true)
               .bean(exceptionLogBean)
               .process(new Publish2CenterExceptionBean())
           .end();

       onException(Exception.class)
           .maximumRedeliveries(-1).redeliveryDelay(1000)
           .useOriginalBody()
           .handled(true)
               .bean(exceptionLogBean)
           .rollback()
           .end();

I got two problems:

1)
The onEception(Exception.class) part is used all the time! Even if an
UnmarshalException (direct hit) is thrown. And no matter if I put
onException(Exception.class)... before
onException(UnmarshalException.class)... ... ?

2)
On the onException(Exception.class) part the bean(exceptionLogBean) is
never
called ... ?

What I try to do is, to handle all "known" exception in seperate
onException(...) parts and install a "last line of defence" with the
onException(Exception.class).


DRy


Reply via email to