spring-jmx

Name for @ManagedOperation in Spring JMX

别等时光非礼了梦想. 提交于 2019-12-04 14:18:41
I used org.springframework.jmx.export.annotation.@ManagedOperation to expose a method as MBean. I want the operation name different from the method name, but managed operation doesn't have any attribute for it. For example: @ManagedOperation public synchronized void clearCache() { // do something } and I want this operation exposed with name = "ResetCache". Create a custom annotation: @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface JmxName { String value(); } And a custom subclass of MetadataMBeanInfoAssembler : public class CustomMetadataMBeanInfoAssembler

BeanCreationException: Error creating bean with name 'springApplicationAdminRegistrar'. InstanceAlreadyExistsException

半腔热情 提交于 2019-11-28 09:06:06
问题 I have 2 spring boot applications. application_A dependsn_on application_B Actually each of applications has main class marked as @SpringBootApplication application_B starts successfully but application_A doesn't start: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springApplicationAdminRegistrar' defined in class path resource [org/springframework/boot/autoconfigure/admin/SpringApplicationAdminJmxAutoConfiguration.class]: Invocation of init method