December 2019
Intermediate to advanced
314 pages
6h 51m
English
Besides using time expressions (s=seconds, m=minutes, h=hours, d=days), you can opt for the more compact expression of the cron scheduler. Therefore, if you wanted to fire the event every second, then you could use the following cron expression:
@Scheduled(cron="* * * * * ?")void generateToken() { token= UUID.randomUUID().toString(); log.info("New token generated");}
Check the cron main page for more information about the cron format: http://man7.org/linux/man-pages/man5/crontab.5.html.
Read now
Unlock full access