You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christian Müller <ch...@gmail.com> on 2013/03/01 07:52:06 UTC

Re: Large file processing with Apache Camel

You have to make sure your processor is thread safe, because it is shared
between all parallel executed threads.

Best,
Christian

On Thu, Feb 28, 2013 at 1:03 PM, cristisor <cr...@yahoo.com> wrote:

> After digging more into my problem I found that the slow db access was the
> main issue, maybe you heard before of setting
> sendStringParametersAsUnicode=false in the jdbc driver to dramatically
> increase the performance.
>
> Since the last time I posted here I learned a lot about apache camel and I
> implemented some nice changes, but I'm confronting with a synchronization
> problem right now. I split each line that comes from the file and I enable
> parallel processing:
>
> from().split(body(String.class).tokenize("\n")).parallelProcessing().process(processor).to()
>
> Inside this processor I take the line, send it to the xml mapper as an
> input
> stream and in the end I set the xml as the body of the out message. The
> processor's process method is not synchronized and I run into situations
> where the input line has a code "1234" and the output doesn't contain the
> code "1234" but "1235", but this code belongs to another line 100% sure. So
> I should control the synchronization process by myself, right?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Large-file-processing-with-Apache-Camel-tp5727977p5728292.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--