169.18.7. JMS を Dead Letter Channel として使用するエラーのみを保存する
JMS を使用して原因のエラーメッセージを保存するか、または自分で初期化できるカスタムボディーを保存できます。以下の例では、Message Translator EIP を使用して、JMS のデッドレターキューに移動する前に、失敗したエクスチェンジで変換を行います。
// we sent it to a seda dead queue first
errorHandler(deadLetterChannel("seda:dead"));
// and on the seda dead queue we can do the custom transformation before its sent to the JMS queue
from("seda:dead").transform(exceptionMessage()).to("jms:queue:dead");
ここでは、元の原因エラーメッセージのみを変換に保存します。ただし、任意の式を使用して任意の式を送信できます。たとえば、Bean でメソッドを呼び出すか、カスタムプロセッサーを使用できます。