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

Quartz2 interrupt job

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.19.0
    • Component/s: camel-quartz2
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Currently there is no way to interrupt Job that was created by Quartz because of

      //org.apache.camel.component.quartz2.QuartzComponent
      protected void doStop() throws Exception {
              super.doStop();
      
              if (scheduler != null) {
                  AtomicInteger number = (AtomicInteger) scheduler.getContext().get(QuartzConstants.QUARTZ_CAMEL_JOBS_COUNT);
                  if (number != null && number.get() > 0) {
                      LOG.info("Cannot shutdown scheduler: " + scheduler.getSchedulerName() + " as there are still " + number.get() + " jobs registered.");
                  } else {
                      LOG.info("Shutting down scheduler. (will wait for all jobs to complete first.)");
                      scheduler.shutdown(true);
                      scheduler = null;
                  }
              }
          }
      

      Is this by design or it is really broken compatibility with Quartz. There is undocumented option in Quartz that you can interrupt Job:

      org.quartz.scheduler.interruptJobsOnShutdown
      

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              bkowalikpl Bartosz Kowalik
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: