I\'m new to spring integration and am confused about how to send error messages to a designated error queue. I want the error message to be a header on the original message and
When the exception is thrown, it is wrapped together with the requestMessage
to the MessagingException
. Your own business exception is in the cause
and you can get access to the requestMessage
from the MessagingException.failedMessage
property.
So, it looks like you have everything you need for your use-case.
Only the problem that before sending to the error-exchange
you really should have some
in the error flow to properly convert that MessagingException
to the proper message to send to the AMQP.