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

QuartzEndpoint returns no trigger parameters

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.0.1
    • 3.1.0
    • camel-quartz
    • None
    • Unknown

    Description

      In my route I have to evaluate configuration of cron parameters at runtime. With Camel 2.x it worked, but in camel 3 QuartzEndpoint.getTriggerParameters returns empty map.

      In Example below it should contain timeZone parameter, but is empty.

      public class MyRoute extends RouteBuilder {
          @Override
          public void configure() throws Exception {
              String cron = String.format("quartz://job?cron=0+%s+%s+?+*+*&trigger.timeZone=%s&trigger.misfireInstruction=2", 59, 23, "Europe/Berlin");
      
              from(cron).routeId("cron").log("running ${body}").id("cronlog");  
      
            from("timer://foo?fixedRate=true&period=300s&delay=1s")
                      .routeId("start")
                      .process(exchange -> {
                          QuartzEndpoint endPoint =
      getContext().getEndpoint(cron, QuartzEndpoint.class);
                          Map<String, Object> triggers =
      endPoint.getTriggerParameters();
                          exchange.getIn().setBody(triggers.get("timeZone"));
                      })
                      .log("running ${body}").id("timerlog");
          }
      }
      

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            Holu Dennis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: