54.7. 尽快触发
从 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,则计时器将继续触发的消息,直到路由停止为止。