spring_reference/V. Spring Boot Actuator/42.1. Customizing MBean nam...

11 lines
565 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

### 42.1. 自定义MBean名称
MBean的名称通常产生于端点的id。例如health端点被暴露为`org.springframework.boot/Endpoint/HealthEndpoint`。
如果你的应用包含多个Spring ApplicationContext你会发现存在名称冲突。为了解决这个问题你可以将`endpoints.jmx.uniqueNames`设置为true这样MBean的名称总是唯一的。
你也可以自定义JMX域所有的端点都在该域下暴露。这里有个application.properties示例
```java
endpoints.jmx.domain=myapp
endpoints.jmx.uniqueNames=true