178.20.7. 오류만 저장하는 Dead Letter Channel으로 JMS 사용

JMS를 사용하여 원인 오류 메시지를 저장하거나 직접 초기화할 수 있는 사용자 지정 본문을 저장할 수 있습니다. 다음 예제에서는 JMS dead letter 큐로 이동하기 전에 Message Translator EIP를 사용하여 실패한 Exchange에서 변환을 수행합니다.

// 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");

여기서는 원래의 원인 오류 메시지만 변환에 저장합니다. 그러나 표현식을 사용하여 원하는 것을 보낼 수 있습니다. 예를 들어 빈에서 메서드를 호출하거나 사용자 지정 프로세서를 사용할 수 있습니다.