Aggregator and Persistent MessageStore
Warning, I am a Spring Integration Newbie, . . .
I am trying to accomplish something very similar to this thread post using a Persistent Memory Store
http://forum.springsource.org/showth...t=messageStore
I am a little confused as to the when the message store is written to.
I have setup a case where I have hard coded the correlation strategy to always return "100" and the release strategy to always be false. I expected to see an entry in the database. But nothing shows up.
So I would like to request some help understanding when the messages are saved to the persistent message store.
Code:
<aggregator id="poslogAggregator"
input-channel="aggregatorChannel"
output-channel="foutputChannel"
ref="aggregatorBean" method="add"
send-partial-result-on-expiry="false"
message-store="persistentMessageStore"
correlation-strategy="aggregatorBean"
correlation-strategy-method="correlate"
release-strategy="aggregatorBean"
release-strategy-method="canRelease"
/>
<beans:bean id="dataSource" class="org.apache.tomcat.dbcp.dbcp.BasicDataSource" destroy-method="close">
<beans:property name="driverClassName" value="${jdbc.driverClassName}"/>
<beans:property name="url" value="${jdbc.url}"/>
<beans:property name="username" value="${jdbc.username}"/>
<beans:property name="password" value="${jdbc.password}"/>
</beans:bean>
<jdbc:message-store id="persistentMessageStore" data-source="dataSource"/>
-------
public boolean canRelease(List<List<String>> records) {
System.out.println("In canRelease: "+records.size());
System.out.println("records "+records.get(0));
boolean release = false;
if (records.size() >= 2) {
release = true;
}
System.out.println("release "+release);
return release;
}
public String correlate(List<List<String>> records) {
System.out.println("In corelate "+records);
return "101";
}
Any insights are appreciated.
Jim