RivenSun2 commented on code in PR #12010: URL: https://github.com/apache/kafka/pull/12010#discussion_r856210085
########## clients/src/main/java/org/apache/kafka/clients/CommonClientConfigs.java: ########## @@ -203,4 +205,15 @@ public static Map<String, Object> postProcessReconnectBackoffConfigs(AbstractCon } return rval; } + + public static void postValidateSaslMechanismConfig(AbstractConfig config) { + SecurityProtocol securityProtocol = SecurityProtocol.forName(config.getString(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG)); + String clientSaslMechanism = config.getString(SaslConfigs.SASL_MECHANISM); + if (securityProtocol == SecurityProtocol.SASL_PLAINTEXT || securityProtocol == SecurityProtocol.SASL_SSL) { + if (clientSaslMechanism == null || clientSaslMechanism.trim().isEmpty()) { + throw new ConfigException(SaslConfigs.SASL_MECHANISM, null, "When the " + CommonClientConfigs.SECURITY_PROTOCOL_CONFIG + + " configuration enables the SASL mechanism, mechanism must be non-null or non-empty string."); Review Comment: thanks -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org