Results 1 to 3 of 3

Thread: inherent flaw in the inbound-to-outbound channel configuration

  1. #1
    Join Date
    Aug 2011
    Posts
    28

    Default inherent flaw in the inbound-to-outbound channel configuration

    Consider the following spring integration's XML configuration snippet:

    <int:inbound-channel-adapter id="inboundChannel" ref="myService" method="myProducerMethod">
    <intoller max-messages-per-poll="1" fixed-delay="200"/>
    </int:inbound-channel-adapter>
    <int:outbound-channel-adapter channel="outboundChannel" ref="myService" method="myConsumerMethod"/>


    This works fine, but when application context shuts down the following may occur:
    1) Poller within the 'inboundChannel' bean fetches message payload and prepares it for dispatch
    2) spring context's shutdown handler disposes 'outboundChannel' bean
    3) The spring integration' unicast dispatcher tries to deliver the message prepared at (1) and being unable to do so raises the following exception:

    org.springframework.integration.MessageDeliveryExc eption: Dispatcher has no subscribers.
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.doDispatch(UnicastingDispatcher.java :108)
    at org.springframework.integration.dispatcher.Unicast ingDispatcher.dispatch(UnicastingDispatcher.java:1 01)
    ... (omitted for clarity).


    Please, tell me whether this behavior is WAD or not and if it is I'll raise the appropriate issue with the reproducible sample attached.

    P.S.: I've found that the mentioned exception may be suppressed by adding error-channel="nullChannel" attribute to the poller within the inbound-channel-adapter but I don't like this workaround as error suppression looks completely flawed.
    Last edited by alex.j; Apr 18th, 2012 at 07:22 AM.

  2. #2
    Join Date
    Mar 2010
    Location
    Gtr Philadelphia, PA
    Posts
    2,021

    Default

    Please see this Pull Request https://github.com/SpringSource/spri...ation/pull/403 and its associated JIRA issue.

    We have added a method to the IntegrationMBeanExporter that shuts down the schedulers and executors first, in an orderly fashion, allowing any in-flight messages to complete (up to a timeout).

    It should solve your problem. It should make it into the upcoming 2.2 milestone 1 release.
    Gary P. Russell
    Spring Integration Team
    SpringSource, a division of VMware

  3. #3
    Join Date
    Aug 2011
    Posts
    28

    Default

    Quote Originally Posted by Gary Russell View Post
    Please see this Pull Request https://github.com/SpringSource/spri...ation/pull/403 and its associated JIRA issue.

    We have added a method to the IntegrationMBeanExporter that shuts down the schedulers and executors first, in an orderly fashion, allowing any in-flight messages to complete (up to a timeout).

    It should solve your problem. It should make it into the upcoming 2.2 milestone 1 release.
    I'll check this, thank you.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •