I just saw the org.slf4j.helpers.MarkerIgnoringBase is use to write the warning
and error message. I guess it may relate to your log configuration.
--
Willem Jiang
Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter:
Mea culpa. Who knew AccountNumberFoundException was part of
javax.security..! Fixed the import, the onException now executes.
However, the .log line:
.log(LoggingLevel.ERROR, com.foo.server.ngw, Account Not
Found. Message discarded.).stop();
Actually writes the line:
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
Hi
No the onException should be triggered even for TX.
You may try to configure onException after errorHandler.
On Mon, Jan 12, 2015 at 11:02 AM, James Green james.mk.gr...@gmail.com wrote:
So when using onException it's really important not to use a component that
is already partaking in
As suggested:
errorHandler(transactionErrorHandler().maximumRedeliveries(3));
onException(AccountNotFoundException.class)
.log(LoggingLevel.ERROR, com.foo.server.ngw, Account Not
Found. Message discarded.).stop();
from(source())
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
Since you use transactions then sending a message to a JMS queue is
also rolled back, and hence the onException appears to not send the
message to the account not found queue. But its because the tx is
rolled back.
You can define a 2nd jms component, eg using a different name than
jms, that does
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();
Here is me with more questions/bug report.
I've noticed that Camel can be very sensitive on order operators are
invoked in route builder.
For example, transacted() has to be after onException(). Otherwise,
onException() is completely ignored and message will just pass through
error handling code
can be very sensitive on order operators are
invoked in route builder.
For example, transacted() has to be after onException(). Otherwise,
onException() is completely ignored and message will just pass through
error handling code like it's the part of regular route. See example:
// Fails
from
10 matches
Mail list logo