Thanks a lot Christian.

I just noticed that adding an aggregater slows down the process and it's
huge.
Without the aggregation, the time taken between parsing each line of data is
in nanoseconds (very negligible), but as I add the aggregarion to it, the
time taken by between parsing each line of data goes up to 30 milliseconds.

Also if I do not have the below executer statement, the process terminates
in the middle of iterating through the file.
".executorService(threadPool)"


Not sure if I have something totally wrong. Please advise.

               
from("file:C:\\camelProject\\data\\inbox?fileName=someFile.txt&delete=true")
                .log("Starting to process big file: ${header.CamelFileName}")
                .split(body().tokenize("\n")).streaming()
                .executorService(threadPool)
                .bean(MyParser.class,"parseString")
                .aggregate(header("CamelFileName"), new
MyAggregationStrategy()).completionSize(2000)
                .to("jms:queue:test_request_3");

As suggested I am using StringBuilder in my aggregation statergy.

        StringBuilder builder = new StringBuilder();
        @Override
        public Exchange aggregate(Exchange exchange1, Exchange exchange2) {
        if (exchange1 == null) {
            return exchange2;
        }
       
builder.append(exchange1.getIn().getBody(String.class)).append(exchange2.getIn().getBody(String.class));
        exchange1.getIn().setBody(builder.toString());
        return exchange1;
        }


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

Reply via email to