Announcement Announcement Module
Collapse
No announcement yet.
Spring-Integration 2.0.5 integration:chain & poller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring-Integration 2.0.5 integration:chain & poller

    Hi All,

    can we configure integration chain with poller so that it will behave like Thread's wait(nanosecond) method
    i.e if no messages are there in input queuechannel it will poller will sleep ,if any messages in queue channel before the sleep timeout ,the poller will wake up polls the messages from the input channel

    please find the configuration below

    <integration:channel id="s1.channel">
    <integration:queue capacity="10000" />
    </integration:channel?

    <integration:chain id="s1.chain" input-channel="s1.channel"
    output-channel="s1.inChannel"
    send-timeout="${s1.poller.send-timeout}">
    <integration:header-enricher>
    <integration:error-channel ref="exception.channel"/>
    <integration:header name="Subscriber" value="${s1.dn}" />
    <integration:header name="Fault_Subscriber" value="${s1.fault.dn}" />
    <integration:header name="Destination" value="${s1.destination}" />
    </integration:header-enricher>
    <integrationoller receive-timeout="30000"
    fixed-rate="10" time-unit="MILLISECONDS"/>
    </integration:chain>
    the problem is that any messages which comes after poller in sleep state wiil be pending in inputChannel till the poller timeout is happeen,
    my requirement is message should be picked by the poller as soon as it comes to the inputChannel

    i can reduce the the receive-timeout to 10 but it mekes unnecessary check to the inputChannel even though no messages are the inputChannel

    in this senario can i tweak the poller like a messageListner i.e consume messages as and when it comes to the inputChannel

    Any suggestion

    Thanks in Advance
    Srinibas

  • #2
    I am confused a little

    If you are using poller you can obviously tune it up to have short fixed-rate, but the nature of the poller states that the Messages will be polled *only* when poller runs.
    What you are asking is event-based message dispatching and for that you use DirectChannel and its variants, but I am sure you realize that, so what I am trying to understand is the use case you have so may be you can describe the overall goal and we'll see what solution fits best.

    Comment


    • #3
      thanks oleg for quick reply,

      my requirement is :as mentioned above config chain,messages should be picked by the poller as and when messages comes to inputChannel

      options: 1.use direct channel instead of queue-channel for the inputChannel
      options: 2 need to tweak the receive-timeout to 10 millis
      i picked option 2 ,problem is the poller is contiguously pinging even though no messages are there in the inputChannel as we don't know at what rate messages are coming to inputQueueChannel(s1.channel).
      if we can configure a message listener instead of poller ,it will pick the messages as and when they arrived.

      is that possible?
      if no is that advisable to set receive-timeout=10 millis in a poller with fixed-rate="10" i.e the poller never sleeps it is contiguously pinging even though messages are not there?
      is there any performance impact?

      Thanks in advance
      Srinibas

      Comment


      • #4
        i can't go with option 1(one) because,we have single thread through out the application form picking the messages form publisher's queue and putting the messages on subscriber's queue the message will be traverse through router ,filter ,transformation,validator,interceptor etc on that single thread.
        that is why we added a queue-channel so that the publisher's thread will end once the message is dropped in the QueueChannel (s1.channel)

        Thanks
        Srinibas

        Comment


        • #5
          You can use ExecutorChannel to achieve multi-threaded processing

          Something like this:

          Code:
          <int:channel id="someChannel">
                <int:dispatcher task-executor="executor"/>
          </int:channel>
          
          <task:executor id="executor" pool-size="10"/>

          Comment


          • #6
            we don't want multi-threaded processing

            can we configure a message listener instead of poller ,it will pick the messages as and when they arrived.
            is that possible?

            if no is that advisable to set receive-timeout=10 millis in a poller with fixed-rate="10" i.e the poller never sleeps it is contiguously pinging even though messages are not there?
            is there any performance impact?

            any suggestions on this?

            Thanks in Advance?
            srinibas

            Comment

            Working...
            X