Is it 开发者_运维知识库possible to have Java Quartz threads run each second, or even by milliseconds? It seems like they can only run by the minute and nothing less.
Yes, you can make them run every second.
Take a look at TriggerUtils.makeSecondlyTrigger:
Make a trigger that will fire every second, indefinitely.
Or use a CronTrigger:
new CronTrigger("cronTrigger","group","* * * * * ?"); //fire at every second daily
Yes.
You need to go for Simple Trigger
trigger that fires immediately, then repeats every X mills, forever
SimpleTrigger trigger = new SimpleTrigger("myTrigger",
null,
new Date(),
null,
SimpleTrigger.REPEAT_INDEFINITELY,
X);
Note: Where X is long type,
for example : if X=1000L then per second
精彩评论