Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 如何知道spring boot应用程序中正在运行的计划作业?_Spring Boot_Spring Scheduled - Fatal编程技术网

Spring boot 如何知道spring boot应用程序中正在运行的计划作业?

Spring boot 如何知道spring boot应用程序中正在运行的计划作业?,spring-boot,spring-scheduled,Spring Boot,Spring Scheduled,我们可以在Spring boot应用程序中使用@Scheduled轻松调度作业 是否有任何方法可以使用任何rest端点了解当前正在运行的计划作业?是的,您需要将Spring boot actuator作为依赖项之一。然后,您可以使用scheduledtasks端点检查计划任务: 只需将以下内容添加到pom.xml中 <dependency> <groupId>org.springframework.boot</groupId>

我们可以在Spring boot应用程序中使用@Scheduled轻松调度作业


是否有任何方法可以使用任何rest端点了解当前正在运行的计划作业?

是的,您需要将Spring boot actuator作为依赖项之一。然后,您可以使用scheduledtasks端点检查计划任务:

只需将以下内容添加到pom.xml中

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

org.springframework.boot
弹簧靴起动器执行器

端点在/exactor/scheduledtasks中可用

它在spring boot 1.5.18.RELEASE中可用吗?它在1.5.18.RELEASE中可用。我相信是的,但路径的执行器部分是在2.0中引入的,因此,当您启动spring boot应用程序时,所有端点都应该在控制台中列出(从2.0开始,它们不再列出)。我记不起1.5.18的确切端点(我们现在的版本是2.17.RELEASE),但是如果您阅读控制台输出,您应该会发现它列在那里。