On Wed, Mar 6, 2013 at 6:40 AM, vss123 <vss...@gmail.com> wrote: > Sorry. The Camel version we use is 2.10.3. > > We have a drop-zone in a file system where the other systems drop xml files. > > With this project we use camel to pickup these files and do processing to > communicate with few other systems. We want to run multiple instances of our > project, so that we can process many xml files in parallel. > > We used 'preMove' as a mechanism so that two instances don't start > processing the same file. So the files move from 'files/inbox' to > 'files/inbox/inProgress' and then after processing it moves to > 'files/inProgress/.camel' >
You can just remove preMove and let the default readLock do its business. It writes a .camelLock file when a consumer is picking up a file. > When we run multiple instances we get following kinds of errors with one or > more of them. > > [org.apache.camel.component.file.GenericFileOperationFailedException - > Cannot rename file: GenericFile[sample1.xml] to: > GenericFile[inProcess/sample1.xml]] > > [org.apache.camel.component.file.GenericFileOperationFailedException - > Cannot rename file: GenericFile[inProcess/sample2.xml] to: > GenericFile[inProcess/.camel/sample2.xml]] > > Because of this, the processed files go missing in 'inProcess' folder or > 'inProcess/.camel'. > Are you using Windows? If you are they make sure you close all streams when you acces the file. Otherwise you cannot move the file after use. You can also let Camel read the file content into memory first, then you do not have that problem from file convertBodyTo(String.class) > Also, will using SFTP/FTP will help in this kind of scenarios? If so how to > do the same with FTP/SFTP? > > Thanks for your response and happy to provide more details. :) > > > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/File-component-language-preMove-only-tp1843111p5728629.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: cib...@redhat.com Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen