[
https://issues.apache.org/jira/browse/CAMEL-17940?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michele Blasi updated CAMEL-17940:
----------------------------------
Description:
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
was:
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.
Thanks 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: Minor
>
> 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)