java如何在Spring上的ApacheCamel中一开始就并行运行两条路由?
在这里,我配置了两条路由,当我作为守护进程启动ApacheServiceMix时运行。但当我启动servicemix时,我注意到每个路由都是按顺序执行的。我只是想知道如何在servicemix启动的同时运行它们
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="timer://myTimer?fixedRate=true&period=8000" />
<to uri="bean://passengerUpdateDaemon?method=process"/>
</route>
<route>
<from uri="timer://myTimer?fixedRate=true&period=8000" />
<to uri="bean://baggageUpdateDaemon?method=process"/>
</route>
</camelContext>
请告诉我如何编写并行运行的代码
# 1 楼答案
使用计时器名称的唯一名称,例如myTimer和myTimer2