用于命令行运行器应用程序的 Spring Boot 执行器

2024-02-09

我想在 PCF 中为非 Web、批处理或 commandLineRunner Spring Boot 应用程序启用执行器进行运行状况检查。

有人可以分享一些细节来解决这个问题吗?

如果需要任何其他详细信息,请告诉我

我尝试了以下选项

添加执行器依赖项 添加http和jmx相关属性

由于 localhost:8081/actuator 不可访问,无法查看端点

如何为非 Web 应用程序启用 url


add

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

应用程序属性

spring.jmx.enabled = true
management.endpoints.jmx.exposure.include=*
management.endpoints.jmx.domain=com.example.demomail
management.endpoints.jmx.unique-names=true

run jconsole找到您的应用程序名称然后连接。

查找选项卡MBeans, find com.example.demomail在左边的树中。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

用于命令行运行器应用程序的 Spring Boot 执行器 的相关文章

随机推荐