Spring Boot Scheduling
ASecurityTreat a scheduled task as restartable and idempotent. Keep the `@Scheduled` method light, hand long-running work to `@Async` or a durable queue, and configure a dedicated `TaskScheduler` rather than relying on the default one-thread pool. Wrap the boundary in explicit failure handling: ```java @Scheduled(fixedDelayString = "${jobs.reconcile-delay}") void run() { try { reconcile(); } catch (TransientException ex) { log.warn("reconcile failed; retry will be attempted", ex); throw ex; } catch (E...
- 584 stars
- 0 votes
- 0 copies
- 3 views
- Added September 5, 2026
Security analysis
100/100Pro scans all 11 files and shows the line behind each finding
npx -y skills add HoangNguyen0403/agent-skills-standard --skill spring-boot-scheduling --agent claude-codeAre you the author of Spring Boot Scheduling?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/hoangnguyen0403-spring-boot-scheduling-b5225b2b)Treat a scheduled task as restartable and idempotent. Keep the `@Scheduled` method light, hand long-running work to `@Async` or a durable queue, and configure a dedicated `TaskScheduler` rather than relying on the default one-thread pool. Wrap the boundary in explicit failure handling:
```java
@Scheduled(fixedDelayString = "${jobs.reconcile-delay}")
void run() {
try {
reconcile();
} catch (TransientException ex) {
log.warn("reconcile failed; retry will be attempted", ex);
throw ex;
} catch (Exception ex) {
log.error("reconcile failed", ex);
}
}
```
Use `@Retryable` for bounded retries of known transient failures, with backoff; do not retry permanent validation or authorization failures. Record enough structured context to diagnose a failed run and alert after retry exhaustion. In a multi-pod deployment, use ShedLock with finite `lockAtMostFor` and suitable `lockAtLeastFor` if only one pod may execute. Test failure, retry, overlap, pod restart, and duplicate-delivery cases. Never log and silently swallow an exception without deciding whether the job is complete, retryable, or failed.
Files in this skill
- eval-1.baseline.md
- eval-1.with-skill.md
- eval-2.baseline.md
- eval-2.with-skill.md
- eval-3.baseline.md
- eval-3.with-skill.md
- trigger-1.md
- trigger-2.md
- trigger-3.md
- trigger-4.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.