Configuring management context
Spring Boot Actuator out of the box creates a set of management endpoints and the supporting beans in the main application context and those endpoints are available on the server.port
configured HTTP port. There are, however, cases where for security or isolation reasons we would want to separate the main application context from the management one or expose the management endpoints on a different port than the main application.
Spring Boot provides us with an ability to configure a separate child application context for the management beans, which would inherit everything from the main application context, but allow for defining beans that are only available for the management functions as well. The same goes for exposing the endpoints on a different port or even using different connector security in such a way that the main application could be using SSL, but the management endpoints are accessible using plain HTTP.
How to do it...
Let's imagine that, for whatever...