1

我有一个问题与阿拉伯骆驼石英cron计时器卡拉夫4.0.3。看来,石英作业执行时,它正在执行多次。以下示例蓝图作为我的“批量编排器”应用程序的一部分加载。 Hello World输出会立即打印多次。相反,它应该每2分钟打印一次。有谁知道这里发生了什么,以及如何纠正?骆驼石英没有按预期工作在卡拉夫

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0" 
    xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0" 
    xsi:schemaLocation=" 
    http://www.osgi.org/xmlns/blueprint/v1.0.0 
    http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd 

    http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 
    http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd 

    http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.1.0 
    http://aries.apache.org/schemas/blueprint-ext/blueprint-ext-1.1.xsd"> 

    <camelContext xmlns="http://camel.apache.org/schema/blueprint" 
    id="simple"> 
    <route> 
     <from uri="quartz:myTimerName?cron=*+0/2+*+*+*+?" /> 
     <setBody> 
      <simple>Hello World</simple> 
     </setBody> 
     <to uri="stream:out" /> 
    </route> 
    </camelContext> 
</blueprint> 

我然后启动Karaf干净并安装最新的骆驼(但我可以在骆驼的许多版本可以追溯到2.12重现)。

 __ __     ____ 
///_/____ __________ _/ __/ 
/,</__ `/ ___/ __ `/ /_ 
//| |/ /_/////_//__/ 
/_/ |_|\__,_/_/ \__,_/_/ 

Apache Karaf (4.0.3) 

Hit '<tab>' for a list of available commands 
and '[cmd] --help' for help on a specific command. 
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown Karaf. 

[email protected]()> feature:repo-add camel 
Adding feature url mvn:org.apache.camel.karaf/apache-camel/LATEST/xml/features 
[email protected]()> feature:install camel-blueprint 
[email protected]()> feature:install camel-quartz 
[email protected]()> feature:install camel-stream 
[email protected]()> install mvn:com.cerner.cts.oss/mass-orchestrator/1.0.0-SNAPSHOT 
Bundle ID: 66 
[email protected]()> list 
START LEVEL 100 , List Threshold: 50 
ID | State  | Lvl | Version   | Name 
---------------------------------------------------------------------------------- 
52 | Active | 80 | 2.17.0.SNAPSHOT | camel-blueprint 
53 | Active | 80 | 2.17.0.SNAPSHOT | camel-catalog 
54 | Active | 80 | 2.17.0.SNAPSHOT | camel-commands-core 
55 | Active | 80 | 2.17.0.SNAPSHOT | camel-core 
56 | Active | 80 | 2.17.0.SNAPSHOT | camel-karaf-commands 
57 | Active | 80 | 2.2.6.1   | Apache ServiceMix :: Bundles :: jaxb-impl 
58 | Active | 80 | 3.1.4   | Stax2 API 
59 | Active | 80 | 4.4.1   | Woodstox XML-processor 
60 | Active | 80 | 2.17.0.SNAPSHOT | camel-quartz 
61 | Active | 80 | 1.4    | Commons DBCP 
62 | Active | 80 | 1.6.0   | Commons Pool 
63 | Active | 80 | 1.1.1   | geronimo-jta_1.1_spec 
64 | Active | 80 | 1.8.6.1   | Apache ServiceMix :: Bundles ::  quartz 
65 | Active | 80 | 2.17.0.SNAPSHOT | camel-stream 
66 | Installed | 80 | 1.0.0.SNAPSHOT | mass-orchestrator 
[email protected]()> start 66 
[email protected]()> Hello World 
Hello World 
Hello World 
Hello World 
Hello World 
Hello World 
Hello World 
<snip> 

[email protected]()> 

回答

1

这个cron应

0+0/2+*+*+*+? 

只有一次每2分钟运行。如果您使用*,则意味着它每隔2分钟运行一次。

+0

blurprint xml已从部署文件夹中删除,但作业仍在运行?你能帮忙吗? –