Results 1 to 2 of 2

Thread: Aggregator and Persistent MessageStore

  1. #1
    Join Date
    May 2011
    Posts
    10

    Default 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

  2. #2
    Join Date
    May 2011
    Posts
    10

    Default

    Reading more stuff in the forum, . . . . Found out that I may be getting caught up in some aggregator bugs: https://jira.springsource.org/browse/INT-2009 to https://jira.springsource.org/browse/INT-2014

    I found that my messages instead of going to the MessageStore were hitting the discardChannel

    Found it by adding the following


    Code:
    	<aggregator id="poslogAggregator" 
    	    input-channel="aggregatorChannel"
    		output-channel="foutputChannel" 
    		discard-channel="discardChannelLogger"
    ...
    
    	<logging-channel-adapter id="discardChannelLogger" 
    	    expression="'#### DiscardChannelLogger: ' + #this"
    	   />

Tags for this Thread

Posting Permissions

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