Re: Write enriched data after a split in a file

2013-03-08 Thread Jean Francois LE BESCONT
I have added it to manage an pool of stream, it works fine. public class AEDFileWriter { private Map fosPool= new HashMap(); public void writeLine(@Body String data, @Property("OutputFileName") String OutputFileName, @Header("CamelSplitComplete") boolean done) throws IOException { // Get the o

Re: Write enriched data after a split in a file

2013-03-08 Thread Jean Francois LE BESCONT
It works fine with the simple example that is present but in a seda queue executed with concurrentConsumers the bean throw an exception due to concurrency ... 2013/3/8 Jean Francois LE BESCONT > OK ! > > I have create a jira : https://issues.apache.org/jira/browse/CAMEL-6147 ( my > first :) >

Re: Write enriched data after a split in a file

2013-03-08 Thread Jean Francois LE BESCONT
OK ! I have create a jira : https://issues.apache.org/jira/browse/CAMEL-6147 ( my first :) By the way the solution is a route like this : from("file://C:/Temp/camel/input_test/?noop=true") .setProperty("OutputFileName" , simple("C:/Temp/camel/output_test/${headers.CamelFileName}")) .split() .

Re: Write enriched data after a split in a file

2013-03-08 Thread Claus Ibsen
On Fri, Mar 8, 2013 at 2:39 PM, jeff wrote: > the more performante way looks to do : > >from("file://C:/Temp/camel/input_test/?noop=true") > .split() > .tokenize("\n") > // Business lock with possible reject / enrich etc ... >

Re: Write enriched data after a split in a file

2013-03-08 Thread Claus Ibsen
On Fri, Mar 8, 2013 at 3:13 PM, Raúl Kripalani wrote: > I wonder if split().shareUnitOfWork() would help here? > Thats related to have all the work appear as one unit, so when you do error handling / dead letter queue etc. then the entire route rollback if one of the splitter failed etc. > On Ma

Re: Write enriched data after a split in a file

2013-03-08 Thread Raúl Kripalani
I wonder if split().shareUnitOfWork() would help here? On Mar 8, 2013, at 14:02, Claus Ibsen wrote: > On Fri, Mar 8, 2013 at 2:39 PM, jeff wrote: >> the more performante way looks to do : >> >> from("file://C:/Temp/camel/input_test/?noop=true") >> .split() >> .to

Re: Write enriched data after a split in a file

2013-03-08 Thread Claus Ibsen
On Fri, Mar 8, 2013 at 2:39 PM, jeff wrote: > the more performante way looks to do : > >from("file://C:/Temp/camel/input_test/?noop=true") > .split() > .tokenize("\n") > // Business lock with possible reject / enrich etc ... >

Re: Write enriched data after a split in a file

2013-03-08 Thread jeff
the more performante way looks to do : from("file://C:/Temp/camel/input_test/?noop=true") .split() .tokenize("\n") // Business lock with possible reject / enrich etc ... .streaming()

Re: Write enriched data after a split in a file

2013-03-08 Thread Jean Francois LE BESCONT
That is the best practice for do it ? 2013/3/8 Jean Francois LE BESCONT > Thanks Marco ! > > It is an idea ! Claused to the Composed Message Processor ( > http://camel.apache.org/composed-message-processor.html paragraph Example > using only Splitter). > > I am really suprised to have to make a

Re: Write enriched data after a split in a file

2013-03-08 Thread Jean Francois LE BESCONT
Thanks Marco ! It is an idea ! Claused to the Composed Message Processor ( http://camel.apache.org/composed-message-processor.html paragraph Example using only Splitter). I am really suprised to have to make a such tips, it looks very complicated for a simple use case no ? 2013/3/8 Marco Wester

Re: Write enriched data after a split in a file

2013-03-08 Thread Marco Westermann
Hi, maybe you can process this by using a bean. Then you can open the stream at the beginning and close it at the end. I try to show you what I mean: FileWriterBean fwBean = new FileWriterBean(); public void configure() { from("file://") .bean(fwBean, "openFileForProcessing") .split().tokeniz

Re: Write enriched data after a split in a file

2013-03-08 Thread Jean Francois LE BESCONT
Thanks Willem for help. My explaination are sometime to complicate, I will present it differently. I have a "big" file to process efficiently, for that if I have tried : Method 1 : from("file://C:/Temp/camel/input_test/?noop=true") .split() .tokenize("\n") // Busine

Re: Write enriched data after a split in a file

2013-03-07 Thread Willem jiang
Can you try to use the aggregator to put the transformed objects together before sending it to the file ? -- 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.c