有没有办法只使用Spring DSL在Apache Camel中设置定时或轮询路由?

有没有办法只使用Spring DSL在Apache Camel中设置定时或轮询路由?,spring,apache-camel,Spring,Apache Camel,我有一个很好的简单路线,使用Camel的FTP组件: <camelContext id="myroute" xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="file:///outgoing"/> <to uri="ftp://user@randomftpsite/test/?password=password"/> &

我有一个很好的简单路线,使用Camel的FTP组件:

<camelContext id="myroute" xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="file:///outgoing"/>
        <to uri="ftp://user@randomftpsite/test/?password=password"/>
    </route>
</camelContext>

有没有办法在春季DSL中触发这条路线,比如说每小时触发一次

是的

<camelContext id="myContext" xmlns="http://camel.apache.org/schema/spring">
    <route id="myRoute">
        <from uri="file:///outgoing?delay=1h"/> 
        <to uri="ftp://user@randomftpsite/test/?password=password"/>
    </route>
</camelContext>


文件可以直接这样做。您应该在此处查看:

文件组件记录在:因为文件是针对Camel 1.x中的旧文件组件,即EOL。您也可以使用延迟速记,例如延迟1小时,这可能更容易阅读感谢克劳斯的评论,我编辑了我的答案以反映它们。