> spring-boot-scheduling

Standards for scheduled tasks and distributed locking with ShedLock. Use when implementing @Scheduled tasks or distributed locking with ShedLock in Spring Boot. (triggers: **/*Scheduler.java, **/*Job.java, scheduled, shedlock, cron)

fetch
$curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/spring-boot-scheduling?format=md"
SKILL.mdspring-boot-scheduling

Spring Boot Scheduling Standards

Priority: P0

Implementation Guidelines

Scheduled Tasks

  • ThreadPool: ALWAYS configure a dedicated TaskScheduler (default is 1 thread).
  • Async: Keep @Scheduled methods light; offload to @Async/Queues.

Distributed Locking (ShedLock)

  • Problem: @Scheduled runs on ALL pods in K8s.
  • Solution: Use ShedLock to guarantee single execution.
  • Config: Set lockAtMostFor (deadlock safety) and lockAtLeastFor (debounce).

Anti-Patterns

  • Default Pool: **No Default Pool**: Configure ThreadPool.
  • No Locking: **No duplicates**: Use Distributed Lock.
  • Stateful Tasks: **No State**: Assume pod restarts.

References

┌ stats

installs/wk0
░░░░░░░░░░
github stars341
██████████
first seenMar 17, 2026
└────────────

┌ repo

HoangNguyen0403/agent-skills-standard
by HoangNguyen0403
└────────────

┌ tags

└────────────