Results 1 to 9 of 9

Thread: Aggregation on fixed time interval in 2.0.1.RELASE

  1. #1
    Join Date
    Sep 2010
    Posts
    23

    Default Aggregation on fixed time interval in 2.0.1.RELASE

    Hi All,
    I have aggregated the messages for fixed time interval in 1.0.4.RELEASE and it is working fine.
    Now I am trying to migrate SI version to 2.0.1.RELEASE. I Did the required changes for my aggregator. However it is not working as expected.

    My sample code in 2.0.1.RELEASE is,
    Here my intention is aggregation needs to happen for every 1 sec and it polls for every 3 secs.

    <si:channel id="aggregateOutChannel"/>
    <si:aggregator id="updatesAggregator"
    input-channel="orderRequestChannel"
    output-channel="aggregateOutChannel"
    ref="updatesAggregatorBean"
    method="groupMessages"
    release-strategy="groupReleaseStrategy"
    release-strategy-method="canRelease"
    correlation-strategy="groupCorrelationBean"
    correlation-strategy-method="correlatingMessages"
    send-timeout="1000" send-partial-result-on-expiry="true">
    <si: poller >
    <si:interval-trigger interval="3000"/>
    </si: poller>
    </si:aggregator>
    //Aggregator method
    public List<OrderRequestDTO> groupMessages(List<OrderRequestDTO> orderList) {
    log.info("UpdatesAggregatorBean.groupMessages orderList = "+orderList);
    return orderList;
    }

    //Correlation strategy method
    public Object correlatingMessages(OrderRequestDTO orderList) {
    log.info(orderList+"");
    return "NO_GROUPING";
    }

    //Release strategy method
    //Never release until the timeout
    public boolean canRelease(List<OrderRequestDTO> orderList) {
    return false;
    }

    Can somebody help me on this.

    Thanks in Advance
    Mohan Maligireddy

  2. #2
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    I think you are nearly there. You just seem to have confused message group expiry with send timeout. In fact it looks like you haven't configured an explicit reaper strategy at all, so the only time aggregation will happen is when the application context shuts down. Or maybe I just didn't see the whole picture.

  3. #3
    Join Date
    Sep 2010
    Posts
    23

    Default

    Thanks Dave for your quick reply!!!

    Can you please give one sample to work aggregation with some time interval in 2.0.1.RELEASE?

    Thanks
    Mohan Maligireddy

  4. #4
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    If I understood your question, the example in the manual should work (http://static.springsource.org/sprin...r.html#d4e1454) - it's set to 10 seconds in that case.

  5. #5
    Join Date
    Sep 2010
    Posts
    23

    Default

    No Dave, I require one sample application to aggregate the messages for a fixed time interval in 2.0.1.RELEASE.(Here I want to group all the messages for within the time interval)

  6. #6
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    If you take the code you posted already and add the reaper bean from the link I posted that's what you should get. Did you try it yet?

  7. #7
    Join Date
    Sep 2010
    Posts
    23

    Default

    Thank you Very much Dave!!!

    My aggregator is working fine with reaper bean configuration.

    Thanks
    Mohan Maligireddy

  8. #8

    Default

    Hi Mohan,

    can you please post the configuration current aggregator with reapper

    Thanks
    Srinibas

  9. #9
    Join Date
    Sep 2010
    Posts
    23

    Default

    Hi Srinibas,

    Here is the sample configuration which i did,

    <si:aggregator id="MyAggregator"
    input-channel="RequestChannel"
    output-channel="ResponseChannel"
    ref="groupAggregator"
    method="groupMessages"
    release-strategy="releaseStrategy"
    release-strategy-method="canRelease"
    correlation-strategy="correlationBean"
    correlation-strategy-method="correlatingMessages"
    send-partial-result-on-expiry="true" message-store="myMessageStore">
    <sioller>
    <si:interval-trigger interval="10000"/>
    </sioller>
    </si:aggregator>


    <bean id="myReaper" class="org.springframework.integration.store.Messa geGroupStoreReaper">
    <property name="messageGroupStore" ref="myMessageStore" />
    <property name="timeout" value="1000" />
    </bean>

    <task:scheduler id="myScheduler"/>

    <task:scheduled-tasks scheduler="myScheduler">
    <task:scheduled ref="myReaper" method="run" fixed-rate="10000" />
    </task:scheduled-tasks>

    <bean id="myMessageStore" class="org.springframework.integration.store.Simpl eMessageStore"/>


    Here aggregation will happen for every 10 secs and Reaper timeout is 1 sec.

Posting Permissions

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