我已经定义了一个错误处理程序,它适用于多个路由,即
errorHandler(transactionErrorHandler()
.maximumRedeliveries(5)
.log("SOMETHING USELESS");
from(file1)
.id(route1)
.transacted()
.process(new SpecificProcessor1());
from(file2)
.id(route2)
.transacted()
.process(new SpecificProcessor2());
当特定处理器类之一中发生异常时,将记录以下内容:
[10-Jan-2014 15:08:59.449] [Error] SOMETHING USELESS: Failed delivery for (MessageId: ID-BLAH BLAH). On delivery attempt: 1 caught: java.lang.Exception: cannot do whatever I'm supposed to do
现在我想打印一些有用的东西来帮助确定异常是否发生在 route1 或 route2 中,即:
[10-Jan-2014 15:08:59.449] [Error] ROUTE 1: Failed delivery for (MessageId: ID-BLAH BLAH). On delivery attempt: 1 caught: java.lang.Exception: cannot do whatever I'm supposed to do
我怎样才能做到这一点?
我尝试过 .log(${routeId}) 之类的东西,但它不起作用。
非常感谢!