Hi People,
I have been working on Splitter along with Camel bindy & JaxB. The concept
being to split and stream the file one line at a time from a csv, convert
the csv line into bindy object , and then marshall each of the Java object
to XML(using JaxB processors). This mashalled XML line is appended to an
intermediate file. Once the splitting is complete the file is sent to ftp.
The problem is the intermediate file creation is slow when the input CSV
file is big (18 MB approx). Please find below the code snippet:-


<route id="initialLoadRoute">
<from 
uri="file://{{input.dir.path}}?move=../archive/inbox&amp;maxMessagesPerPoll=1&amp;delay=5000&amp;charset=iso-8859-1"
/>
  <split streaming="true">
    <tokenize token="\n" />
   <to uri="bean:intermediateFileProcessor?method=process" />
   <unmarshal ref="csvToBindyDataFormat" />
   <to uri="bean:bindyToJaxbProcessor?method=processInitialLoad" />
   <marshal ref="initialLoadSupplierDetailJaxb" />
   <to uri="file://{{intermediate.dir.path}}?        
fileExist=Append&amp;fileName=$simple{property.MessageId}-$simple{property.FileName}"
/>
   <camel:choice>
        <camel:when>
           <camel:simple>${property.CamelSplitComplete} == 'true'</camel:simple>
           <process ref="endTagProcessor" />
           <to
uri="file://{{intermediate.dir.path}}?fileExist=Append&amp;fileName=$simple{property.MessageId}-$simple{property.FileName}"
/>
           <camel:to uri="direct:ex"></camel:to>
        </camel:when>
   </camel:choice>
  </split>
</route>

<route id="readIntermediateFileRoute">
    <from uri="direct:ex" />
    <camel:pollEnrich uri="file://{{intermediate.dir.path}}?" />
    <to
uri="file://{{final.dir.path}}?fileExist=Append&amp;fileName=Initial.xml" />
</route>

Am i doing something wrong here which is responsible for the slowness ?
Please advise.




--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-Splitter-slowness-problem-tp5742307.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to