1 Reply Latest reply on Jan 25, 2017 2:00 AM by igarashitm

    cronscheduledroutepolicy not working as expected in switchyard

    ravi21588

      Hi All,

       

      Iam trying to implement cronscheduledroutepolicy in camel route and it is not working as expected.

       

      iam expecting switchyard Route to stop and start at cron trigger.

       

      I had added routePolicyRef="customRoutePolicy" and autoStartup="false" attributes in route definition.

       

       

      logs:

      23:07:01,530 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016009: Stopping weld service for deployment Thunderhead-POC-PDF-1.1-SNAPSHOT.jar

      23:07:01,558 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment Thunderhead-POC-PDF-1.1-SNAPSHOT.jar (runtime-name: Thunderhead-POC-PDF-1.1-SNAPSHOT.jar) in 30ms

      23:07:01,559 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Starting deployment of "Thunderhead-POC-PDF-1.1-SNAPSHOT.jar" (runtime-name: "Thunderhead-POC-PDF-1.1-SNAPSHOT.jar")

      23:07:01,657 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016002: Processing weld deployment Thunderhead-POC-PDF-1.1-SNAPSHOT.jar

      23:07:01,716 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016005: Starting Services for CDI deployment: Thunderhead-POC-PDF-1.1-SNAPSHOT.jar

      23:07:01,718 INFO  [org.switchyard] (MSC service thread 1-4) Deploying SwitchYard application 'Thunderhead-POC-PDF-1.1-SNAPSHOT.jar'

      23:07:01,720 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016008: Starting weld service for deployment Thunderhead-POC-PDF-1.1-SNAPSHOT.jar

      23:07:01,764 INFO  [org.switchyard] (MSC service thread 1-4) Starting SwitchYard service

      23:07:01,768 INFO  [org.apache.camel.management.ManagementStrategyFactory] (MSC service thread 1-4) JMX enabled.

      23:07:01,771 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-4) Apache Camel 1.1.1-p5-redhat-1 (CamelContext: camel-33) is starting

      23:07:01,805 INFO  [org.apache.camel.impl.converter.DefaultTypeConverter] (MSC service thread 1-4) Loaded 181 type converters

      23:07:01,814 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-4) Total 0 routes, of which 0 is started.

      23:07:01,814 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-4) Apache Camel 1.1.1-p5-redhat-1 (CamelContext: camel-33) started in 0.043 seconds

      23:07:01,967 INFO  [org.quartz.simpl.SimpleThreadPool] (MSC service thread 1-4) Job execution threads will use class loader of thread: MSC service thread 1-4

      23:07:01,978 INFO  [org.quartz.core.SchedulerSignalerImpl] (MSC service thread 1-4) Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl

      23:07:01,979 INFO  [org.quartz.core.QuartzScheduler] (MSC service thread 1-4) Quartz Scheduler v.1.8.5 created.

      23:07:01,979 INFO  [org.quartz.simpl.RAMJobStore] (MSC service thread 1-4) RAMJobStore initialized.

      23:07:01,980 INFO  [org.quartz.core.QuartzScheduler] (MSC service thread 1-4) Scheduler meta-data: Quartz Scheduler (v1.8.5) 'DefaultQuartzScheduler-camel-33' 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.

       

       

      23:07:01,980 INFO  [org.quartz.impl.StdSchedulerFactory] (MSC service thread 1-4) Quartz scheduler 'DefaultQuartzScheduler-camel-33' initialized from an externally provided properties instance.

      23:07:01,980 INFO  [org.quartz.impl.StdSchedulerFactory] (MSC service thread 1-4) Quartz scheduler version: 1.8.5

      23:07:01,980 INFO  [org.apache.camel.component.quartz.QuartzComponent] (MSC service thread 1-4) Starting Quartz scheduler: DefaultQuartzScheduler-camel-33

      23:07:01,981 INFO  [org.quartz.core.QuartzScheduler] (MSC service thread 1-4) Scheduler DefaultQuartzScheduler-camel-33_$_NON_CLUSTERED started.

      23:07:01,982 INFO  [org.apache.camel.routepolicy.quartz.ScheduledRoutePolicy] (MSC service thread 1-4) Scheduled trigger: triggerGroup-route19.trigger-START-route19 for action: START on route route19

      23:07:02,001 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-4) Skipping starting of route route19 as its configured with autoStartup=false

      23:07:02,153 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-4) Route: direct:{urn:com.example.switchyard:Thunderhead-POC-PDF:1.0}ESBService started and consuming from: Endpoint[direct://%7Burn:com.example.switchyard:Thunderhead-POC-PDF:1.0%7DESBService]

      23:07:02,217 INFO  [org.switchyard.common.camel.SwitchYardCamelContext] (MSC service thread 1-4) Route: V1CamelJmsBindingModel/ESBService@jms1#-275801100 started and consuming from: Endpoint[jms://queue:Document.Eu.In.Deferred?connectionFactory=%23ConnectionFactory&replyTo=Document.Eu.Out.Result]

      23:07:02,319 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018565: Replaced deployment "Thunderhead-POC-PDF-1.1-SNAPSHOT.jar" with deployment "Thunderhead-POC-PDF-1.1-SNAPSHOT.jar"

       

      Iam trying similar to this http://stackoverflow.com/questions/14228786/throttling-based-on-time-interval

       

      i need to pick messages from queue only during cron trigger,but the attached component starts listening the queue once deployment is done.

       

      can you please tell me what might be the issue?

       

      Attached project.