On Thu, Nov 19, 2009 at 8:40 PM, trivedi kumar b
<trivedi.bodlap...@ge.com> wrote:
>
> Hi,
>
> I am using Camel-2.1-SNAPSHOT jars, my router deals with transactions and
> looks like below:
>
> SpringTransactionPolicy required = lookup('REG_PROPAGATION_REQUIRED',
>                    SpringTransactionPolicy.class);
> errorHandler(transactionErrorHandler(required));
>
> from(SERVICE_XDSBREG_END_POINT)
>                .onException(Exception.class)
>                .handled(true)
>                .processRef('processError')
>                .rollback()
>                .end()
>            .processRef('handleRequest')
>            .to("direct:throwException"); //this line throws an exception.
>
>
> As per the Camel 2.0, the exception should be caught and handled at
> onException() block. The code is working fine that during exceptions, it is
> invoking 'processError' in which I am setting custom error response in the
> "out" body. However the client is not getting that, instead getting the
> below error:
>
> org.apache.camel.RollbackExchangeException: Intended rollback on the
> exchange: Exchange[Message:
> org.openehealth.ipf.commons.ihe.xds.core.stub.ebrs30.rs.registryresponset...@14d9794
>
> Could someone help me on this?
>

There is a new markRollbackOnly() you can use instead of rollback().
This one will then NOT throw any exception and you should be able to
return the custom OUT message.


> thanks,
> Trivedi
> --
> View this message in context: 
> http://old.nabble.com/Intended-rollback-on-the-exchange---error-on-transacted-routes-tp26421454p26421454.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Reply via email to