From 41e9ff6b26b023795259bd6e50eeae4c47627bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edd=C3=BA=20Mel=C3=A9ndez?= Date: Thu, 7 Nov 2024 17:50:00 -0600 Subject: [PATCH] Fix listeners to make it compatible with Apache Kafka 3.9.0 Fixes #9506 --- .../src/main/java/org/testcontainers/kafka/KafkaHelper.java | 5 +---- .../java/org/testcontainers/kafka/KafkaContainerTest.java | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/kafka/src/main/java/org/testcontainers/kafka/KafkaHelper.java b/modules/kafka/src/main/java/org/testcontainers/kafka/KafkaHelper.java index 00b10a4d519..2de86af2402 100644 --- a/modules/kafka/src/main/java/org/testcontainers/kafka/KafkaHelper.java +++ b/modules/kafka/src/main/java/org/testcontainers/kafka/KafkaHelper.java @@ -37,10 +37,7 @@ static Map envVars() { Map envVars = new HashMap<>(); envVars.put("CLUSTER_ID", DEFAULT_CLUSTER_ID); - envVars.put( - "KAFKA_LISTENERS", - "PLAINTEXT://0.0.0.0:" + KAFKA_PORT + ",BROKER://0.0.0.0:9093,CONTROLLER://0.0.0.0:9094" - ); + envVars.put("KAFKA_LISTENERS", "PLAINTEXT://:" + KAFKA_PORT + ",BROKER://:9093,CONTROLLER://:9094"); envVars.put( "KAFKA_LISTENER_SECURITY_PROTOCOL_MAP", "BROKER:PLAINTEXT,PLAINTEXT:PLAINTEXT,CONTROLLER:PLAINTEXT" diff --git a/modules/kafka/src/test/java/org/testcontainers/kafka/KafkaContainerTest.java b/modules/kafka/src/test/java/org/testcontainers/kafka/KafkaContainerTest.java index b1764d3b522..3c069d8be68 100644 --- a/modules/kafka/src/test/java/org/testcontainers/kafka/KafkaContainerTest.java +++ b/modules/kafka/src/test/java/org/testcontainers/kafka/KafkaContainerTest.java @@ -13,7 +13,7 @@ public class KafkaContainerTest extends AbstractKafka { @Test public void testUsage() throws Exception { try ( // constructorWithVersion { - KafkaContainer kafka = new KafkaContainer("apache/kafka-native:3.8.0") + KafkaContainer kafka = new KafkaContainer("apache/kafka-native:3.9.0") // } ) { kafka.start();