複数のルートに適用されるエラーハンドラーを定義しました。
errorHandler(transactionErrorHandler()
.maximumRedeliveries(5)
.log("SOMETHING USELESS");
from(file1)
.id(route1)
.transacted()
.process(new SpecificProcessor1());
from(file2)
.id(route2)
.transacted()
.process(new SpecificProcessor2());
SpecificProcessor クラスのいずれかで例外が発生すると、次のログが記録されます。
[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
ここで、例外がルート 1 またはルート 2 で発生したかどうかを識別するのに役立つ何かを出力したいと思います。
[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}) などを試しましたが、うまくいきません。
どうもありがとう!