Ron Dagostino created KAFKA-10556: ------------------------------------- Summary: NPE if sasl.mechanism is unrecognized Key: KAFKA-10556 URL: https://issues.apache.org/jira/browse/KAFKA-10556 Project: Kafka Issue Type: Task Reporter: Ron Dagostino Assignee: Ron Dagostino
If a client sets an unknown sasl.mechanism value (e.g. mistakenly setting "PLAN" instead of "PLAIN") the client sees a NullPointerException that only indirectly indicates the nature of the problem. For example: java.lang.NullPointerException at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.sendSaslClientToken(SaslClientAuthenticator.java:430) It is better to see an exception that directly states what the issue is. For example, the initial version of this PR would provide the following information: Caused by: org.apache.kafka.common.errors.SaslAuthenticationException: Failed to create SaslClient with mechanism PLAN -- This message was sent by Atlassian Jira (v8.3.4#803005)