gansheer commented on issue #5088:
URL: https://github.com/apache/camel-k/issues/5088#issuecomment-1908835019
Sorry I was not clear, it is clear that there is a bug here. I am just
trying to get to it.
As @squakez suspected something is not working well with the camel-k-runtime
cron `LoaderInterceptor` that is not applied in the native mode, even with a
valid quartz expression `0 * * * * ?`.
**JVM** mode replace quartz by `timer://camel-k-cron-override` and the
cronjob is created:
```
INFO [org.apa.cam.mai.MainSupport] (main) Apache Camel (Main) 4.0.2 is
starting
INFO [org.apa.cam.k.sup.SourcesSupport] (main) Loading routes from:
SourceDefinition{name='main', language='groovy', interceptors='[cron]',
type='source', location='file:/etc/camel/sources/main.groovy', }
INFO [io.qua.qua.run.QuartzSchedulerImpl] (main) No scheduled business
methods found - Quartz scheduler will not be started
INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 4.0.2
(camel-1) is starting
INFO [org.apa.cam.com.qua.QuartzComponent] (main) Setting
org.quartz.scheduler.jmx.export=true to ensure QuartzScheduler(s) will be
enlisted in JMX
INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Routes startup
(started:2)
INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Started route1
(timer://camel-k-cron-override)
INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Started route2
(direct://start)
INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 4.0.2
(camel-1) started in 182ms (build:0ms init:0ms start:182ms)
INFO [org.apa.cam.com.qua.QuartzComponent] (main) Starting Quartz
scheduler: org.quartz.impl.StdScheduler@3b1137b0
INFO [org.apa.cam.mai.MainSupport] (camel-main) Waiting until complete:
Duration idle 5 seconds
```
**Native** mode keeps the original quartz scheduling
`quartz://Scheduler_Trigger`, even if the cronjob is created:
```
INFO [org.apa.cam.mai.MainSupport] (main) Apache Camel (Main) 4.0.2 is
starting
INFO [io.qua.qua.run.QuartzSchedulerImpl] (main) No scheduled business
methods found - Quartz scheduler will not be started
INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 4.0.2
(camel-1) is starting
INFO [org.apa.cam.com.qua.QuartzComponent] (main) Setting
org.quartz.scheduler.jmx.export=true to ensure QuartzScheduler(s) will be
enlisted in JMX
INFO [org.apa.cam.com.qua.QuartzEndpoint] (main) Job
Camel_camel-1.Scheduler_Trigger (cron=0 * * * * ?, triggerType=CronTriggerImpl,
jobClass=CamelJob) is scheduled. Next fire date is 2024-01-24T19:56:00.000+0000
INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Routes startup
(started:2)
INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Started route1
(quartz://Scheduler_Trigger)
INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Started route2
(direct://start)
INFO [org.apa.cam.imp.eng.AbstractCamelContext] (main) Apache Camel 4.0.2
(camel-1) started in 12ms (build:0ms init:0ms start:12ms)
INFO [org.apa.cam.com.qua.QuartzComponent] (main) Starting Quartz
scheduler: org.quartz.impl.StdScheduler@79a19340
INFO [io.quarkus] (main) camel-k-integration 2.3.0-SNAPSHOT native (powered
by Quarkus 3.2.9.Final) started in 0.046s.
2024-01-24 19:56:00,821 INFO [org.apa.cam.mai.MainSupport] (camel-main)
Waiting until complete: Duration idle 5 seconds
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]