有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何在Spring上的ApacheCamel中一开始就并行运行两条路由?

在这里,我配置了两条路由,当我作为守护进程启动ApacheServiceMix时运行。但当我启动servicemix时,我注意到每个路由都是按顺序执行的。我只是想知道如何在servicemix启动的同时运行它们

    <camelContext xmlns="http://camel.apache.org/schema/spring">
    <route>
        <from uri="timer://myTimer?fixedRate=true&amp;period=8000" />
        <to uri="bean://passengerUpdateDaemon?method=process"/>
    </route>
    <route>
        <from uri="timer://myTimer?fixedRate=true&amp;period=8000" />
        <to uri="bean://baggageUpdateDaemon?method=process"/>
    </route>
</camelContext>

请告诉我如何编写并行运行的代码


共 (1) 个答案

  1. # 1 楼答案

    使用计时器名称的唯一名称,例如myTimer和myTimer2