我们可以在Spring启动应用程序中使用@Scheduled轻松地调度作业。
有没有办法使用任何rest端点来了解当前正在运行的调度作业?
发布于 2019-08-28 18:41:59
是的,您需要将Spring boot执行器作为您的依赖项之一。然后,您可以使用scheduledtasks端点来检查计划任务:
https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-endpoints.html
只需将以下内容添加到您的pom.xml中
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>端点位于/actuator/scheduledtasks
https://stackoverflow.com/questions/57690381
复制相似问题