FrankYang0529 commented on code in PR #18387:
URL: https://github.com/apache/kafka/pull/18387#discussion_r1944479557


##########
core/src/main/scala/kafka/server/KafkaConfig.scala:
##########
@@ -575,7 +585,8 @@ class KafkaConfig private(doLog: Boolean, val props: 
util.Map[_, _])
     if (advertisedListenersProp != null) {
       CoreUtils.listenerListToEndPoints(advertisedListenersProp, 
effectiveListenerSecurityProtocolMap, requireDistinctPorts=false)
     } else {
-      listeners
+      // Only use implicit broker listeners here. Implicit controller 
listeners are handled in effectiveAdvertisedControllerListeners.
+      listeners.filterNot(l => 
controllerListenerNames.contains(l.listenerName.value()))

Review Comment:
   Yes, if we return `listeners` directly, we can't know whether 
`advertisedListeners` is defined by user or implicit inherit from `listeners` 
in `effectiveAdvertisedControllerListeners`. If it's from user definition, we 
should return error. This case is included in 
`testExplicitAllBindingControllerListenersCanBeAdvertisedForKRaftController`.



-- 
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

Reply via email to