From 03e7be3ccf8d0d876c65c246914ecbc00cdeee80 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 12 Sep 2024 13:27:00 -0700 Subject: [PATCH] Document that spring.jmx.enabled is not for third-party libraries Closes gh-42272 --- .../springframework/boot/autoconfigure/jmx/JmxProperties.java | 2 +- .../spring-boot-docs/src/docs/asciidoc/actuator/jmx.adoc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxProperties.java index 4c4141432b30..371071efb865 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jmx/JmxProperties.java @@ -29,7 +29,7 @@ public class JmxProperties { /** - * Expose management beans to the JMX domain. + * Expose Spring's management beans to the JMX domain. */ private boolean enabled = false; diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/jmx.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/jmx.adoc index ad3a52b2a439..e50027bf668b 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/jmx.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/jmx.adoc @@ -9,6 +9,9 @@ Any of your beans that are annotated with Spring JMX annotations (`@ManagedResou If your platform provides a standard `MBeanServer`, Spring Boot uses that and defaults to the VM `MBeanServer`, if necessary. If all that fails, a new `MBeanServer` is created. +NOTE: `spring.jmx.enabled` affects only the management beans provided by Spring. +Enabling management beans provided by other libraries (for example Log4j2 or Quartz) is independent. + See the {spring-boot-autoconfigure-module-code}/jmx/JmxAutoConfiguration.java[`JmxAutoConfiguration`] class for more details. By default, Spring Boot also exposes management endpoints as JMX MBeans under the `org.springframework.boot` domain.