Monitoring Spring Boot via JMX

In today's day and age, the RESTful HTTP JSON services are a de facto way of accessing data but this is not the only way to do so. Another quite popular and common way of managing systems in real time is via JMX. The good news is that Spring Boot already comes with the same level of support to expose the management endpoints over JMX as it does over HTTP. Actually, these are exactly the same endpoints; they are just wrapped around the MBean container.

In this recipe, we will take a look at how to retrieve the same information via JMX as we did via HTTP as well as how to expose some MBeans, which are provided by third-party libraries through HTTP using the Jolokia JMX library.

Getting ready

If you haven't done so already ...

Get Spring Boot Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.