142.8. 尽快触发
Since Camel 2.17
您可能需要尽快触发 Camel 路由中的信息,您可以使用负的延迟:
<route> <from uri="timer://foo?delay=-1"/> <to uri="bean:myBean?method=someMethodName"/> </route>
<route>
<from uri="timer://foo?delay=-1"/>
<to uri="bean:myBean?method=someMethodName"/>
</route>
这样,计时器将立即触发消息。
您还可以同时指定 repeatCount 参数,以及负延迟,以在达到固定数量后停止触发的消息。
如果您没有指定 repeatCount,则计时器将继续触发消息,直到路由将停止为止。