Announcement Announcement Module
No announcement yet.
when are messages put on errorChannel Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • when are messages put on errorChannel

    I have read through B.4 Error Handling, but is there a bit more detail on when "errors" are put on this channel (under what conditions), it seems a bit vague from what I have read,

  • #2

    The question could not be simple answered because it depends on the components you are using.
    But very simple:
    A message will be normally only put to the default error channel (or a custom error channel) if the message is processed in an asynchronous context in any way (ExecutorChannel, PollableChannel, asynchronous publisher/consumer, ...). Else for synchronous message send you will get the occurred exception direct (you only use DirectChannels, no caching for example in combination with the aggregator and friends, etc.) and nothing will be ever go to the error channel.

    If you must go safe:
    1. Check if the component acts in a synchronous or asynchronous context (javadoc, reference, source code).
    2. For an asynchronous component check the error handling possibilities (javadoc or source code).
    As a first indicator, you can check, if the used spring components have got a errorHandler or errorChannel property, with which the error handling could be customized.