Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Quartz one time job on application startup

I am trying to integrate a Quartz job in my spring application. I got this example from here. The example shows jobs executing at repeated intervals using a simpletrigger and at a specific time using a crontrigger.

My requirement is to run the job only once on application startup. I removed the property repeatInterval, but the application throws an exception :

org.quartz.SchedulerException: Repeat Interval cannot be zero

Is there any way to schedule a job just once ?

Thanks..

like image 589
Rakesh Avatar asked Dec 27 '12 10:12

Rakesh


1 Answers

Found the answer here

Ignoring the repeatInterval and setting repeatCount = 0 does what I wanted.

like image 134
Rakesh Avatar answered Sep 20 '22 23:09

Rakesh