0

我正在使用带有 simpleTrigger 的骆驼石英组件,因为我现在需要在启动时触发一次,然后每 12 小时触发一次。我在下面的测试中有 5 分钟的时间。简单触发器语法

quartz://timerName?options
quartz://groupName/timerName?options

它的工作方式是有一个加载和实例化单例的数据库,当数据库加载并变得可用时,它会启动以下路线。这条路线应该启动,它会在启动时执行一次作业,然后在每个间隔上,这是它失败的地方,它不会为该间隔发出另一个触发器。

我看到的方式是fireNow = true,在开始时触发路线

trigger.repeatInterval=300 establishes the period/interval between triggers
trigger.repeatCount=1  will allow 1 trigger to occur between repeatIntervals.

它开始,现在触发第一个触发器,但是,在那之后它不会触发另一个事件???

我在做什么错或误解?感谢您的帮助。

fireNow=true&trigger.repeatInterval=300&trigger.repeatCount=1"

我的代码:

<route autoStartup="false" id="get.custkeys">
    <from id="get.custkeys" uri="quartz://autoTokenService/getcustkey?fireNow=true&amp;trigger.repeatInterval=300&amp;trigger.repeatCount=1"/>
    <process id="get.custkeys.rte" ref="tokenListLookupProcessor"/>
    <split id="splitcustkey">
        <tokenize token=","/>
        <log id="sck1" loggingLevel="INFO" message="Custkey Requesting Token: ${body}"/>
        <process id="supKey" ref="setUpKeysProcessor"/>
        <throttle id="custkey_throttle" timePeriodMillis="1000">
            <constant>1</constant>
            <to id="getKeys" uri="seda:processCustKeys"/>
        </throttle>
    </split>
</route>
4

1 回答 1

0

我想我找到了答案, trigger.repeatCount=-1 将允许触发事件再次发生。此外,trigger.repeatInterval 以毫秒为单位。

下面,在启动时触发触发事件。然后在repeatInterval 之后,触发事件再次触发。正如预期的那样。

<route autoStartup="false" id="get.custkeys">
    <from id="get.custkeys" uri="quartz://autoTokenService/getcustkey?fireNow=true&amp;trigger.repeatInterval=120000&amp;trigger.repeatCount=-1&amp;trigger.misfireInstruction=2"/>
    <process id="get.custkeys.rte" ref="tokenListLookupProcessor"/>
    <split id="splitcustkey">
        <tokenize token=","/>
        <log id="sck1" loggingLevel="INFO" message="Custkey Requesting Token: ${body}"/>
        <process id="supKey" ref="setUpKeysProcessor"/>
        <throttle id="custkey_throttle" timePeriodMillis="1000">
            <constant>1</constant>
            <to id="getKeys" uri="seda:processCustKeys"/>
        </throttle>
    </split>
</route>
于 2019-10-01T22:13:45.213 回答