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?