我只想同时执行 5 个作业。如果由于缺少空闲线程而无法启动作业,我希望它在空闲线程出现时启动,并且只有一次。这是我的代码:
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);
这是我的quartz.properties
文件:
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 5
org.quartz.threadPool.threadPriority = 5
但是有一点我无法理解。misfire instruction
我需要为所需的行为设置什么样的?