camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Green <james.mk.gr...@gmail.com>
Subject Re: onException is ignored
Date Mon, 12 Jan 2015 10:02:47 GMT
So when using onException it's really important not to use a component that
is already partaking in the transaction being rolled back? I get that now,
but it's not immediately obvious.

Does this explain why the log()ged message, "Account Not Found. Message
discarded." does not appear in the console though?

On 10 January 2015 at 07:23, Willem Jiang <willem.jiang@gmail.com> wrote:

> 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message