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
- Call getAuthData(String brokerHostName) on the Authentication object instead of the deprecated no-arg getAuthData().
- Update the custom Authentication plugin to override getAuthData(String brokerHostName).
- 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
- Prefer getAuthData(String brokerHostName) over the deprecated no-arg method.
- Ensure custom Authentication plugins override the hostname-aware getAuthData.
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
- Another partition exists for [${topicName}].
- Invalid combination of Original principal cannot be empty if
- Need to authenticate to perform the request
- Not supported
- Unsupported authentication method: [${authMethodName}].
AI-assisted analysis of apache/pulsar@820761864e (2026-09-06).
Data as JSON: /api/errors/3fa115607ee3e6a5.
Report an issue: GitHub.