---
title: "Discussion on \"Spring/Spring Boot下如何动态配置计划任务\" | Hashnode"
description: "Discussion on \"Spring/Spring Boot下如何动态配置计划任务\". 在Spring/Spring Boot下实现计划任务是很简单的，我们只需通过@EnableScheduling 开启计划任务的支持，然后通过@Scheduled 注解来制定计划任务，这样的实现解决了我们对计划任务的绝大部分需求。\n但在很多时候，通过上述方式实现的计划任务是在代码里写死的，我们需要修改计划任务只能通过修改代码的方式实现。很多时候，我们需要从外部来设置计划任务执行的时间和方式。所以在本文中，我们着重讲解一下如何动态地配置计划任务。\n和Spring对异步任务的支持一样，通过@Enabl..."
url: "https://hashnode.com/posts/spring-boot-dynamic-scheduler/635cfd8ed1ebf23070185adf"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Spring/Spring Boot下如何动态配置计划任务](https://wisely.top/spring-boot-dynamic-scheduler?utm_source=hashnode&utm_medium=feed)

在Spring/Spring Boot下实现计划任务是很简单的，我们只需通过@EnableScheduling 开启计划任务的支持，然后通过@Scheduled 注解来制定计划任务，这样的实现解决了我们对计划任务的绝大部分需求。 但在很多时候，通过上述方式实现的计划任务是在代码里写死的，我们需要修改计划任务只能通过修改代码的方式实现。很多时候，我们需要从外部来设置计划任务执行的时间和方式。所以在本文中，我们着重讲解一下如何动态地配置计划任务。 和Spring对异步任务的支持一样，通过@Enabl...

Oct 29, 2022 · 2 min read · wisely.top  
Read the article

-   [#springboot](https://hashnode.com/tag/springboot)
-   [#spring](https://hashnode.com/tag/spring)

## Written by

[yunfei wang](https://hashnode.com/@wiselyman)

@wiselyman · CN

  
[View profile](https://hashnode.com/@wiselyman)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
