Croway opened a new pull request, #30236:
URL: https://github.com/apache/camel/pull/30236

   JIRA: [CAMEL-27077](https://issues.apache.org/jira/browse/CAMEL-27077)
   
   - With a Quartz `Scheduler` set on the quartz component or autowired from 
the registry (such as the scheduler of `spring-boot-starter-quartz`), the 
component stored the CamelContext in the scheduler context only in 
`onCamelContextFullyStarted`, while the endpoints add their jobs when they 
start. Spring starts that scheduler before Camel, so a trigger that fired in 
between failed with `No CamelContext could be found with name: ...` and the 
fire was lost.
   - `QuartzComponent.doStart` now stores the CamelContext in such a scheduler, 
before the endpoints add their jobs. A scheduler the component creates is not 
changed.
   - The component logs a WARN when that scheduler is already running when it 
starts: a trigger that fires before its route has started is still lost, and 
`spring.quartz.auto-startup=false` lets Camel start the scheduler once the 
routes have started. No WARN for a scheduler the component started itself (a 
restart of the CamelContext).
   - It logs a WARN when `properties`, `propertiesRef` or `propertiesFile` are 
set together with such a scheduler, as they are not used.
   - New section "Using your own scheduler (spring-boot-starter-quartz)" in 
`quartz-component.adoc` (and the catalog copy).
   
   Tests: `QuartzInjectedSchedulerTest`. 
`runningInjectedSchedulerRunsJobThatFiresBeforeCamelContextIsFullyStarted` and 
`warnsWhenPropertiesAreSetWithInjectedScheduler` fail before the fix (`No 
CamelContext could be found with name: camel-8`; no WARN) and pass after. The 3 
controls (scheduler not started, scheduler of the component, properties without 
an injected scheduler) pass both ways. All camel-quartz tests pass (131).
   
   Upgrade guide: `camel-4x-upgrade-guide-4_24.adoc`, "camel-quartz - a 
scheduler from the registry gets the CamelContext when the component starts".
   
   _Claude Code on behalf of Federico Mariani_
   


-- 
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]

Reply via email to