apache/pulsar · error · UnsupportedAuthenticationException

Method not implemented!

Error message

Method not implemented!

What it means

Authentication.getAuthData() is a deprecated default interface method that intentionally throws UnsupportedAuthenticationException("Method not implemented!") unless an authentication plugin overrides it. Newer plugins implement getAuthData(String brokerHostName) instead, so calling the deprecated no-arg form on such a plugin lands in the default body and always fails.

Source

Thrown at pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Authentication.java:53

@InterfaceStability.Stable
public interface Authentication extends Closeable, Serializable {

    /**
     * @return the identifier for this authentication method
     */
    String getAuthMethodName();

    /**
     *
     * @return The authentication data identifying this client that will be sent to the broker
     * @throws PulsarClientException.GettingAuthenticationDataException
     *             if there was error getting the authentication data to use
     * @throws PulsarClientException
     *             any other error
     */
    @Deprecated
    default AuthenticationDataProvider getAuthData() throws PulsarClientException {
        throw new UnsupportedAuthenticationException("Method not implemented!");
    }

    /**
     * Get/Create an authentication data provider which provides the data that this client will be sent to the broker.
     * Some authentication method need to auth between each client channel. So it need the broker, who it will talk to.
     *
     * @param brokerHostName
     *          target broker host name
     *
     * @return The authentication data provider
     */
    default AuthenticationDataProvider getAuthData(String brokerHostName) throws PulsarClientException {
        return this.getAuthData();
    }

    /**
     * Configure the authentication plugins with the supplied parameters.
     *

View on GitHub (pinned to 820761864e)

Solutions

  1. Call getAuthData(String brokerHostName) on the Authentication object instead of the deprecated no-arg getAuthData().
  2. Update the custom Authentication plugin to override getAuthData(String brokerHostName).
  3. Catch UnsupportedAuthenticationException and fall back to the hostname-aware method.

Example fix

// before
AuthenticationDataProvider data = authentication.getAuthData();
// after
AuthenticationDataProvider data = authentication.getAuthData(brokerHostName);
Defensive patterns

Strategy: try-catch

Try / catch

try {
    data = authentication.getAuthData();
} catch (UnsupportedAuthenticationException e) {
    data = authentication.getAuthData(brokerHostName);
}

Prevention

When it happens

Trigger: Client or broker code calls auth.getAuthData() (the deprecated no-arg variant) on an Authentication plugin that only overrides getAuthData(String brokerHostName), e.g. custom or newer built-in plugins.

Common situations: Custom authentication code copied from old Pulsar examples calling the deprecated API; a plugin upgraded to the hostname-aware API while integration code still uses the old method.

Related errors


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