ueisele opened a new pull request #10935: URL: https://github.com/apache/kafka/pull/10935
In Kraft mode Apache Kafka 2.8.0 does advertise the socket port instead of the configured advertised port. A broker given with the following configuration ``` listeners=PUBLIC://0.0.0.0:19092,REPLICATION://0.0.0.0:9091 advertised.listeners=PUBLIC://envoy-kafka-broker:9091,REPLICATION://kafka-broker1:9091 ``` advertises on the _PUBLIC_ listener _envoy-kafka-broker:19092_, however I would expect that _envoy-kafka-broker:9091_ is advertised. In ZooKeeper mode it works as expected. The reason is that in the BrokerServer at the moment the socket server port is used for registration at the controller: https://github.com/apache/kafka/blob/2beaf9a720330615bc5474ec079f8b4b105eff91/core/src/main/scala/kafka/server/BrokerServer.scala#L286 In KafkaServer class which is used in ZooKeeper mode the configured advertised port is used: https://github.com/apache/kafka/blob/2beaf9a720330615bc5474ec079f8b4b105eff91/core/src/main/scala/kafka/server/KafkaServer.scala#L462 I changed the BrokerServer class, so that in Kraft mode like in ZooKeeper mode also the configured advertised port is registered. I manually tested it with a Docker-Compose setup. It basically runs 3 Kafka Broker with Apache Kafka 2.8 in Kraft mode and an Envoy proxy in front of them. With Apache Kafka 2.8.0 it does not work, because Kafka does not advertise the configured advertised port. For more details about the setup see: https://github.com/ueisele/kafka/tree/fix/kraft-advertisedlisteners-build/proxy-examples/proxyl4-kafkakraft-bug-2.8 The same Docker-Compose setup with the fix (proposed in this pull request) works and advertises the configured advertised port. For more details see: https://github.com/ueisele/kafka/tree/fix/kraft-advertisedlisteners-build/proxy-examples/proxyl4-kafkakraft-fix-2.8 At the moment there is no dedicated test for BrokerServer class. Therefore I did not create a test so far. Where such a test should be added? Is https://github.com/apache/kafka/blob/trunk/core/src/test/scala/integration/kafka/server/RaftClusterTest.scala a good place? -- 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