Alex Rivera | Logout

How to run every 25 seconds in Quartz scheduler?

Asked 2011-06-06T23:14:47.193
16

I am using the Quartz Scheduling API for Java. Could you help me to run every 25 seconds using cron-expression. It's just a delay. It does not have to start always at second 0. For example, the sequence is like this: 0:00, 0:25, 0:50, 1:15, 1:40, 2:05, etc until minute 5 when the sequence begins again at second 0. Thank you.

Edit
Report

2 Answers

17

I don't think cron expression will allow you to do that, but you can use

SimpleScheduleBuilder.repeatSecondlyForever( 25 )

as 300 (5 minutes) is a multiple of 25 it will repeat automatically.

answered 2011-06-07T18:56:17.810
0

You can't have a schedule like that for quartz.

One thing you could do is schedule a wrapper job to run every 5 seconds, and only do any work every fifth execution.

answered 2011-06-07T00:06:42.013

Your Answer