Reputation: 167
In a previous spring integration application, I was able to subscribe to the application errorChannel
and my failed messages, sent out-bound, would end up in my (pre-defined) handler.
However, now I am attempting to implement the same pattern, in a larger application, that has a pre-existing in-bound setup and I am no longer able to be pick up on the errorChannel.
Most alarming to me, is a reference to:
<int:publish-subscribe-channel id="errorChannel" task-executor="errorChannelExecutor"/>
When I start up this application, with my inclusion, I no longer see the following reassuring messages:
No bean named 'errorChannel' has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
Adding {logging-channel-adapter:o.s.i.errorLogger} as a subscriber to the 'errorChannel' channel
Channel'o.s.c.s.C.errorChannel' has 2 subscriber(s).
int:publish-subscribe-channel
is overriding
my access to the application errorChannel?Upvotes: 0
Views: 8115
Reputation: 174799
When using async task executors, exceptions caught by the executor are sent to a channel called errorChannel
by default.
If you define such a channel, it overrides the default which would otherwise be created by the framework (and the logging adapter that is subscribed to it, is not subscribed; you have to do that if you define your own channel).
For inbound channel adapters/gateways that are message-driven (e.g. http, amqp etc), where do don't have a downstream async executor, you have to explicitly set the error-channel
property if you want exceptions to go there.
Upvotes: 4