1

For Spring Boot (v2.4.2), in the Monitoring and Management over JMX section indicates:

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.

Therefore spring.jmx.enabled is false by default.

I don't understand this behavior, because for a quick SB app based on web with dev tools and actuator and even when is declared spring.jmx.enabled with false with and without Dev Tools and Actuator dependencies I always can see org.springframework.boot domain as follows:

  • spring.jmx.enabled=false and with dev tools and with Actuator

enter image description here

  • spring.jmx.enabled=false and without dev tools and with Actuator

enter image description here

  • spring.jmx.enabled=true and without dev tools and without Actuator

enter image description here

  • spring.jmx.enabled=false and without dev tools and without Actuator

enter image description here

Observation: I played around with and without Dev Tools and Actuator because I assumed that any of them were overriding internally spring.jmx.enabled to true, but it is not true as I confirmed for the latest scenario

So what should be the explicit difference to observe when spring.jmx.enabled is false and true? In the scenario shared above always appears the org.springframework.boot domain and I am able to access for all the scenarios shown above the management methods. I though that spring.jmx.enabled with false should not expose the org.springframework.boot domain from the beginning.

Manuel Jordan
  • 15,253
  • 21
  • 95
  • 158
  • 1
    How are you launching the application? The presence of the `SpringApplication` admin bean tells me that it's being launched with `spring.application.admin.enabled=true` which is usually used by tooling. – Andy Wilkinson Jan 29 '21 at 10:50
  • I am executing the App through STS with the `Boot Dashboard` view. I did not configure explicitly the `spring.application.admin.enabled` property in none place – Manuel Jordan Jan 29 '21 at 14:33
  • 1
    Documentation for this is appalling. – garryp Oct 19 '21 at 08:29

1 Answers1

3

When you launch an application in STS it sets the spring.application.admin.enabled property to true. This enables MBeans in the org.springframework.boot domain that STS uses to manage the application and to provide insights into its functionality using information retrieved from the Actuator endpoints exposed over JMX.

Manuel Jordan
  • 15,253
  • 21
  • 95
  • 158
Andy Wilkinson
  • 108,729
  • 24
  • 257
  • 242
  • So, to have the complete picture, and the reason of this confusion, if I execute the app in standalone mode (java -jar abc.jar) and no IDE involved the explanation available in the Reference documentation applies for that scenario, right? – Manuel Jordan Jan 29 '21 at 15:18