Unbalanced API in the Java DSL for the scoped onException()
-----------------------------------------------------------

                 Key: CAMEL-3061
                 URL: https://issues.apache.org/activemq/browse/CAMEL-3061
             Project: Apache Camel
          Issue Type: Improvement
    Affects Versions: 2.4.0
         Environment: All
            Reporter: Christian Mueller
            Assignee: Christian Mueller
             Fix For: 2.5.0


It's not possible to write the following route:

{code}
from("direct:saveOrderInDB")
.transacted("PROPAGATION_REQUIRES_NEW")
.onException(UpdateException.class, InsertException.class)
.markRollbackOnlyLast().end()
.beanRef("orderDAO", "updateOrInsertOrder");
{code}

You have to specify the route in the following way:

{code}
from("direct:saveOrderInDB")
.transacted("PROPAGATION_REQUIRES_NEW")
.onException(InsertException.class)
.onException(UpdateException.class)
.markRollbackOnlyLast().end()
.beanRef("orderDAO", "updateOrInsertOrder");
{code}

But if you use a global onException() definition, you can write:

{code}
.onException(UpdateException.class, InsertException.class)
.markRollbackOnlyLast()
...
{code}

Should we add this missing method?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to