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