camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gvvenkat <Gvvenkat...@yahoo.com>
Subject Java DSL vs Spring Dsl with Splitter and Aggregator
Date Tue, 05 Feb 2013 22:28:51 GMT
I am trying convert one of the JAVA DSL into Spring DSL. Java DSL reads the
file and applies the processor correctly and finally invokes the aggregator
and writes into the destination location ( also removes from the source
location as required). 

But Below equivalent (in opinion Spring DSL :) ) , does not invoke the
aggregator and never writes the destination file and does not remove the
source file so starts looping...One other important thing I should mention
is , I ambootstraping the applicationcontext xml using
org.apache.camel.spring.Main class.

Here is both JAVA DSL and Spring DSL.. Can some expert help me in
identifying the issue why Spring DSL behaviour is not the same as Java DSL.

 Spring Dsl 
 
 <camelContext xmlns="http://camel.apache.org/schema/spring">		

   <route>
        	
         from uri="file:F:/EbcConversion/Data/inbox/?
delete=true&amp;idempotent=true&amp;readLock=changed&amp;readLockCheckInterval=1500"/>
         <split streaming="true"  >
            <method bean="byteSplitterBean" method="splitBody"/>
            <process ref="decoder" />       
            <to uri="direct:start" />   			
         </split >
    </route>

       
<route>
	<from uri="direct:start" />
		<aggregate strategyRef="aggregationStrategy"
			completionTimeout="1500" completionSize="750" >
			<correlationExpression>
				<header>Exchange.FILE_NAME_ONLY</header>
			</correlationExpression>		
		<to uri="mock:aggregated"/> 
		</aggregate>
		<to
uri="file:F:/EbcConversion/Data/outbox/files/?fileExist=Append&amp;fileName=output.txt"
/>
	</route>
   
        
 </camelContext>

Java DSL 
 
from("file:F:/EbcConversion/Data/inbox?delete=true&idempotent=true&readLock=changed&readLockCheckInterval=1500").
split().method("mySplitterBean", "testBody").streaming().
process( new NewDecoder()).
aggregate(header(Exchange.FILE_NAME_ONLY), 
		new StringBodyAggregator()).completionSize(750)
		.completionTimeout(1500).
to("file:F:/EbcConversion/Data/outbox/files?fileExist=Append&fileName=output.txt");


Thanks a lot.





--
View this message in context: http://camel.465427.n5.nabble.com/Java-DSL-vs-Spring-Dsl-with-Splitter-and-Aggregator-tp5727007.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message