I have 2 spring boot applications.
application_A dependsn_on application_B
Actually each of applications has main class marked as @SpringBootApplicatio
The SpringApplicationAdminJmxAutoConfiguration
has the code like:
String jmxName = this.environment.getProperty(JMX_NAME_PROPERTY,
DEFAULT_JMX_NAME);
if (this.mbeanExporters != null) { // Make sure to not register that MBean twice
for (MBeanExporter mbeanExporter : this.mbeanExporters) {
mbeanExporter.addExcludedBean(jmxName);
}
}
return new SpringApplicationAdminMXBeanRegistrar(jmxName);
Where we have those constants:
/**
* The property to use to customize the {@code ObjectName} of the application admin
* mbean.
*/
private static final String JMX_NAME_PROPERTY = "spring.application.admin.jmx-name";
/**
* The default {@code ObjectName} of the application admin mbean.
*/
private static final String DEFAULT_JMX_NAME = "org.springframework.boot:type=Admin,name=SpringApplication";
So, you should consider to make that jmx-name
as unique for each application. I mean you need specify spring.application.admin.jmx-name
configuration property.