Spring Integration
  1. Spring Integration
  2. INT-440

Exceptions thrown by a consumer polled by a task executor thread do not result in error messages on the errorChannel

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0 M6
    • Fix Version/s: 1.0 Final
    • Component/s: None
    • Labels:
      None

      Description

      This was reported here and I have been able to reproduce. http://forum.springframework.org/showthread.php?t=61939

      There is no attempt to handle exceptions thrown in runnables passed to the task executor in AbstractPollingEndpoint.

      So the following works ok with exceptions appearing on the errorChannel

      <si:channel id="channelOne">
      <si:queue capacity="10"/>
      </si:channel>

      <si:service-activator ref="consumerOne" input-channel="channelOne" >
      <si:poller>
      <si:interval-trigger interval="500" />
      </si:poller>
      </si:service-activator>
      <bean id="consumerOne" class="ErrorThrowingConsumer"/>

      But the following configuration results in no errors on the errorChannel

      <si:channel id="channelOne">
      <si:queue capacity="10"/>
      </si:channel>

      <si:service-activator ref="consumerOne" input-channel="channelOne" >
      <si:poller task-executor="poolOne">
      <si:interval-trigger interval="500" />
      </si:poller>
      </si:service-activator>
      <bean id="consumerOne" class="ErrorThrowingConsumer"/>

      <si:thread-pool-task-executor id="poolOne" max-size="10" />

        Activity

        Hide
        Mark Fisher added a comment -

        The problem here is that the task submitted to the TaskExecutor is not wrapped in an exception handling runnable as it is when run directly by the SimpleTaskScheduler.

        Show
        Mark Fisher added a comment - The problem here is that the task submitted to the TaskExecutor is not wrapped in an exception handling runnable as it is when run directly by the SimpleTaskScheduler.
        Hide
        Jonas Partner added a comment -

        Fixed for classes extending AbstractPollingEndpoint however issue still exists where the PublishSubscribeChannel has a task executor.

        Show
        Jonas Partner added a comment - Fixed for classes extending AbstractPollingEndpoint however issue still exists where the PublishSubscribeChannel has a task executor.
        Hide
        Mark Fisher added a comment -

        Fixed for PublishSubscribeChannel.

        See commit log for detalis: https://fisheye.springframework.org/changelog/spring-integration?cs=1716

        Show
        Mark Fisher added a comment - Fixed for PublishSubscribeChannel. See commit log for detalis: https://fisheye.springframework.org/changelog/spring-integration?cs=1716

          People

          • Assignee:
            Mark Fisher
            Reporter:
            Jonas Partner
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 0.25d
              0.25d
              Remaining:
              Remaining Estimate - 0d
              0d
              Logged:
              Time Spent - 0.25d
              0.25d