I am working on reading the files from the sftp path and process the plain text files that are kept on the server every 5 hours. There is a requirement where I need to throw an exception when there is no file present/kept on the server by the producer. I am using the following to read the files
from(sftp://NUID@SERVER:PORT?&preferredAuthentications=password&delete=true)
.routeId(ROUTE_ID)
.log("${body}")
.process(processor)
.end();
Now if there is no file present when the above route starts it doesn't say anything once there is a file on the server it consumes and process it. I want to throw an exception if there is no file present during a period of time.