[
https://issues.apache.org/jira/browse/CAMEL-17940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17520740#comment-17520740
]
Michele Blasi commented on CAMEL-17940:
---------------------------------------
Hi Claus,
I have created a Github PR, I hope that can be useful for you.
Regards,
Michele
> Quartz Scheduler - unscheduleTask should check if scheduler is clustered
> ------------------------------------------------------------------------
>
> Key: CAMEL-17940
> URL: https://issues.apache.org/jira/browse/CAMEL-17940
> Project: Camel
> Issue Type: Bug
> Components: camel-quartz, camel-quartz2
> Affects Versions: 3.15.0
> Reporter: Michele Blasi
> Priority: Major
>
> Hello everybody,
> when we are in a clustered environment and we want use quartz scheduler to
> poll our directories, there is a wrong behaviour when a single node shutting
> down. In the class *QuartzScheduledPollConsumerScheduler* the method
> *unscheduleTask* does not perform the same checks that are done by the
> *doStop* method, causing the deletion of the triggers that should be used by
> the node still running.
>
> {code:java}
> @Override
> public void unscheduleTask() {
> if (trigger != null) {
> LOG.debug("Unscheduling trigger: {}", trigger.getKey());
> try {
> quartzScheduler.unscheduleJob(trigger.getKey());
> } catch (SchedulerException e) {
> throw RuntimeCamelException.wrapRuntimeCamelException(e);
> }
> }
> } {code}
> {code:java}
> @Override
> protected void doStop() throws Exception {
> if (trigger != null && deleteJob) {
> boolean isClustered =
> quartzScheduler.getMetaData().isJobStoreClustered();
> if (!quartzScheduler.isShutdown() && !isClustered) {
> LOG.info("Deleting job {}", trigger.getKey());
> quartzScheduler.unscheduleJob(trigger.getKey());
> }
> }
> } {code}
>
> Thanks regards
> Michele
--
This message was sent by Atlassian Jira
(v8.20.1#820001)