[英]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 and.to 方法来做同样的事情。
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
谢谢
Camel polls the files automatically every 0.5 seconds. Camel 每 0.5 秒自动轮询一次文件。 If you want to poll every 5 minutes, you can add a delay option.
如果要每 5 分钟轮询一次,可以添加延迟选项。 Something like this
file:input?noop=true&delay=30000"
像这样的
file:input?noop=true&delay=30000"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.