alibaba/spring-cloud-alibaba · warning · IllegalArgumentException

The current actuator exists, please confirm if there is a re

Error message

The current actuator exists, please confirm if there is a repeat operation!!!

What it means

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).

Source

Thrown at spring-cloud-alibaba-starters/spring-cloud-starter-stream-rocketmq/src/main/java/com/alibaba/cloud/stream/binder/rocketmq/metrics/InstrumentationManager.java:45

public final class InstrumentationManager {

	private InstrumentationManager() {
	}

	private static final Map<Integer, Instrumentation> HEALTH_INSTRUMENTATIONS = new HashMap<>();

	public static Collection<Instrumentation> getHealthInstrumentations() {
		return HEALTH_INSTRUMENTATIONS.values();
	}

	public static void addHealthInstrumentation(Instrumentation instrumentation) {
		if (null != instrumentation) {
			HEALTH_INSTRUMENTATIONS.computeIfPresent(instrumentation.hashCode(),
					(k, v) -> {
						if (instrumentation.getActuator() != null) {
							instrumentation.getActuator().stop();
						}
						throw new IllegalArgumentException(
								"The current actuator exists, please confirm if there is a repeat operation!!!");
					});
		}

	}

}

View on GitHub (pinned to 115d590110)

Solutions

  1. Ensure each topic/component is bound once; remove duplicate bindings.
  2. If re-registering, clear the prior HEALTH_INSTRUMENTATIONS entry or stop the old component first.
  3. Investigate why two instrumentations share a hashCode (same topic + owner).
  4. Check for multiple RocketMQ binder beans / context hierarchies registering twice.
Defensive patterns

Strategy: validation

Validate before calling

// Detect duplicate before registering.
Instrumentation instrumentation = new Instrumentation(topic, owner);
int key = instrumentation.hashCode();
if (InstrumentationManager.getHealthInstrumentations().stream()
        .anyMatch(i -> i.hashCode() == key)) {
    log.warn("Duplicate instrumentation for {}; skipping registration", topic);
} else {
    InstrumentationManager.addHealthInstrumentation(instrumentation);
}

Prevention

When it happens

Trigger: addHealthInstrumentation is called with an Instrumentation whose hashCode already exists in HEALTH_INSTRUMENTATIONS (duplicate topic+binder registration).

Common situations: 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.

Related errors


AI-assisted analysis of alibaba/spring-cloud-alibaba@115d590110 (2026-08-14). Data as JSON: /api/errors/6fb40e74a2ba66b8. Report an issue: GitHub.