Верблюжий кварц с политикой маршрута - PullRequest
0 голосов
/ 29 января 2020

Я столкнулся с проблемой, когда кварц не запускается. Что-то не так с моей конфигурацией ниже?

У меня также есть требование, где я должен приостановить работу в указанное время c и возобновить ее снова.

Я настроил политику, используя кварц как описано в ссылке

https://camel.apache.org/manual/latest/cronscheduledroutepolicy.html

Любая помощь или предложения, пожалуйста?

<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">

        <route routePolicyRef="testRoutePolicy">
            <from uri="Reading from queue"/> // exact names are hidden due to security reasons
            <transacted/>
            <setHeader headerName="id">
                <simple>${in.header.id}</simple>
            </setHeader>

            <to uri="bean:beanName1"/> // exact names are hidden due to security reasons
            <log message="Got response: ${body}"/>
            <to uri="Sending to another queue"/> // exact names are hidden due to security reasons
        </route>

        <route routePolicyRef="testRoutePolicy">
            <from uri="Reading from queue"/>
            <transacted/>
            <setHeader headerName="id">
                <simple>${in.header.id}</simple>
            </setHeader>

            <to uri="bean:beanName2"/>
            <log message="Got response: ${body}"/>
            <to uri="bean:beanName3"/>
        </route>

        <route routePolicyRef="testRoutePolicy">
            <from uri="Reading from queue"/>
            <transacted/>

            <to uri="bean:beanName4"/>           
            <to uri="Sending to another queue"/>
        </route>

    </camelContext>

    <bean id="testRoutePolicy" class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy">
        <property name="routeStartTime" value="* * * * *"/>
        <property name="routeSuspendTime" value="0 30 5 ? * SUN *"/>
        <property name="routeResumeTime" value="0 0 8 ? * SUN *"/>
    </bean>

Журналы Jboss:

29/01/20 14:13:38,701 INFO  [C3P0Registry] Initializing c3p0-0.9.5.2 [built 08-December-2015 22:06:04 -0800; debug? true; trace: 10] [main]
29/01/20 14:13:38,818 INFO  [SpringCamelContext] Apache Camel 2.19.1 (CamelContext: camel) is starting [main]
29/01/20 14:13:38,820 INFO  [ManagedManagementStrategy] JMX is enabled [main]
29/01/20 14:13:38,965 INFO  [DefaultTypeConverter] Loaded 196 type converters [main]
29/01/20 14:13:39,018 INFO  [DefaultRuntimeEndpointRegistry] Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000) [main]
29/01/20 14:13:39,147 INFO  [QuartzComponent] Setting org.quartz.scheduler.jmx.export=true to ensure QuartzScheduler(s) will be enlisted in JMX. [main]
29/01/20 14:13:39,177 INFO  [StdSchedulerFactory] Using default implementation for ThreadExecutor [main]
29/01/20 14:13:39,180 INFO  [SimpleThreadPool] Job execution threads will use class loader of thread: main [main]
29/01/20 14:13:39,196 INFO  [SchedulerSignalerImpl] Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl [main]
29/01/20 14:13:39,196 INFO  [QuartzScheduler] Quartz Scheduler v.2.3.0 created. [main]
29/01/20 14:13:39,197 INFO  [RAMJobStore] RAMJobStore initialized. [main]
29/01/20 14:13:39,202 INFO  [QuartzScheduler] Scheduler meta-data: Quartz Scheduler (v2.3.0) 'DefaultQuartzScheduler-camel' 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.
 [main]
29/01/20 14:13:39,203 INFO  [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler-camel' initialized from an externally provided properties instance. [main]
29/01/20 14:13:39,203 INFO  [StdSchedulerFactory] Quartz scheduler version: 2.3.0 [main]
...