We are using Camel to read files and check the content of the files. We don't need to forward the files to an endpoint. Below the build we use for setting up Camel. The problem is that Camel deletes the files after having processed the files. How can we avoid the deletion of the files ?
public void configure() {
from(
file(inputDirectory).initialDelay(initialDelay).delete(false).antInclude("*.pdf").readLock("markerFile").readLockDeleteOrphanLockFiles(false).maxMessagesPerPoll(500))
.routeId("signaturcheck")
.throttle(8).timePeriodMillis(100)
.process(checkFile)
.log("File handled ${file:name}")
.stop();
}
It seems it's the "stop()" which is responsible that the files in the inputDirectory is deleted. so, we created a different configuration and that works without deleting the files.