Cronflower: turn a Spring Boot app into a distributed cron cluster
Описание и применение
Cronflower превращает приложение Spring Boot в отказоустойчивый кластерный планировщик задач, обеспечивая хранение состояния, повторные попытки, таймауты и обработку пропущенных запусков без внешних БД.
Задача
Spring Boot @Scheduled jobs run per JVM, causing duplicate runs, no retry, no persistence, and failures on reboot when scaling or restarting.
Результат
Cronflower transforms a Spring Boot app into a resilient, clustered cron system with persistence, retry, timeout, and misfire policies, eliminating duplicate runs and manual plumbing.
Рабочий процесс
- 1. Add Cronflower dependency to the Spring Boot project.
- 2. Annotate executor methods with @Task (cron, interval, iso, or ycron).
- 3. Configure optional attributes: maxRetryCount, retryInterval, timeout, misfirePolicy, parser, initialParameter.
- 4. Run a scheduler instance alongside the executor; multiple schedulers form a cluster with a leader.
- 5. Deploy multiple executor instances; each registers tasks with the scheduler.
- 6. Monitor tasks via the Cronflower web console (task list, execution history).
- 7. Observe retries, timeouts, and misfire handling as configured.
Доказательства
Cronflower is that whole stack, open source: a distributed, stateful scheduler for Spring Boot with a web console, that forms its own cluster and needs no external database, broker or coordinator.
Retry with back-off. Set maxRetryCount and retryInterval; a failed run is retried, and every attempt is logged.
- Дата записи: 2026-09-22T04:45:26.253Z