alibaba/Sentinel · error · IllegalStateException

Publisher type is not supported: ${canonicalName}

Error message

Publisher type is not supported: ${canonicalName}

What it means

SentinelReactorTransformer.apply() only knows how to wrap Mono and Flux publishers; any other reactive-streams Publisher implementation gets IllegalStateException with the offending class's canonical name. The transformer is what SphU.entry-compatible Reactor integration (SentinelReactorTransformer / Mono.from(...).transform(...)) uses to insert resource entry/exit around the stream.

Source

Thrown at sentinel-adapter/sentinel-reactor-adapter/src/main/java/com/alibaba/csp/sentinel/adapter/reactor/SentinelReactorTransformer.java:54

    public SentinelReactorTransformer(String resourceName) {
        this(new EntryConfig(resourceName));
    }

    public SentinelReactorTransformer(EntryConfig entryConfig) {
        AssertUtil.notNull(entryConfig, "entryConfig cannot be null");
        this.entryConfig = entryConfig;
    }

    @Override
    public Publisher<T> apply(Publisher<T> publisher) {
        if (publisher instanceof Mono) {
            return new MonoSentinelOperator<>((Mono<T>) publisher, entryConfig);
        }
        if (publisher instanceof Flux) {
            return new FluxSentinelOperator<>((Flux<T>) publisher, entryConfig);
        }

        throw new IllegalStateException("Publisher type is not supported: " + publisher.getClass().getCanonicalName());
    }
}

View on GitHub (pinned to a3f40ba8e9)

Solutions

  1. Convert the publisher first: use Flux.from(publisher) or Mono.from(publisher) before applying the transformer
  2. If using RxJava, convert via Flux.from(flowable) / adapters from reactor-extra or RxReactorStreams
  3. Check that the value passed to .transform() is the Sentinel transformer and the source is a Mono/Flux, not the reverse

Example fix

// before
Publisher<String> raw = myCustomPublisher();
raw.transform(new SentinelReactorTransformer<>(config));

// after
Flux<String> safe = Flux.from(myCustomPublisher());
safe.transform(new SentinelReactorTransformer<>(config));
Defensive patterns

Strategy: type-guard

Type guard

Publisher<T> p = source;
if (!(p instanceof Mono) && !(p instanceof Flux)) {
    p = Flux.from(p); // normalize to a supported type
}
// now safe to apply the transformer

Prevention

When it happens

Trigger: Applying SentinelReactorTransformer to a Publisher that is neither Mono nor Flux, e.g. a custom Publisher implementation, an RxJava-to-Reactor bridged publisher, or a Processor used as the source passed to .transform().

Common situations: Using .transform(new SentinelReactorTransformer<>(config)) directly on a raw Publisher/Processor; mixing RxJava 3 (Flowable) types with the Reactor adapter; upgrading reactor-core where a returned type no longer extends Mono/Flux.

Related errors


AI-assisted analysis of alibaba/Sentinel@a3f40ba8e9 (2026-08-14). Data as JSON: /api/errors/a572f732b515e936. Report an issue: GitHub.