Hi,
I have configured a producer and a consumer. Producer is sending messages every 3rd second. There is a Aggregator configured that has release-strategy="timeout" and timeout set as 7 seconds. Now I see the messages are aggregated and sent to output channel at 9th seconds (as soon as 3rd message is received), though it should timeout at 7th second and should aggregate only 2 messages.
I am using org.springframework.integration.aggregator.Timeout CountSequenceSizeReleaseStrategy and I have seen the code, canRelease (..) will be called on every message received in the input-channel and will return true only after receiving 3rd message
Is there a way to achieve timeout as defined i.e. 7 second and only aggregate the messages in the queue till that time?
Context.xml
Regards,Code:<task:scheduled-tasks scheduler="taskScheduler"> <task:scheduled ref="producer" method="run" fixed-rate="3000" /> </task:scheduled-tasks> <bean id="timeout" class="org.springframework.integration.aggregator.TimeoutCountSequenceSizeReleaseStrategy"> <constructor-arg name="threshold" value="1000" /> <constructor-arg name="timeout" value="7000" /> </bean> <bean id="correlationStrategy" class="com.test.MyCorrelationStrategy" /> <int:aggregator input-channel="channel_one" output-channel="channel_two" release-strategy="timeout" correlation-strategy="correlationStrategy" method="aggregate"> <bean class="com.test.MyAggreegator" /> </int:aggregator>
Pranav


Reply With Quote

