Akash Singh
Akash Singh

Reputation: 73

How to automate the task of copying files from one directory to another using Camel

I am new to Camel. I tried a simple example of creating a route to copy files from one directory to another. I am using simple from and .to methods to do the same.

           from("file:input?noop=true")
               .to("file:output");

But for copying any new file that has been added to the input directory I need to run the code again. I know that this task can be automated but I am confused with so many options. Can anyone suggest different ways to automate this task? Thanks

Upvotes: 0

Views: 135

Answers (1)

Sneharghya Pathak
Sneharghya Pathak

Reputation: 1060

Camel polls the files automatically every 0.5 seconds. If you want to poll every 5 minutes, you can add a delay option. Something like this file:input?noop=true&delay=30000"

Upvotes: 1

Related Questions