camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebinsingh <ebenezer.si...@VerizonWireless.com>
Subject Re: Type Converters Load
Date Mon, 14 Nov 2011 17:51:01 GMT
I am finding that just reading the file of 2k records just takes 1
millisecond. 
Code:
		from("file:C:\\camelProject\\data\\inbox\\mars")
		.log("Starting to process big file: ${header.CamelFileName}")
		.bean(MarsParser.class,"parseMarsData")
	
.to("file:C:\\camelProject\\data\\outbox\\mars?fileName=${file:onlyname.noext}");

But, Reading the file and spliting each line using "\n" token takes and
streaming them to an aggregator or a bean takes more than 550 milliseconds.

		from("file:C:\\camelProject\\data\\inbox\\mars")
		.log("Starting to process big file: ${header.CamelFileName}")
		.split(body().tokenize("\n")).streaming()
		.unmarshal(csv).convertBodyTo(List.class)
		.bean(MarsParser1.class,"create_fp_record1")
		.aggregate(constant(true), new
MyAggregationStrategy()).completionSize(2000)
		.convertBodyTo(String.class)
	
.to("file:C:\\camelProject\\data\\outbox\\mars?fileName=${file:onlyname.noext}")


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

Mime
View raw message