apache-camelcamel-file

Apache camel file component to periodically read files without deleting or moving files and without idempotency


file:/../..?noop=true&scheduler=quartz2&scheduler.cron=0+0/10+*+*+*+?

Using noop=true allows me to have the files at same place after the route consumes the files but it also enables idempotent which I don't want. (There is second route which will do deletion based on some other logic so the first route shouldn't lead to infinite loop by consuming non-idempotently I believe)

I think I can overwrite the file and use idempotentKey as ${file:name}-${file:modified} so that the file will be picked up on next polling but that still means extra write. Or just deleting and creating the same file also should work but again not a clean approach.

Is there a better way to accomplish this? I could not find it in Camel documentation.

Edit: To summarize I want to read the same files over and over in a scheduled manner (say every 10 mins) from the same repo. SOLVED! - Answer below.

Camel Version: 2.14.1

Thanks!


Solution

  • SOLVED!

    file:/../..?noop=true&idempotent=false&scheduler=quartz2&scheduler.cron=0+0/10+*+*+*+?