brandboat commented on code in PR #22531:
URL: https://github.com/apache/kafka/pull/22531#discussion_r3488008474


##########
core/src/main/scala/kafka/server/ControllerServer.scala:
##########
@@ -206,6 +207,16 @@ class ControllerServer(
 
       sharedServer.startForController(listenerInfo)
 
+      raftManager.client.setNodeEndpointProvider { nodeId =>
+        Option(registrationsPublisher.controllers().get(nodeId)).map { 
registration =>
+          val endpoints = registration.listeners().asScala.map { case 
(listenerName, endpoint) =>
+            ListenerName.normalised(listenerName) ->
+              InetSocketAddress.createUnresolved(endpoint.host(), 
endpoint.port())
+          }.asJava
+          Endpoints.fromInetSocketAddresses(endpoints)
+        }.getOrElse(Endpoints.empty())
+      }
+

Review Comment:
   Sure, sounds good to me, that make the implementation much cleaner, thanks 
for the suggestion



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