This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Boot 3.4.1! |
Scheduled Tasks (scheduledtasks
)
The scheduledtasks
endpoint provides information about the application’s scheduled tasks.
Retrieving the Scheduled Tasks
To retrieve the scheduled tasks, make a GET
request to /actuator/scheduledtasks
, as shown in the following curl-based example:
$ curl 'http://localhost:8080/actuator/scheduledtasks' -i -X GET
The resulting response is similar to the following:
HTTP/1.1 200 OK
Content-Type: application/vnd.spring-boot.actuator.v3+json
Content-Length: 1222
{
"cron" : [ {
"runnable" : {
"target" : "com.example.Processor.processOrders"
},
"expression" : "0 0 0/3 1/1 * ?",
"nextExecution" : {
"time" : "2024-12-20T14:59:59.999554047Z"
}
} ],
"fixedDelay" : [ {
"runnable" : {
"target" : "com.example.Processor.purge"
},
"initialDelay" : 0,
"interval" : 5000,
"nextExecution" : {
"time" : "2024-12-20T14:39:21.353482534Z"
},
"lastExecution" : {
"time" : "2024-12-20T14:39:16.340366941Z",
"status" : "SUCCESS"
}
} ],
"fixedRate" : [ {
"runnable" : {
"target" : "com.example.Processor.retrieveIssues"
},
"initialDelay" : 10000,
"interval" : 3000,
"nextExecution" : {
"time" : "2024-12-20T14:39:26.325047750Z"
}
} ],
"custom" : [ {
"runnable" : {
"target" : "com.example.Processor$CustomTriggeredRunnable@5097638e"
},
"trigger" : "com.example.Processor$CustomTrigger@5fbd0979",
"lastExecution" : {
"exception" : {
"message" : "Failed while running custom task",
"type" : "java.lang.IllegalStateException"
},
"time" : "2024-12-20T14:39:16.398769365Z",
"status" : "ERROR"
}
} ]
}
Response Structure
The response contains details of the application’s scheduled tasks. The following table describes the structure of the response:
Path | Type | Description |
---|---|---|
|
|
Cron tasks, if any. |
|
|
Target that will be executed. |
|
|
Time of the next scheduled execution. |
|
|
Cron expression. |
|
|
Fixed delay tasks, if any. |
|
|
Target that will be executed. |
|
|
Delay, in milliseconds, before first execution. |
|
|
Time of the next scheduled execution, if known. |
|
|
Interval, in milliseconds, between the end of the last execution and the start of the next. |
|
|
Fixed rate tasks, if any. |
|
|
Target that will be executed. |
|
|
Interval, in milliseconds, between the start of each execution. |
|
|
Delay, in milliseconds, before first execution. |
|
|
Time of the next scheduled execution, if known. |
|
|
Tasks with custom triggers, if any. |
|
|
Target that will be executed. |
|
|
Trigger for the task. |
|
|
Last execution of this task, if any. |
|
|
Status of the last execution (STARTED, SUCCESS, ERROR). |
|
|
Time of the last execution. |
|
|
Exception type thrown by the task, if any. |
|
|
Message of the exception thrown by the task, if any. |