intermediate~1.5h

Scheduling with @Scheduled

Some work doesn't happen in response to a request — it happens every night at 2am, or every 30 seconds, forever. This module is how Spring Boot runs code on a clock instead of on a request.

Learning objectives

  • Beginner: Enable scheduling and write a method that runs on a fixed interval.
  • Intermediate: Use cron expressions to schedule a task for a specific time of day.
  • Advanced: Explain why the default scheduler runs single-threaded, and configure a thread pool when tasks can overlap or run long.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Spring Ecosystem Mastery library.

Scheduling with @Scheduled

Next Step

Continue to Async Programming with @Async← Back to all Spring Boot chapters