配置Quartz2 Apache骆驼和保险丝

问题描述 投票:0回答:1

我有Camel的下一部分代码

        <route id="ROUTE-WK-OPSWEBGUSOXUA" streamCache="true">
        <from id="_from1" uri="{{opsweb.gusoxUA.timer.Endpoint}}?cron={{opsweb.gusoxUA.cron.timer}}&amp;stateful=true">
            <description>Principal Route of wk-opswebGusoxUA</description>
        </from>
        <bean id="_bean1" method="queryOpsweb" ref="jdbcTemplateOpsweb">
            <description>query pesobalance.soc_users_opsweb where user_state = 'A'</description>
        </bean>
        <doTry id="_doTry1">
            <choice id="_choice1">
                <when id="_when1">
                    <simple>${body} == '[]'</simple>
                    <log id="_log2" loggerRef="loggerRef"
                        loggingLevel="INFO" message="Result query dbo.sistemas empty => ${body} "/>
                    <!-- Lanzar una Excepcion -->
                </when>
                <otherwise id="_otherwise1">
                    <log id="_log3" loggerRef="loggerRef"
                        loggingLevel="INFO" message="Empieza Splitter "/>
                    <split id="_split1" stopOnException="false">
                        <simple>${body}</simple>
                        <process id="_process2" ref="csvTrasformationProcessor"/>
                        <log id="_log6" loggerRef="loggerRef"
                            loggingLevel="INFO" message="Register of ApplicationAfter => ${body}"/>
                        <marshal id="_marshall1" ref="dataModel"/>
                        <to id="_to2" uri="file:{{opsweb.gusoxUA.file.location}}?fileName=${date:now:yyyyMMdd}_opsweb.csv&amp;fileExist=Append"/>
                    </split>

但是石英创建10个线程并执行10次,而我只想执行1次。

当我将其部署在保险丝中时,我会看到下一个:

2020-04-21 14:58:50,081 | INFO  | xtenderThread-46 | ManagedManagementStrategy        | 172 - org.apache.camel.camel-core - 2.15.1.redhat-621084 | JMX is enabled                            
2020-04-21 14:58:50,112 | INFO  | xtenderThread-46 | QuartzComponent                  | 222 - org.apache.camel.camel-quartz2 - 2.15.1.redhat-621084 | Create and initializing scheduler.     
2020-04-21 14:58:50,113 | INFO  | xtenderThread-46 | QuartzComponent                  | 222 - org.apache.camel.camel-quartz2 - 2.15.1.redhat-621084 | Setting org.quartz.scheduler.jmx.export=true to ensure QuartzScheduler(s) will be enlisted in JMX.                                                                                                                                  
2020-04-21 14:58:50,114 | INFO  | xtenderThread-46 | StdSchedulerFactory              | 272 - org.quartz-scheduler.quartz - 2.2.1 | Using default implementation for ThreadExecutor
2020-04-21 14:58:50,114 | INFO  | xtenderThread-46 | SimpleThreadPool                 | 272 - org.quartz-scheduler.quartz - 2.2.1 | Job execution threads will use class loader of thread: SpringOsgiExtenderThread-46
2020-04-21 14:58:50,115 | INFO  | xtenderThread-46 | SchedulerSignalerImpl            | 272 - org.quartz-scheduler.quartz - 2.2.1 | Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
2020-04-21 14:58:50,115 | INFO  | xtenderThread-46 | QuartzScheduler                  | 272 - org.quartz-scheduler.quartz - 2.2.1 | Quartz Scheduler v.2.2.1 created.
2020-04-21 14:58:50,115 | INFO  | xtenderThread-46 | RAMJobStore                      | 272 - org.quartz-scheduler.quartz - 2.2.1 | RAMJobStore initialized.
2020-04-21 14:58:50,116 | INFO  | xtenderThread-46 | QuartzScheduler                  | 272 - org.quartz-scheduler.quartz - 2.2.1 | Scheduler meta-data: Quartz Scheduler (v2.2.1) 'DefaultQuartzScheduler-com.avianca.datacenter.sal.WK-opswebGusoxUA' with instanceId 'NON_CLUSTERED'
  Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
  NOT STARTED.
  Currently in standby mode.
  Number of jobs executed: 0
  Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
  Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

我如何配置Quartz仅执行一次而不是执行10。

spring apache-camel jbossfuse
1个回答
0
投票

我认为这已在较新版本的骆驼中修复。您可以尝试使用更新的版本。

© www.soinside.com 2019 - 2024. All rights reserved.