Dec 13th, 2010, 11:18 AM
Passing Messages to errorChannel
I'm trying to understand how to route messages to an error channel within single thread processing (i.e. all DirectChannels). I am not using a TaskExecutor, and my workflow is starting with the <xmpp-inbound-message-adapter>. From here, I'm passing the message onto transformers, header enrichers, service activators, filters, etc.
My desire is to re-route the messages to an error channel anytime exceptions occur, but I'm having problems understanding how to do this.
For example, the first step after receiving an XMPP message is to send the message to a transformer. This transformer has it's normal inbound/outbound channels defined via XML. However, if something goes wrong with the transformation, I'd like to re-route the message to the global errorChannel. I tried doing this by setting the MessageHeaders.REPLY_CHANNEL to "errorChannel". I also tried setting the MessageHeaders.ERROR_CHANNEL to "errorChannel" as well with no luck. Creating and throwing an exception doesn't allow for the message to end up in the errorChannel either. In all cases (except for when the exception was thrown) it seems the transformer continues to forward the message onto it's pre-configured outbound channel.
How do I get messages into the error channel?
Dec 13th, 2010, 01:42 PM
Unfortunately it was not possible at the time when you posted this message, however we do agree that such functionality must be provided especially since it is supported with other inbound adapters.
This resulted in https://jira.springframework.org/browse/INT-1682 which is about to be resolved and should be available in tonight's nightly build and in the Spring Integration 2.0.1 release which should come out shortly.
Thank you for reporting it.
Dec 13th, 2010, 02:50 PM
Thanks for resolving this issue so quickly.