I am using mongodb-queue
to send the messages. To handle the errors, I'm using the separate channel which send the exceptions. When sending the exceptions, I need to retrieve the POJO.
Please let me know if you have any idea on how to do so.
You generally shouldn't be messing with the error-channel
header with a header enricher - that is rarely needed; set an error-channel
on the inbound endpoint. The message in the error channel will be an ErrorMessage
with failedMessage
and cause
properties. The failedMessage
is the message at the point of failure.