From be1b9f92f2f32b39d08c0683ec48e61f7f5722ba Mon Sep 17 00:00:00 2001 From: Raja Kolli Date: Wed, 26 Jun 2024 14:36:05 +0000 Subject: [PATCH] Revert "feat : migrate to use official apache kafka image" This reverts commit 4c63b48dc9e262967077d0c4d9bfb5a9df1b79c9. --- .../catalogservice/TestCatalogServiceApplication.java | 5 +++-- .../example/inventoryservice/TestInventoryApplication.java | 5 +++-- .../example/orderservice/TestOrderServiceApplication.java | 5 +++-- .../com/example/paymentservice/TestPaymentApplication.java | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/catalog-service/src/test/java/com/example/catalogservice/TestCatalogServiceApplication.java b/catalog-service/src/test/java/com/example/catalogservice/TestCatalogServiceApplication.java index 1330a2e0..e60f9beb 100644 --- a/catalog-service/src/test/java/com/example/catalogservice/TestCatalogServiceApplication.java +++ b/catalog-service/src/test/java/com/example/catalogservice/TestCatalogServiceApplication.java @@ -12,8 +12,8 @@ Licensed under MIT License Copyright (c) 2023-2024 Raja Kolli. import org.springframework.context.annotation.Bean; import org.springframework.test.context.DynamicPropertyRegistry; import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.KafkaContainer; import org.testcontainers.containers.PostgreSQLContainer; -import org.testcontainers.kafka.KafkaContainer; import org.testcontainers.utility.DockerImageName; @TestConfiguration(proxyBeanMethods = false) @@ -37,7 +37,8 @@ PostgreSQLContainer postgreSqlContainer() { @ServiceConnection KafkaContainer kafkaContainer(DynamicPropertyRegistry dynamicPropertyRegistry) { KafkaContainer kafkaContainer = - new KafkaContainer(DockerImageName.parse("apache/kafka").withTag("3.7.0")) + new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.0")) + .withKraft() .withReuse(true); dynamicPropertyRegistry.add( "spring.cloud.stream.kafka.binder.brokers", kafkaContainer::getBootstrapServers); diff --git a/inventory-service/src/test/java/com/example/inventoryservice/TestInventoryApplication.java b/inventory-service/src/test/java/com/example/inventoryservice/TestInventoryApplication.java index a8d1f502..6ba105b3 100644 --- a/inventory-service/src/test/java/com/example/inventoryservice/TestInventoryApplication.java +++ b/inventory-service/src/test/java/com/example/inventoryservice/TestInventoryApplication.java @@ -13,7 +13,7 @@ Licensed under MIT License Copyright (c) 2023-2024 Raja Kolli. import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.testcontainers.containers.GenericContainer; -import org.testcontainers.kafka.KafkaContainer; +import org.testcontainers.containers.KafkaContainer; import org.testcontainers.utility.DockerImageName; @TestConfiguration(proxyBeanMethods = false) @@ -31,7 +31,8 @@ GenericContainer zipkContainer() { @Bean @ServiceConnection KafkaContainer kafkaContainer() { - return new KafkaContainer(DockerImageName.parse("apache/kafka").withTag("3.7.0")) + return new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.0")) + .withKraft() .withReuse(true); } diff --git a/order-service/src/test/java/com/example/orderservice/TestOrderServiceApplication.java b/order-service/src/test/java/com/example/orderservice/TestOrderServiceApplication.java index e5735b9a..8f5f18f8 100644 --- a/order-service/src/test/java/com/example/orderservice/TestOrderServiceApplication.java +++ b/order-service/src/test/java/com/example/orderservice/TestOrderServiceApplication.java @@ -15,7 +15,7 @@ Licensed under MIT License Copyright (c) 2023-2024 Raja Kolli. import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.context.annotation.Bean; import org.testcontainers.containers.GenericContainer; -import org.testcontainers.kafka.KafkaContainer; +import org.testcontainers.containers.KafkaContainer; import org.testcontainers.utility.DockerImageName; @TestConfiguration(proxyBeanMethods = false) @@ -26,7 +26,8 @@ public class TestOrderServiceApplication { @ServiceConnection @RestartScope KafkaContainer kafkaContainer() { - return new KafkaContainer(DockerImageName.parse("apache/kafka").withTag("3.7.0")) + return new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.0")) + .withKraft() .withReuse(true); } diff --git a/payment-service/src/test/java/com/example/paymentservice/TestPaymentApplication.java b/payment-service/src/test/java/com/example/paymentservice/TestPaymentApplication.java index 59e6b46c..0d4ca530 100644 --- a/payment-service/src/test/java/com/example/paymentservice/TestPaymentApplication.java +++ b/payment-service/src/test/java/com/example/paymentservice/TestPaymentApplication.java @@ -6,8 +6,8 @@ import org.springframework.boot.testcontainers.service.connection.ServiceConnection; import org.springframework.context.annotation.Bean; import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.KafkaContainer; import org.testcontainers.containers.PostgreSQLContainer; -import org.testcontainers.kafka.KafkaContainer; import org.testcontainers.utility.DockerImageName; @TestConfiguration(proxyBeanMethods = false) @@ -31,7 +31,8 @@ GenericContainer zipkContainer() { @Bean @ServiceConnection KafkaContainer kafkaContainer() { - return new KafkaContainer(DockerImageName.parse("apache/kafka").withTag("3.7.0")) + return new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka").withTag("7.6.0")) + .withKraft() .withReuse(true); }