Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

onException is ignored

$
0
0
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

Viewing all articles
Browse latest Browse all 5648

Trending Articles