camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CAMEL-2102) Transacted routes don't allow custom error handlers to mark exception as handled AND set rollback only
Date Fri, 23 Oct 2009 07:43:54 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-2102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=54936#action_54936
] 

Claus Ibsen commented on CAMEL-2102:
------------------------------------

Cool

It would be great if you could also create an unit test that tests this patch.

> Transacted routes don't allow custom error handlers to mark exception as handled AND
set rollback only
> ------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2102
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2102
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-spring
>    Affects Versions: 2.0.0
>         Environment: All platforms
>            Reporter: Dhiraj Bokde
>         Attachments: camel-spring-patch.txt
>
>
> If a route is transacted using transacted(), and a custom error handler is registered
using onException() which handles the exception using handled(), creates a custom error response,
and marks the transaction to be rolled back using rollback(), Camel wraps a non-existent 'null'
exception with a TransactedRuntimeCamelException in TransactionErrorHandler.wrapTransactedRuntimeException()
and throws the TRCE, causing the custom error response to be ignored. 
> Route looks like:
> 		// configure error handler for all routes
> 		onException(Exception.class).handled(true).to("bean:transformerBean?method=exceptionToResponse").rollback();
> 		from("cxfrs://bean:categoriesEndpoint").transacted()
> 			.choice()...
> Basically the application wants to handle exceptions by sending a custom error message
back to the route client, and also mark transactions for rollback. 
> Attached patch checks for the presence of an exception, and only raises a TRCE if its
not null. 

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


Mime
View raw message