camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tourist604 <>
Subject FileProducer enhancement suggestion
Date Fri, 08 Aug 2008 18:55:32 GMT


I would like to suggest an enhancement for the FileProducer:

It may be very likely that the FileProducer is producing into a directory
which is being scanned by another FileConsumer. It's very easy to get into a
race condition when the file is not completely written and another
FileConsumer is already picking it up. I think there is a change scheduled
for 1.5.0 where "consumer.exclusiveReadLock" can be specified. However, the
solution below may prove to be simpler and more portable to different

Perhaps, the FileProducer can write the file into a name that begins with
"." or into a directory beginning with "." and then move it to the intended
result path when the writing is complete. If I understand right, file move
is an atomic operation so it should avoid the race condition.

This may be a simpler solution than trying to apply file locks and will
probably work on NFS mounts where locks are not guaranteed.


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

View raw message