Hi,
I have a camel route which reads xml messages from a jms queue, performs a
series of steps (decrypts, transforms, enriches, etc.) to the message and
then finally persists the updated object to a database. What I'm trying to
do now is configure a dead letter queue which will route the */original/*
message recieved from the jms endpoint (which is the xml message) to an
error queue, but having some difficulty accomplishing this in my route.
I'm using camel 2.8 and here is my context:
<camel:camelContext id="globalCamelContext" errorHandlerRef="defaultEH">
<camel:errorHandler id="defaultEH" />
<camel:errorHandler id="deadLetterEH" type="DeadLetterChannel"
deadLetterUri="direct:dealLetterChannel"
useOriginalMessage="true" />
<camel:endpoint id="jmsMQReceiverEndPoint"
uri="jms:queue:receiver?testConnectionOnStartup=true&disableReplyTo=true&exchangePattern=InOnly"
/>
<camel:endpoint id="jmsMQErrorEndPoint"
uri="jms:queue:$error?testConnectionOnStartup=true&disableReplyTo=true"
/>
<camel:route id="messageRoute" errorHandlerRef="deadLetterEH" >
<camel:from ref="jmsMQReceiverEndPoint" />
<camel:log message="Request message came ${id} ${body}" />
<camel:to uri="bean:Marshaller?method=processPayload" />
<camel:to uri="bean:Converter?method=processPayload" />
<camel:to uri="bean:Enricher?method=processPayload" />
<camel:to uri="bean:Persister?method=processPayload" />
</camel:route>
<camel:route id="deadLetterRoute" >
<camel:from uri="direct:dealLetterChannel" />
<camel:log message="Message in error: ${id} ${body}" />
<camel:to ref="jmsMQErrorEndPoint" />
</camel:route>
</camel:camelContext>
Let's say an exception occurs at the Persister step, what ends up happening
is the POJO that was passed in to the Persister step is picked up by the
deadLetterHandler instead of the xml message which I want. How can I
configure my route to pass the original xml message received from the jms
end point to the deadletterhandler when exceptions occur? Based on what
I've read in the CamelInAction Book (chapter 5), Wiki page
(DeadLetterChannel & Error Handling section) & on this site; it would seem
all I needed to do was set useOriginalMessage to true, but that didn't
work...any help would be appreciated.
--
View this message in context:
http://camel.465427.n5.nabble.com/DeadLetterChannel-useOriginalMessage-Behaviour-tp4728373p4728373.html
Sent from the Camel - Users mailing list archive at Nabble.com.