Can you put the <to uri="direct:start"> after the </split> ?
The aggregator should be done after the split.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Wednesday, February 6, 2013 at 6:28 AM, Gvvenkat wrote:

> 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 
> (http://Nabble.com).



Reply via email to