Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15205

camel-quartz documentation for Cron is incorrect

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.3.0
    • Fix Version/s: 3.5.0
    • Component/s: camel-quartz
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      The current documentation says for cron job the spaces needs to replaced by +. However that does not seem to be the case as of the latest release. If you specify + instead of blank it throws a runtime error 

       

      Caused by: java.lang.RuntimeException: CronExpression '#  0 1 6-18 ? * *' is invalid.Caused by: java.lang.RuntimeException: CronExpression '#  0 1 6-18 ? * *' is invalid. at org.quartz.CronScheduleBuilder.cronSchedule(CronScheduleBuilder.java:111) at org.apache.camel.component.quartz.QuartzEndpoint.createTrigger(QuartzEndpoint.java:485) at org.apache.camel.component.quartz.QuartzEndpoint.addJobInScheduler(QuartzEndpoint.java:372) at org.apache.camel.component.quartz.QuartzEndpoint.doStart(QuartzEndpoint.java:328) at org.apache.camel.support.service.BaseService.start(BaseService.java:115) at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:84) at org.apache.camel.impl.engine.RouteService.doWarmUp(RouteService.java:141) at org.apache.camel.impl.engine.RouteService.warmUp(RouteService.java:123) ... 13 moreCaused by: java.text.ParseException: Unexpected character: # at org.quartz.CronExpression.storeExpressionVals(CronExpression.java:697) at org.quartz.CronExpression.buildExpression(CronExpression.java:487) at org.quartz.CronExpression.<init>(CronExpression.java:276) at org.quartz.CronScheduleBuilder.cronSchedule(CronScheduleBuilder.java:107) ... 20 more

      The documentation is wrong  and it should be regular cron format all works well. 

       

      The Bad:

      from(quartz("myQuartz").cron("0+1+6-18+?")).to(mock("direct"))

      The Good

      from(quartz("myQuartz").cron("0 0 6,18 ? * *")).to(mock("direct"))

       

       

       

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              drkaleem kaleem ahmed
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: