[ 
https://issues.apache.org/jira/browse/CAMEL-17940?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Claus Ibsen resolved CAMEL-17940.
---------------------------------
    Fix Version/s: 3.11.7
                   3.14.3
                   3.17.0
         Assignee: Claus Ibsen
       Resolution: Fixed

Thanks for reporting and the PR

> 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
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 3.11.7, 3.14.3, 3.17.0
>
>
> 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)

Reply via email to