| 此版本仍在开发中,尚不被认为是稳定的。对于最新的稳定版本,请使用 Spring Boot 3.5.5! | 
计划任务 (scheduledtasks)
这scheduledtasksendpoint 提供有关应用程序的计划任务的信息。
检索计划任务
要检索计划任务,请将GET请求/actuator/scheduledtasks,如以下基于 curl 的示例所示:
$ curl 'http://localhost:8080/actuator/scheduledtasks' -i -X GET生成的响应类似于以下内容:
HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 1222
{
  "cron" : [ {
    "expression" : "0 0 0/3 1/1 * ?",
    "nextExecution" : {
      "time" : "2025-08-21T02:59:59.999100907Z"
    },
    "runnable" : {
      "target" : "com.example.Processor.processOrders"
    }
  } ],
  "custom" : [ {
    "lastExecution" : {
      "exception" : {
        "message" : "Failed while running custom task",
        "type" : "java.lang.IllegalStateException"
      },
      "status" : "ERROR",
      "time" : "2025-08-21T02:28:19.318461484Z"
    },
    "runnable" : {
      "target" : "com.example.Processor$CustomTriggeredRunnable@4dd139e0"
    },
    "trigger" : "com.example.Processor$CustomTrigger@4f63343b"
  } ],
  "fixedDelay" : [ {
    "initialDelay" : 0,
    "interval" : 5000,
    "lastExecution" : {
      "status" : "SUCCESS",
      "time" : "2025-08-21T02:28:19.286023265Z"
    },
    "nextExecution" : {
      "time" : "2025-08-21T02:28:24.307375808Z"
    },
    "runnable" : {
      "target" : "com.example.Processor.purge"
    }
  } ],
  "fixedRate" : [ {
    "initialDelay" : 10000,
    "interval" : 3000,
    "nextExecution" : {
      "time" : "2025-08-21T02:28:29.283810826Z"
    },
    "runnable" : {
      "target" : "com.example.Processor.retrieveIssues"
    }
  } ]
}响应结构
响应包含应用程序计划任务的详细信息。 下表描述了响应的结构:
| 路径 | 类型 | 描述 | 
|---|---|---|
| 
 | 
 | Cron 任务(如果有)。 | 
| 
 | 
 | 将要执行的目标。 | 
| 
 | 
 | 下一次计划执行的时间。 | 
| 
 | 
 | Cron 表达式。 | 
| 
 | 
 | 修复延迟任务(如果有)。 | 
| 
 | 
 | 将要执行的目标。 | 
| 
 | 
 | 首次执行前的延迟(以毫秒为单位)。 | 
| 
 | 
 | 下一次计划执行的时间(如果已知)。 | 
| 
 | 
 | 上次执行结束与下一次执行开始之间的间隔(以毫秒为单位)。 | 
| 
 | 
 | 固定费率任务(如果有)。 | 
| 
 | 
 | 将要执行的目标。 | 
| 
 | 
 | 每次执行开始之间的间隔(以毫秒为单位)。 | 
| 
 | 
 | 首次执行前的延迟(以毫秒为单位)。 | 
| 
 | 
 | 下一次计划执行的时间(如果已知)。 | 
| 
 | 
 | 具有自定义触发器的任务(如果有)。 | 
| 
 | 
 | 将要执行的目标。 | 
| 
 | 
 | 任务的触发器。 | 
| 
 | 
 | 此任务的最后一次执行(如果有)。 | 
| 
 | 
 | 上次执行的状态(STARTED、SUCCESS、ERROR)。 | 
| 
 | 
 | 上次执行的时间。 | 
| 
 | 
 | 任务引发的异常类型(如果有)。 | 
| 
 | 
 | 任务引发的异常消息(如果有)。 |