You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Dennis Holunder <de...@gmail.com> on 2020/02/05 08:40:24 UTC
Camel 3.0.1 quartz endpoint returns no trigger parameters
Hi,
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. Is this a bug
or is there another way to get trigger parameters?
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",
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");
}
}
The trigger in log is however correct:
INFO QuartzEndpoint - Job Camel_camel-1.job
(triggerType=CronTriggerImpl, jobClass=CamelJob) is scheduled. Next
fire date is 2020-02-05T23:59:00.000+0100