You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/03/02 18:27:47 UTC
[GitHub] [kafka] kirktrue commented on a change in pull request #11831: MINOR: Do not throw exception when InterBrokerSecurityProtocolProp value is empty string
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: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org