apache/pulsar · error · IllegalArgumentException

SameAuthParamsLookupAutoClusterFailover does not support HTT

Error message

SameAuthParamsLookupAutoClusterFailover does not support HTTP protocol pulsar service url so far.

What it means

Builder.pulsarServiceUrlArray only supports binary-protocol service URLs (pulsar:// / pulsar+ssl://). Any entry starting with http/HTTP (i.e. an HTTP lookup URL like http://broker:8080) is rejected, because this failover provider probes the binary service port.

Source

Thrown at pulsar-client/src/main/java/org/apache/pulsar/client/impl/SameAuthParamsLookupAutoClusterFailover.java:367

        public Builder markTopicNotFoundAsAvailable(boolean markTopicNotFoundAsAvailable) {
            sameAuthParamsLookupAutoClusterFailover.markTopicNotFoundAsAvailable = markTopicNotFoundAsAvailable;
            return this;
        }

        public Builder pulsarServiceUrlArray(String[] pulsarServiceUrlArray) {
            if (pulsarServiceUrlArray == null || pulsarServiceUrlArray.length == 0) {
                throw new IllegalArgumentException("pulsarServiceUrlArray can not be empty");
            }
            sameAuthParamsLookupAutoClusterFailover.pulsarServiceUrlArray = pulsarServiceUrlArray;
            int pulsarServiceLen = pulsarServiceUrlArray.length;
            HashSet<String> uniqueChecker = new HashSet<>();
            for (int i = 0; i < pulsarServiceLen; i++) {
                String pulsarService = pulsarServiceUrlArray[i];
                if (StringUtils.isBlank(pulsarService)) {
                    throw new IllegalArgumentException("pulsarServiceUrlArray contains a blank value at index " + i);
                }
                if (pulsarService.startsWith("http") || pulsarService.startsWith("HTTP")) {
                    throw new IllegalArgumentException("SameAuthParamsLookupAutoClusterFailover does not support HTTP"
                            + " protocol pulsar service url so far.");
                }
                if (!uniqueChecker.add(pulsarService)) {
                    throw new IllegalArgumentException("pulsarServiceUrlArray contains duplicated value "
                            + pulsarServiceUrlArray[i]);
                }
            }
            return this;
        }

        public SameAuthParamsLookupAutoClusterFailover build() {
            String[] pulsarServiceUrlArray = sameAuthParamsLookupAutoClusterFailover.pulsarServiceUrlArray;
            if (pulsarServiceUrlArray == null) {
                throw new IllegalArgumentException("pulsarServiceUrlArray can not be empty");
            }
            int pulsarServiceLen = pulsarServiceUrlArray.length;
            sameAuthParamsLookupAutoClusterFailover.pulsarServiceStateArray = new PulsarServiceState[pulsarServiceLen];
            sameAuthParamsLookupAutoClusterFailover.checkCounterArray = new MutableInt[pulsarServiceLen];

View on GitHub (pinned to 820761864e)

Solutions

  1. Replace each HTTP URL with the binary protocol equivalent: pulsar://host:6650 or pulsar+ssl://host:6651.
  2. Check each cluster's broker.conf (bindAddress/servicePort vs webServicePort) to get the correct binary URL.
  3. If you require HTTP-based lookup, use a different ServiceUrlProvider/mechanism — this implementation does not support it.

Example fix

// before
builder.pulsarServiceUrlArray(new String[]{"http://cluster-a:8080", "http://cluster-b:8080"});

// after
builder.pulsarServiceUrlArray(new String[]{"pulsar://cluster-a:6650", "pulsar://cluster-b:6650"});
Defensive patterns

Strategy: validation

Validate before calling

for (String url : urls) {
    if (url.toLowerCase().startsWith("http")) {
        throw new IllegalArgumentException("Use pulsar:// or pulsar+ssl:// URLs, not HTTP: " + url);
    }
}

Try / catch

try {
    builder.pulsarServiceUrlArray(urls);
} catch (IllegalArgumentException e) {
    log.error("HTTP service URL not supported by failover provider: {}", e.getMessage());
    throw new ConfigurationException("Convert http:// URLs to pulsar:// (6650) or pulsar+ssl:// (6651)", e);
}

Prevention

When it happens

Trigger: Passing an HTTP(S) service URL (http://host:8080 or https://host:8443) in the array to pulsarServiceUrlArray, commonly by reusing the webServiceUrl or brokerServiceUrl value from admin tooling.

Common situations: Copy-pasting the URL from a Pulsar admin/REST client or from a dashboard (which uses the HTTP port 8080) instead of the binary service URL (port 6650); environment-specific config where someone mixed up the two ports.

Related errors


AI-assisted analysis of apache/pulsar@820761864e (2026-09-06). Data as JSON: /api/errors/679ec255d84b3af6. Report an issue: GitHub.