Monitoring and management over JMX
Java Management Extensions (JMX) provide a standard mechanism to monitor and manage
applications. By default Spring Boot will expose management endpoints as JMX MBeans
under the org.springframework.boot
domain.
Customizing MBean names
The name of the MBean is usually generated from the id
of the endpoint. For example
the health
endpoint is exposed as org.springframework.boot/Endpoint/healthEndpoint
.
If your application contains more than one Spring ApplicationContext
you may find that
names clash. To solve this problem you can set the endpoints.jmx.unique-names
property
to true
so that MBean names are always unique.
You can also customize the JMX domain under which endpoints are exposed. Here is an
example application.properties
:
endpoints.jmx.domain=myapp
endpoints.jmx.unique-names=true
Disabling JMX endpoints
If you don’t want to expose endpoints over JMX you can set the endpoints.jmx.enabled
property to false
:
endpoints.jmx.enabled=false
Using Jolokia for JMX over HTTP
Jolokia is a JMX-HTTP bridge giving an alternative method of accessing JMX beans. To
use Jolokia, simply include a dependency to org.jolokia:jolokia-core
. For example,
using Maven you would add the following:
<dependency>
<groupId>org.jolokia</groupId>
<artifactId>jolokia-core</artifactId>
</dependency>
Jolokia can then be accessed using /jolokia
on your management HTTP server.