Announcement Announcement Module
Collapse
No announcement yet.
errorChannel / poller / subscribable channels Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • errorChannel / poller / subscribable channels

    Hello,
    i am reading docs regarding error handling.
    According to docs
    The most important thing to understand here is that the messaging-based error handling will only apply to Exceptions that are thrown by a Spring Integration task that is executing within a TaskExecutor. This does not apply to Exceptions thrown by a handler that is operating within the same thread as the sender (e.g. through a DirectChannel as described above).
    I have a TaskExecutor configured for one of my channels (a NON Subscribable channel)

    From docs, it looks like a subscribable channel cannot have associated a TaskExecutor, but it can only use a handler. therefore, according to docs, any exception raised from a subscriber of a subscribable channel wont end up in errorChannel.

    Is it possible then to use an error Channel along with a subscribable channel?
    if so, how?

    thanks and regards
    marco

  • #2
    A <channel/> element with a <dispatcher/> sub-element may have a "task-executor" reference (as an attribute of that 'diapatcher' element). The part of the documentation that you quoted is applicable to a simple <channel/> without any such sub-element.

    Comment


    • #3
      Mark,

      thanks for the reply

      Still, a subscribable channel can only have handlers (according to reference docs).. therefore i will never be able to post error messages on an error channel whenever i have errors
      in one of the handlers associated witha subscribable channel...

      Or is it so that subscribers of a subscribable channel always execute int heir ownt hread?

      regards
      marco

      Comment


      • #4
        Mark,
        ignore my latest reply...
        i read docs and saw that you can associate a task executor to a subscribable channel
        Code:
        <si:publish-subscribe-channel id="subscribableChannel" task-executor="pool"/>
        One question about task executor.

        Can i configure a global task executor tha ti cann associate to all channel, or is it recommended that each channel has its own task executor?

        regards
        marco

        Comment


        • #5
          Well, you can reference the same TaskExecutor instance from within multiple occurrences of the "task-executor" attribute, but since dispatching channels (publish-subscribe and simple <channel/> elements without a queue) do not have a TaskExecutor by default, there is not a way to set one that would always be used. The general recommendation is to not break thread boundaries unless necessary (where asynch is worth the tradeoffs such as loss of transactional context), and that is why we require the explicit configuration of a TaskExecutor reference.

          Comment

          Working...
          X