cron expression for every 30 seconds in quartz scheduler?

I hope this answer will help you. Please define the cron expression the below

 0/30 * * * * ? *

And then you go this website and test Cron Expression Generator & Explainer - Quartz.


The first element represents the seconds; to run at second 0 and 30 use the following:

<cron-expression>0/30 0/1 * 1/1 * ? *</cron-expression>

The same effect we can reach (Quartz Spring) using more simpler construction:

0/30 * * * * ? *

The last asterisk we can omit.

0/30 * * * * ?

Quartz scheduler cron trigger documentation 2.x