Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-17940

Quartz Scheduler - unscheduleTask should check if scheduler is clustered

    XMLWordPrintableJSON

Details

    • Unknown

    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.

       

      @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);
              }
          }
      } 
      @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());
              }
          }
      } 

       

      Thanks regards

      Michele

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              3Rf0 Michele Blasi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: