以下のようなデッドレターチャネルエラーハンドラを作成しています
errorHandler(deadLetterChannel("direct:myDLC").useOriginalMessage().maximumRedeliveries(1));
from("direct:myDLC")
.bean(MyErrorProcessor.class);
Bean MyErrorProcessor は、以下のようなすべてのタイプのチェック済みおよび未チェックの例外を処理できる必要があります。
public void process(Exchange exchange) throws Exception {
Exception e=(Exception)exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class);
e.printStackTrace();
if(e instanceof MyUncheckedException){
logger.error("MyUncheckedException: "+((MyException) e).getErrorCode()+" : "+((MyException) e).getErrorDesc());
}else if(e instanceof MyException){
logger.error("MyException: "+((MyException) e).getErrorCode()+" : "+((MyException) e).getErrorDesc());
}
}
しかし、例外が処理された後、元のメッセージはルートのエンドポイントにリダイレクトされる必要があります..このように例外が処理されたら、ルートを続行するには??