C0urante commented on code in PR #13375:
URL: https://github.com/apache/kafka/pull/13375#discussion_r1145044422


##########
core/src/test/java/kafka/testkit/KafkaClusterTestKit.java:
##########
@@ -174,13 +174,17 @@ private KafkaConfig createNodeConfig(TestKitNode node) {
                 props.put(KafkaConfig$.MODULE$.LogDirsProp(),
                         String.join(",", brokerNode.logDataDirectories()));
             }
-            props.put(KafkaConfig$.MODULE$.ListenerSecurityProtocolMapProp(),
-                    "EXTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT");
-            props.put(KafkaConfig$.MODULE$.ListenersProp(), 
listeners(node.id()));
-            props.put(KafkaConfig$.MODULE$.InterBrokerListenerNameProp(),
-                    nodes.interBrokerListenerName().value());
-            props.put(KafkaConfig$.MODULE$.ControllerListenerNamesProp(),
-                    "CONTROLLER");
+
+            // listeners could be defined via Builder::setConfigProp which 
shouldn't be overridden
+            if (!props.containsKey(KafkaConfig$.MODULE$.ListenersProp())) {

Review Comment:
   Note: if we go that route, we should probably also tweak the logic for 
[EmbeddedKafkaCluster::sslEnabled](https://github.com/apache/kafka/blob/6939445ae9d906144726ad08ea826f7ed6074adc/connect/runtime/src/test/java/org/apache/kafka/connect/util/clusters/EmbeddedKafkaCluster.java#L304-L307)
 to handle when SSL is enabled by changing the listener security protocol map 
(instead of changing the listeners prop). One quick-and-dirty way to do this:
   
   ```java
   public boolean sslEnabled() {
       final String listeners = 
brokerConfig.getProperty(KafkaConfig.ListenersProp());
       final String protocolMap = 
brokerConfig.getProperty(KafkaConfig.ListenerSecurityProtocolMapProp());
       return (listeners != null && listeners.contains("SSL")) || (protocolMap 
!= null && protocolMap.contains("SSL"));
   }
   ```



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