{"record":{"id":"6fb40e74a2ba66b8","repo":"alibaba/spring-cloud-alibaba","slug":"the-current-actuator-exists-please-confirm-if-the","errorCode":null,"errorMessage":"The current actuator exists, please confirm if there is a repeat operation!!!","messagePattern":"The current actuator exists, please confirm if there is a repeat operation!!!","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"warning","filePath":"spring-cloud-alibaba-starters/spring-cloud-starter-stream-rocketmq/src/main/java/com/alibaba/cloud/stream/binder/rocketmq/metrics/InstrumentationManager.java","lineNumber":45,"sourceCode":"public final class InstrumentationManager {\n\n\tprivate InstrumentationManager() {\n\t}\n\n\tprivate static final Map<Integer, Instrumentation> HEALTH_INSTRUMENTATIONS = new HashMap<>();\n\n\tpublic static Collection<Instrumentation> getHealthInstrumentations() {\n\t\treturn HEALTH_INSTRUMENTATIONS.values();\n\t}\n\n\tpublic static void addHealthInstrumentation(Instrumentation instrumentation) {\n\t\tif (null != instrumentation) {\n\t\t\tHEALTH_INSTRUMENTATIONS.computeIfPresent(instrumentation.hashCode(),\n\t\t\t\t\t(k, v) -> {\n\t\t\t\t\t\tif (instrumentation.getActuator() != null) {\n\t\t\t\t\t\t\tinstrumentation.getActuator().stop();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\t\t\t\"The current actuator exists, please confirm if there is a repeat operation!!!\");\n\t\t\t\t\t});\n\t\t}\n\n\t}\n\n}\n","sourceCodeStart":27,"sourceCodeEnd":53,"githubUrl":"https://github.com/alibaba/spring-cloud-alibaba/blob/115d5901102009492e05d5ec18c3f79cad4077d0/spring-cloud-alibaba-starters/spring-cloud-starter-stream-rocketmq/src/main/java/com/alibaba/cloud/stream/binder/rocketmq/metrics/InstrumentationManager.java#L27-L53","documentation":"InstrumentationManager.addHealthInstrumentation stores Instrumentation by its hashCode in a static map. computeIfPresent fires on a collision and, when the new entry's actuator is non-null, stops it and throws IllegalArgumentException - two instrumentations produced the same hashCode, indicating a duplicate registration (same topic/component registered twice).","triggerScenarios":"addHealthInstrumentation is called with an Instrumentation whose hashCode already exists in HEALTH_INSTRUMENTATIONS (duplicate topic+binder registration).","commonSituations":"Two bindings/consumers/producers registering health instrumentation for the same logical key (e.g. same topic bound twice); restart registering again without cleanup; multiple RocketMQ binder beans in one context; an unlikely hashCode collision between distinct components.","solutions":["Ensure each topic/component is bound once; remove duplicate bindings.","If re-registering, clear the prior HEALTH_INSTRUMENTATIONS entry or stop the old component first.","Investigate why two instrumentations share a hashCode (same topic + owner).","Check for multiple RocketMQ binder beans / context hierarchies registering twice."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Detect duplicate before registering.\nInstrumentation instrumentation = new Instrumentation(topic, owner);\nint key = instrumentation.hashCode();\nif (InstrumentationManager.getHealthInstrumentations().stream()\n        .anyMatch(i -> i.hashCode() == key)) {\n    log.warn(\"Duplicate instrumentation for {}; skipping registration\", topic);\n} else {\n    InstrumentationManager.addHealthInstrumentation(instrumentation);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Bind each topic/component exactly once.","Stop/clean prior instrumentation before re-registering.","Avoid multiple binder beans for the same topics."],"tags":["rocketmq","instrumentation","health","duplicate","registration"],"backgroundTag":null,"analyzedSha":"115d5901102009492e05d5ec18c3f79cad4077d0","analyzedAt":"2026-08-14T04:47:13.900Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}