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