Polish "Add global support for JMX unique names"

This commit ensures that the new "spring.jmx.unique-names" property
deprecates the Endpoint's specific property as they share the same goal.

If both are set with an incompatible value, an exception is thrown
inviting the user to update their configuration.

Closes gh-13990
This commit is contained in:
Stephane Nicoll
2018-08-06 14:32:44 +02:00
parent 1a3f08d772
commit e6b44189e0
8 changed files with 68 additions and 19 deletions

View File

@@ -100,7 +100,7 @@ content into your application. Rather, pick only the properties that you need.
spring.jmx.default-domain= # JMX domain name.
spring.jmx.enabled=true # Expose management beans to the JMX domain.
spring.jmx.server=mbeanServer # MBeanServer bean name.
spring.jmx.unique-names=false # Set if unique runtime object names should be ensured.
spring.jmx.unique-names=false # Whether unique runtime object names should be ensured.
# Email ({sc-spring-boot-autoconfigure}/mail/MailProperties.{sc-ext}[MailProperties])
spring.mail.default-encoding=UTF-8 # Default MimeMessage encoding.
@@ -1214,7 +1214,6 @@ content into your application. Rather, pick only the properties that you need.
management.endpoints.jmx.exposure.include=* # Endpoint IDs that should be included or '*' for all.
management.endpoints.jmx.exposure.exclude= # Endpoint IDs that should be excluded or '*' for all.
management.endpoints.jmx.static-names= # Additional static properties to append to all ObjectNames of MBeans representing Endpoints.
management.endpoints.jmx.unique-names=false # Whether to ensure that ObjectNames are modified in case of conflict.
# ENDPOINTS WEB CONFIGURATION ({sc-spring-boot-actuator-autoconfigure}/endpoint/web/WebEndpointProperties.{sc-ext}[WebEndpointProperties])
management.endpoints.web.exposure.include=health,info # Endpoint IDs that should be included or '*' for all.

View File

@@ -1200,17 +1200,16 @@ The name of the MBean is usually generated from the `id` of the endpoint. For ex
`health` endpoint is exposed as `org.springframework.boot:type=Endpoint,name=Health`.
If your application contains more than one Spring `ApplicationContext`, you may find that
names clash. To solve this problem, you can set the
`management.endpoints.jmx.unique-names` property to `true` so that MBean names are always
unique.
names clash. To solve this problem, you can set the `spring.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. The following
settings show an example of doing so in `application.properties`:
[source,properties,indent=0]
----
spring.jmx.unique-names=true
management.endpoints.jmx.domain=com.example.myapp
management.endpoints.jmx.unique-names=true
----