overview

Origin

The most commonly used timing task in Java is probably quartz. However, this framework is too large, and I don’t need to use so many things. The usage method is also relatively complex (I’m speechless about the official Demo…).

People who have used Linux’s crontab know that its timing expression can define timing tasks very flexibly in terms of time and frequency (Linux’s crontab is accurate to the minute, while Quartz is accurate to the second, but for me, accuracy to the minute is sufficient, and accuracy to the second can be achieved using Timer). Then there’s the charming crontab configuration file, which clearly lists the scheduling tasks, which I also like. (I remember being confused by the XML when integrating Quartz with Spring…). So Hutool-cron was born.

Introduction

Hutool’s timing task module is very similar to Linux’s Crontab in usage. By using a cron.setting configuration file and simply calling the start() method, it can be easily used.

At the same time, it also provides features such as second matching and year matching that are only available in Quartz. The timing task expression is also compatible with both Crontab (Cron4j) and Quartz expressions.