Apache camel quartz2 cron 调度程序不工作
Apache camel quartz2 cron scheduler is not working
我正在尝试实施 quartz 调度程序,但它不工作。
文件会立即从放置位置移动。
我希望作业每 3 分钟触发一次。我错过了什么吗?非常感谢您的帮助。
下面是我尝试使用的代码
<bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
<property name="routeStartTime" value="*/3 * * * * ?"/>
</bean>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route id="testRoute" routePolicyRef="startPolicy" autoStartup="false">
<from uri="file:C:/filedropOffLocation?idempotent=true&delete=true"/>
<to uri="file:C:/tempFileLocation"/>
</route>
</camelContext>
为什么要使用路由策略。文件组件本身支持调度。下面是在我的系统中运行良好的示例代码,
<route id="File_Poller">
<from uri="file:{{project_root}}/{{drop_zone}}?scheduler=quartz2&scheduler.cron=0+0/3+*+1/1+*+?+*"/>
<to uri="direct:xxxx"/>
</route>
上面的 cron 表达式 运行 每 3 分钟一次。希望对您有所帮助!!
我正在尝试实施 quartz 调度程序,但它不工作。 文件会立即从放置位置移动。
我希望作业每 3 分钟触发一次。我错过了什么吗?非常感谢您的帮助。
下面是我尝试使用的代码
<bean id="startPolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
<property name="routeStartTime" value="*/3 * * * * ?"/>
</bean>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route id="testRoute" routePolicyRef="startPolicy" autoStartup="false">
<from uri="file:C:/filedropOffLocation?idempotent=true&delete=true"/>
<to uri="file:C:/tempFileLocation"/>
</route>
</camelContext>
为什么要使用路由策略。文件组件本身支持调度。下面是在我的系统中运行良好的示例代码,
<route id="File_Poller">
<from uri="file:{{project_root}}/{{drop_zone}}?scheduler=quartz2&scheduler.cron=0+0/3+*+1/1+*+?+*"/>
<to uri="direct:xxxx"/>
</route>
上面的 cron 表达式 运行 每 3 分钟一次。希望对您有所帮助!!