Whenever I start a Camel route from a file
URI, I see that Camel obtains a "lock" on the file. For instance, if the file is named myinput.xml
, then Camel creates a "lock file" on it, in the same directory, called myinput.xml.camelLock
.
Hope this helps you my friend
readLocks is used by consumers, to only poll the files if it has exclusive read-lock on the file (i.e. the file is not in-progress or being written). Camel will wait until the file lock is granted after that Camel creates a marker file and then holds a lock on it camel maintain that lock as JDK IO API cannot always determine whether a file is currently being used by another process. The option readLockCheckInterval can be used to set the check frequency. This option is only avail for the FTP component from Camel 2.8 onwards. Notice that from Camel 2.10.1 onwards the FTP option fastExistsCheck can be enabled to speedup this readLock strategy.
Notice from Camel 2.10 onwards the read locks changed, fileLock and rename will also use a markerFile as well, to ensure not picking up files that may be in process by another Camel consumer running on another node (eg cluster). This is only supported by the file component (not the ftp component).