intermediateScheduling with @Scheduled

If you deploy 3 replicas of a service with a nightly @Scheduled job, how many times does it actually run?

Three times — once per instance, independently — since @Scheduled has no built-in cluster coordination. Running a job exactly once across a cluster requires a distributed lock (via Redis or a database row) or a dedicated clustered scheduler like Quartz.

This is a Pro chapter

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

If you deploy 3 replicas of a service with a nightly @Scheduled job, how many times does it actually run?

Next Step

Continue to Why does an @Async method silently run synchronously when called from within the same class?← Back to all Spring Boot questions