Announcement Announcement Module
Collapse
No announcement yet.
Aggregator Example Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Aggregator Example

    hi,

    Can any one please provide me with a simple aggregator with send timeout example.
    My aggregator works fine but it is not getting timedout.

    Say if i send a message with sequence size 4 but send only 3 messages.It should get timeout after 30 secs.But it hangs and doesnot send the messages into the discard channel.

    Please help

  • #2
    There is an issue that one of the developers here noticed is that the timeout only works when the next message is received. The logic that checks if the a release condition is met only happens on message receipt so if it never receives another message it will never release because of a time out.

    Comment


    • #3
      Right. The only way to have a timeout that is not triggered by a Message being received is to have a scheduled background thread. We actually provide the MessageGroupStoreReaper as a Runnable for that very purpose. Will that meet your use-case requirements?

      Comment


      • #4
        Hi,
        Thanks for your replies.

        I tested the approach suggested by acarbs12
        "There is an issue that one of the developers here noticed is that the timeout only works when the next message is received. The logic that checks if the a release condition is met only happens on message receipt so if it never receives another message it will never release because of a time out. "

        I gave the value of send-timeout as 10000 ie 10 secs.Then i set the sequence size for my messages as 4.But in first iteration i sent only three messages and waited for a minute.Then i send the last message in second iteration after a minute.

        It still gave me the aggregated output and it worked fine.The aggregator didnt timedout even after the reciept of the last message.

        My Configuration is as follows:


        <int-http:inbound-channel-adapter id="smsInboundAdapter"
        channel="smsChannel" name="/smsInboundAdapter.htm" supported-methods="GET" />

        <int:channel id="smsChannel" />

        <int:channel id="aggregationChannel" />

        <int:channel id="errorChannel" />

        <int:channel id="sequencerChannel" />

        <int:transformer id="smsToMessageConverter"
        input-channel="smsChannel" output-channel="sequencerChannel">
        <bean class="sms.communication.SMSToMessageConverter">
        </bean>
        </int:transformer>


        <int:resequencer input-channel="sequencerChannel"
        output-channel="aggregationChannel"/>

        <int:aggregator method="add" input-channel="aggregationChannel"
        output-channel="completeMessageChannel" discard-channel="errorChannel"
        send-timeout="10000" send-partial-result-on-expiry="false">
        <bean class="sms.communication.MessageAggragator" />
        </int:aggregator>

        <int:channel id="completeMessageChannel" />

        <int:service-activator id="gateway"
        input-channel="errorChannel" ref="errorUnWrapper" />

        <int:outbound-channel-adapter ref="messageProcessor"
        channel="completeMessageChannel" />

        <bean id="messageProcessor" class="sms.communication.MessageProcessor" />

        <bean id="errorUnWrapper" class="sms.communication.ErrorUnWrapper" />


        Still the aggregator is not timing out..

        Thanks in advance..
        Last edited by annuk; Jun 6th, 2011, 08:00 AM.

        Comment


        • #5
          I think I have the same problem and i have a used MessageGroupStoreReaper

          Comment

          Working...
          X