camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atluris <>
Subject moveFailed is failing when streaming is on
Date Sat, 10 Aug 2013 10:48:12 GMT

I am new to camel. My requirement is to read a huge file (> 100 KB) and
process it. If process fails due to some reason, file should be moved to
error folder. since it is a huge file I am using split() with streaming().
Below is my route definition.

		  .log("Starting to process file: ${header.CamelFileName}")
		  .setProperty("UfmProcessLogId", method(ufmProcessService,
		  .split(body().tokenize("\n"), new
		   .log("End of process file: ${header.CamelFileName}");
		  .unmarshal().bindy(BindyType.Fixed, UFMVehiclePassage.class)
${property.CamelSplitIndex}, ${body}, ${exception.stacktrace})");

When the process failed, file is failed to move into error folder due to
below exception.

Caused by: Renaming file from:
C:\UFM\test\FDOT9010UFMSample1.txt to:
C:\UFM\test\error\FDOT9010UFMSample1.txt failed due cannot delete from file:
C:\UFM\test\FDOT9010UFMSample1.txt after copy succeeded

File is being successfully moved to error folder when streaming() is removed
or if I use convertBodyToType(String).

Since it is huge file, I have to use streaming() and I can't use
convertBodyToType(String) because it loads whole file into memory which I
want to avoid in the first place.

Please suggest me if there is any solution for this.

OS: Windows
Camel: 2.11.1 on JDK7.

Thanks & Regards,
Srinivas Atluri

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message