4 Replies Latest reply on Feb 22, 2011 1:55 AM by labo32_delaboe

    Adapted camel-nmr example - no output

    labo32_delaboe

      Hello,

       

      I tried to adapt the camel-nmr example to use quartz for the heartbeat.

       

      I changed the timer string in beans.xml to

       

      <from uri="quartz://timerName?cron=5*+**"/>

       

      and I add a dependency

       

       

       

      to the pom.

       

      After the deployment I recognized the following in the log file:

       

       

      - 1.8.3.2 | RAMJobStore initialized.

      22:36:37,369 | INFO  | Timer-1          | QuartzScheduler                  | ?

                                       ? | 179 - org.apache.servicemix.bundles.quartz

      - 1.8.3.2 | Scheduler meta-data: Quartz Scheduler (vUNKNOWN.UNKNOWN.UNKNOWN) 'De

      faultQuartzScheduler' 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 persis

      tence. and is not clustered.

       

      and the output from the original example does not occur.

      I expected the output every 5 seconds

        • 1. Re: Adapted camel-nmr example - no output
          ffang

          Hi,

           

          Ensure you already install camel-quartz feature.

          Like

          features:install camel-quartz

           

          Btw, your cron express here seems isn't correct.

           

          Freeman

          • 2. Re: Adapted camel-nmr example - no output
            labo32_delaboe

            Hello,

             

            thanks for your response.

             

            My cron expression looks like

            <from uri="quartz://timerName?cron=5*+**"/>

            and I installed camel-quartz.

             

            Ther question is, can I use quartz in that simple way just to be a scheduler for the next component (let's say it is a better timer) or do I have to specify it in more detail in quartz.properties file and creat a bean for each job ?

            • 3. Re: Adapted camel-nmr example - no output
              ffang

              Hi,

              If I use

              (CronExpression.java:255)

                   at org.quartz.CronTrigger.setCronExpression(CronTrigger.java:471)

                   at org.apache.camel.component.quartz.QuartzComponent.createCronTrigger(QuartzComponent.java:155)

                   at org.apache.camel.component.quartz.QuartzComponent.createEndpoint(QuartzComponent.java:128)

                   at org.apache.camel.component.quartz.QuartzComponent.createEndpoint(QuartzComponent.java:54)

                   at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:75)

                   at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:431)

                   ... 28 more

               

              You just need provide correct cron expression here.

               

              Freeman

              • 4. Re: Adapted camel-nmr example - no output
                labo32_delaboe

                Sorry, my input is 5+ +* (the forum parser does not like my input).

                In the documentation http://camel.apache.org/quartz.html -> "Using Cron Triggers"

                it is mentioned that I have to put a "+" between the values but in your case

                it seems to work without.

                 

                Edited by: labo32 on Feb 22, 2011 6:54 AM

                 

                Edited by: labo32 on Feb 22, 2011 6:55 AM