1
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!

user0904
  • 210
  • 3
  • 7
  • 2
    Why not simply specify `idempotent=false`? Or is your question rather asking how to manage that the file is only read once while not utilizing the idempotent repository? – Roman Vottner Apr 06 '21 at 00:14
  • @RomanVottner adding `idempotent=false` hadn't worked initially so I assumed that because of `noop=true` idempotent option couldn't be set to false. I was wrong and maybe it didn't work for me initially due to some other reason. Thanks anyway it works now! ```file:/../..?noop=true&idempotent=false&scheduler=quartz2&scheduler.cron=0+0/10+*+*+*+?```did exactly what I want. You can add `maxMessagesPerPoll` option as well if you want to limit the number of files to read (Just note that because of the combinations used route will read the files randomly and same files can be re-read on every poll) – user0904 Apr 07 '21 at 21:51

1 Answers1

1

SOLVED!

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

user0904
  • 210
  • 3
  • 7