kirktrue commented on a change in pull request #11831:
URL: https://github.com/apache/kafka/pull/11831#discussion_r817982759



##########
File path: core/src/main/scala/kafka/server/KafkaConfig.scala
##########
@@ -1928,9 +1928,11 @@ class KafkaConfig private(doLog: Boolean, val props: 
java.util.Map[_, _], dynami
 
   private def getInterBrokerListenerNameAndSecurityProtocol: (ListenerName, 
SecurityProtocol) = {
     Option(getString(KafkaConfig.InterBrokerListenerNameProp)) match {
-      case Some(_) if 
originals.containsKey(KafkaConfig.InterBrokerSecurityProtocolProp) =>
-        throw new ConfigException(s"Only one of 
${KafkaConfig.InterBrokerListenerNameProp} and " +
-          s"${KafkaConfig.InterBrokerSecurityProtocolProp} should be set.")
+      case Some(_) if 
originals.containsKey(KafkaConfig.InterBrokerSecurityProtocolProp) &&
+        getString(KafkaConfig.InterBrokerSecurityProtocolProp).nonEmpty =>
+          throw new ConfigException(s"Only one of 
${KafkaConfig.InterBrokerListenerNameProp} : " +
+            s"${getString(KafkaConfig.InterBrokerListenerNameProp)} and 
${KafkaConfig.InterBrokerSecurityProtocolProp} : " +

Review comment:
       Bikeshedding comment:
   
   Would it be possible to change line 1931 from `Some(_)` to `Some(foo)` and 
then use the variable on line 1934? Just wondering if that improves readability?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to