26.5.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 でメソッドを呼び出すか、カスタムプロセッサーを使用することができます。