对于 Spring Boot (v2.4.2),在通过 JMX 进行监控和管理 https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-features.html#production-ready-jmx部分表明:
Java Management Extensions (JMX) provide a standard mechanism to monitor and manage applications.
By default, this feature is not enabled and can be turned on by setting the configuration property
spring.jmx.enabled to true. Spring Boot exposes management endpoints as JMX MBeans under
the org.springframework.boot domain by default.
所以spring.jmx.enabled
is false默认情况下。
我不理解这种行为,因为对于带有开发工具和执行器的基于网络的快速 SB 应用程序,甚至在声明时spring.jmx.enabled
with false有和没有Dev Tools
and Actuator
我总是可以看到依赖关系org.springframework.boot
域如下:
-
spring.jmx.enabled=false
与dev tools
与Actuator
-
spring.jmx.enabled=false
并且没有dev tools
与Actuator
-
spring.jmx.enabled=true
并且没有dev tools
并且没有Actuator
-
spring.jmx.enabled=false
并且没有dev tools
并且没有Actuator
观察:我在使用或不使用开发工具和执行器的情况下进行了尝试,因为我认为它们中的任何一个都会在内部被覆盖spring.jmx.enabled
to true,但正如我针对最新情况所确认的那样,情况并非如此
那么,当spring.jmx.enabled
is false and true?在上面分享的场景中总是出现org.springframework.boot
域,我能够访问管理方法上面显示的所有场景。我虽然认为spring.jmx.enabled
与错误的应该not暴露org.springframework.boot
从头开始的域。
当您在 STS 中启动应用程序时,它会设置spring.application.admin.enabled
财产给true
。这使得 MBean 能够在org.springframework.boot
STS 用于管理应用程序的域,并使用从通过 JMX 公开的 Actuator 端点检索的信息来深入了解其功能。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)