What misfire instructions do you need to be set for ImmediateTrigger?



  • I want not more than five assignments in my annex at the same time, the others to be in line and launched only after any of the five active flows are released. Here's my code:

    SchedulerFactory schedFact = new org.quartz.impl.StdSchedulerFactory("quartz.properties");
    sched = schedFact.getScheduler();
    sched.start();
    String jobName = generateJobDetailName();
    JobDetail jobDetail = new JobDetail(jobName, GRP_Immediate, MyJob.class);
    jobDetail.getJobDataMap().put(MyJob.DATA, data);
    Trigger trigger = TriggerUtils.makeImmediateTrigger(0, 0);
    trigger.setName(jobName + "_Simpletrigger");
    sched.scheduleJob(jobDetail, trigger);
    

    And the file on the line. quartz.properties:

    org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
    org.quartz.threadPool.threadCount = 5
    org.quartz.threadPool.threadPriority = 5
    

    But I can't figure out what kind things are. misfire instructionsmisfire instructions() I must set this goal. And what? misfire thresholdmisfire threshold? I would also be grateful for any references to Russian-language documentation/counsel on the topic.



  • The required behaviour was achieved after adding to the file quartz.properties rows:

    org.quartz.jobStore.misfireThreshold=1
    

    and line code:

    trigger.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_FIRE_NOW);
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2