The program i am trying to build, consumes files on a Windows file share using Camel 2.18.5 and other programs occasionally add/modify/delete files in the share folder.
Building a simple test route
from("file:///C:/Temp/from?readLock=changed&readLockCheckInterval=10000&readLockTimeout=0")
.routeId("SimpleFileRoute")
.to("file:/C:/Temp/to");
then placing a file, test.txt, in the from folder, waiting for the route to make a test.txt.camelLock file and then manually deleting test.txt before the readLockCheckInterval has passed, will cause the route to hang indefinitely without throwing an exception or processing any other files.
"changed" seems to be the only appropriate readLock for the situation.
Is there any way to make the route throw an exception, clean up the lock file and continue consuming files?
Edit: The stack trace of the thread that seems to be the route is this:
Daemon Thread [Camel (camel-1) thread #2 - file:///C:/Temp/from] (Suspended)
Thread.sleep(long) line: not available [native method]
FileChangedExclusiveReadLockStrategy.sleep() line: 104
FileChangedExclusiveReadLockStrategy.acquireExclusiveReadLock(GenericFileOperations<File>, GenericFile<File>, Exchange) line: 90
GenericFileRenameProcessStrategy<T>(GenericFileProcessStrategySupport<T>).begin(GenericFileOperations<T>, GenericFileEndpoint<T>, Exchange, GenericFile<T>) line: 64
GenericFileRenameProcessStrategy<T>.begin(GenericFileOperations<T>, GenericFileEndpoint<T>, Exchange, GenericFile<T>) line: 37
FileConsumer(GenericFileConsumer<T>).processExchange(Exchange) line: 362
FileConsumer(GenericFileConsumer<T>).processBatch(Queue<Object>) line: 223
FileConsumer(GenericFileConsumer<T>).poll() line: 187
FileConsumer(ScheduledPollConsumer).doRun() line: 174
FileConsumer(ScheduledPollConsumer).run() line: 101
Executors$RunnableAdapter<T>.call() line: 511
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>(FutureTask<V>).runAndReset() line: 308
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.access$301(ScheduledThreadPoolExecutor$ScheduledFutureTask) line: 180
ScheduledThreadPoolExecutor$ScheduledFutureTask<V>.run() line: 294
RejectableScheduledThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line: 1142
ThreadPoolExecutor$Worker.run() line: 617
Thread.run() line: 745