Hi Saral,
You can configure it via the correlation-strategy-expression attribute (correlation logic via a SpEL expression) instead of correlation-strategy attribute. Something like (example taken from reference manual)
Code:
correlation-strategy-expression="payload.person.id"
Similarly for ReleaseStrategy
Code:
release-strategy-expression="payload.size() gt 5"
Here you don't have to write beans, you can use SpEL to define your correlation and release strategy
Other thing that I observe is that with MessageGroupStoreReaper we can use MethodInvokingReleaseStrategy instead of TimeoutCountSequenceSizeReleaseStrategy. Write a bean and method that always return false. (I want all the messages to be released / expired at fixed interval)
Code:
<bean id="myReleaseStrategy" class="com.test.MyReleaseStrategy" />
<bean id="releaseStrategy"
class="org.springframework.integration.aggregator.MethodInvokingReleaseStrategy">
<constructor-arg name="object" ref="myReleaseStrategy" />
<constructor-arg name="methodName" value="canRelease" />
</bean>
Code:
public class MyReleaseStrategy {
public boolean canRelease() {
System.out.println("MyReleaseStrategy.canRelease called .....");
return false;
}
}
Regards,
Pranav