camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: onException is ignored
Date Sat, 10 Jan 2015 07:23:23 GMT
If the Exception is thrown from the source() endpoint, the onException error handler won’t
work as you expected.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On January 10, 2015 at 1:38:52 AM, James Green (james.mk.green@gmail.com) wrote:
> Project is Spring based with Camel 2.14 and the following configuration:
>  
> onException(AccountNotFoundException.class)
> .log("Account Not Found. Message
> discarded.").to("jms:queue:RouterAccountNotFound").stop();
>  
> errorHandler(transactionErrorHandler().maximumRedeliveries(3));
>  
> from(source())
> .transacted()
> .unmarshal(jacksonUnmarshall)
> .process(router)
> .recipientList(simple("${body.media}"));
>  
> We have a JMS connection and a JPA connection wrapped in a Atomikos
> transaction manager (a XA transaction manager I understand to be required).
> The above errorHandler triggers if the router throws an Exception, but the
> onException statement does not fire despite the logs recording the
> AccountNotFoundException being caught by Camel.
>  
> Consequently the log()ing and the RouterAccountNotFound queue do not fire
> at all.
>  
> The documentation suggests onException should be usable at this point. Can
> anyone suggest why the above only partly works?
>  
> Thanks,
>  
> James
>  


Mime
View raw message