From a57afbd35a1490b16fe2bf34b0d69a0115bce84f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Sep 2021 21:12:42 +0000 Subject: [PATCH 1/4] Bump kafka-clients from 2.8.0 to 3.0.0 Bumps kafka-clients from 2.8.0 to 3.0.0. --- updated-dependencies: - dependency-name: org.apache.kafka:kafka-clients dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cdfb733415..62c6354633 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,7 @@ 2.1.18.Final - 2.8.0 + 3.0.0 1.9.1 1.9.1-alpha From 5d95ccd229ca0409183a84fd454f54562b8aba57 Mon Sep 17 00:00:00 2001 From: Ozan Gunalp Date: Tue, 2 Nov 2021 13:41:37 +0000 Subject: [PATCH 2/4] Test Kafka container to 3.0.0 --- .../reactive/messaging/kafka/base/KafkaBrokerExtension.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaBrokerExtension.java b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaBrokerExtension.java index a9a67d9fcf..fd74ecb91b 100644 --- a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaBrokerExtension.java +++ b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaBrokerExtension.java @@ -23,7 +23,7 @@ public class KafkaBrokerExtension implements BeforeAllCallback, ParameterResolver, CloseableResource { public static final Logger LOGGER = Logger.getLogger(KafkaBrokerExtension.class.getName()); - public static final String KAFKA_VERSION = "latest-kafka-2.8.0"; + public static final String KAFKA_VERSION = "latest-kafka-3.0.0"; private static boolean started = false; static StrimziKafkaContainer kafka; From 00f9ff3d71b6fd0cdeaa687db71fe89ef4927d7e Mon Sep 17 00:00:00 2001 From: Ozan Gunalp Date: Tue, 16 Nov 2021 15:10:14 +0300 Subject: [PATCH 3/4] Kafka container version is overridable from system property --- .../reactive/messaging/kafka/KafkaSourceTest.java | 2 +- .../kafka/KafkaSourceWithLegacyMetadataTest.java | 2 +- .../messaging/kafka/base/KafkaBrokerExtension.java | 7 ++++++- .../messaging/kafka/base/KafkaToxiproxyExtension.java | 2 +- .../reactive/messaging/kafka/base/KafkaUsage.java | 2 +- .../messaging/kafka/client/BrokerRestartTest.java | 8 ++++---- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/KafkaSourceTest.java b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/KafkaSourceTest.java index f8ec67f88d..4be037d49c 100644 --- a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/KafkaSourceTest.java +++ b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/KafkaSourceTest.java @@ -219,7 +219,7 @@ public void testBroadcastWithPartitions() { @Tag(TestTags.SLOW) public void testRetry() { // This test need an individual Kafka container - try (StrimziKafkaContainer kafka = new StrimziKafkaContainer(KafkaBrokerExtension.KAFKA_VERSION);) { + try (StrimziKafkaContainer kafka = new StrimziKafkaContainer(KafkaBrokerExtension.getKafkaContainerVersion())) { kafka.start(); await().until(kafka::isRunning); MapBasedConfig config = newCommonConfigForSource() diff --git a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/KafkaSourceWithLegacyMetadataTest.java b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/KafkaSourceWithLegacyMetadataTest.java index e2580dbd0a..e38025aa25 100644 --- a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/KafkaSourceWithLegacyMetadataTest.java +++ b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/KafkaSourceWithLegacyMetadataTest.java @@ -222,7 +222,7 @@ public void testBroadcastWithPartitions() { @Tag(TestTags.SLOW) public void testRetry() { // This test need an individual Kafka container - try (StrimziKafkaContainer kafka = new StrimziKafkaContainer(KafkaBrokerExtension.KAFKA_VERSION)) { + try (StrimziKafkaContainer kafka = new StrimziKafkaContainer(KafkaBrokerExtension.getKafkaContainerVersion())) { kafka.start(); await().until(kafka::isRunning); MapBasedConfig config = newCommonConfigForSource() diff --git a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaBrokerExtension.java b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaBrokerExtension.java index fd74ecb91b..52071dfab3 100644 --- a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaBrokerExtension.java +++ b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaBrokerExtension.java @@ -44,8 +44,13 @@ public void close() { stopKafkaBroker(); } + public static String getKafkaContainerVersion() { + String kafkaContainerVersion = System.getProperty("kafka-container-version"); + return kafkaContainerVersion != null ? kafkaContainerVersion : KAFKA_VERSION; + } + public static void startKafkaBroker() { - kafka = new StrimziKafkaContainer(KAFKA_VERSION) + kafka = new StrimziKafkaContainer(getKafkaContainerVersion()) .withExposedPorts(9092); kafka.start(); LOGGER.info("Kafka broker started: " + kafka.getBootstrapServers() + " (" + kafka.getMappedPort(9092) + ")"); diff --git a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaToxiproxyExtension.java b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaToxiproxyExtension.java index a75029ef67..15654443af 100644 --- a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaToxiproxyExtension.java +++ b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaToxiproxyExtension.java @@ -67,7 +67,7 @@ static int startKafkaProxy(Network network) { } static void startKafkaBroker(Network network, int proxyPort) { - kafka = new ProxiedStrimziKafkaContainer(KAFKA_VERSION, proxyPort) + kafka = new ProxiedStrimziKafkaContainer(KafkaBrokerExtension.getKafkaContainerVersion(), proxyPort) .withNetwork(network) .withNetworkAliases(KAFKA_NETWORK_ALIAS) .withExposedPorts(KAFKA_PORT); diff --git a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaUsage.java b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaUsage.java index eb7d8e5b81..3d21c92dcc 100644 --- a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaUsage.java +++ b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/base/KafkaUsage.java @@ -116,7 +116,7 @@ private static void sleep(Duration duration) { */ public static class FixedKafkaContainer extends StrimziKafkaContainer { public FixedKafkaContainer(int port) { - super(KafkaBrokerExtension.KAFKA_VERSION); + super(KafkaBrokerExtension.getKafkaContainerVersion()); super.addFixedExposedPort(port, KAFKA_PORT); } diff --git a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/client/BrokerRestartTest.java b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/client/BrokerRestartTest.java index 64cf36ddbe..3c420ac528 100644 --- a/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/client/BrokerRestartTest.java +++ b/smallrye-reactive-messaging-kafka/src/test/java/io/smallrye/reactive/messaging/kafka/client/BrokerRestartTest.java @@ -46,7 +46,7 @@ public void tearDown() { @Test public void testAcknowledgementUsingThrottledStrategyEvenAfterBrokerRestart() throws Exception { - try (StrimziKafkaContainer kafka = new StrimziKafkaContainer(KafkaBrokerExtension.KAFKA_VERSION)) { + try (StrimziKafkaContainer kafka = new StrimziKafkaContainer(KafkaBrokerExtension.getKafkaContainerVersion())) { kafka.start(); await().until(kafka::isRunning); @@ -71,7 +71,7 @@ public void testAcknowledgementUsingThrottledStrategyEvenAfterBrokerRestart() th @Test public void testResumingPausingWhileBrokerIsDown() throws Exception { - try (StrimziKafkaContainer kafka = new StrimziKafkaContainer(KafkaBrokerExtension.KAFKA_VERSION)) { + try (StrimziKafkaContainer kafka = new StrimziKafkaContainer(KafkaBrokerExtension.getKafkaContainerVersion())) { kafka.start(); await().until(kafka::isRunning); Integer port = kafka.getMappedPort(KAFKA_PORT); @@ -105,7 +105,7 @@ public void testResumingPausingWhileBrokerIsDown() throws Exception { @Test public void testPausingWhileBrokerIsDown() throws Exception { - try (StrimziKafkaContainer kafka = new StrimziKafkaContainer(KafkaBrokerExtension.KAFKA_VERSION)) { + try (StrimziKafkaContainer kafka = new StrimziKafkaContainer(KafkaBrokerExtension.getKafkaContainerVersion())) { kafka.start(); await().until(kafka::isRunning); Integer port = kafka.getMappedPort(KAFKA_PORT); @@ -163,7 +163,7 @@ public void testPausingWhileBrokerIsDown() throws Exception { @Test public void testWithBrokerRestart() throws Exception { int sendBatchSize = 10; - try (StrimziKafkaContainer kafka = new StrimziKafkaContainer(KafkaBrokerExtension.KAFKA_VERSION)) { + try (StrimziKafkaContainer kafka = new StrimziKafkaContainer(KafkaBrokerExtension.getKafkaContainerVersion())) { kafka.start(); String groupId = UUID.randomUUID().toString(); MapBasedConfig config = createConsumerConfig(groupId) From 746ae3e75b52af08a2529f4b863a340d55e4ef14 Mon Sep 17 00:00:00 2001 From: Ozan Gunalp Date: Tue, 16 Nov 2021 16:02:36 +0300 Subject: [PATCH 4/4] Run Kafka tests on CI for Kafka broker 2.8.0 --- .github/workflows/build-main-branches.yml | 5 +++++ .github/workflows/build-pull.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/build-main-branches.yml b/.github/workflows/build-main-branches.yml index ee392d2f0b..d1a737bfea 100644 --- a/.github/workflows/build-main-branches.yml +++ b/.github/workflows/build-main-branches.yml @@ -18,6 +18,11 @@ jobs: java: [ {'version': '8'}, {'version': '11'}, + { + 'version': '11', + 'build_opts': '-Dkafka-container-version=latest-kafka-2.8.0 -pl smallrye-reactive-messaging-kafka --also-make', + 'name': 'Kafka tests against Kafka Broker 2.8.0' + }, { 'version': '16', 'opts': '--illegal-access=permit' # required for kotlin diff --git a/.github/workflows/build-pull.yml b/.github/workflows/build-pull.yml index 4b1983f767..6bbb08f8ca 100644 --- a/.github/workflows/build-pull.yml +++ b/.github/workflows/build-pull.yml @@ -16,6 +16,11 @@ jobs: java: [ {'version': '8'}, {'version': '11'}, + { + 'version': '11', + 'build_opts': '-Dkafka-container-version=latest-kafka-2.8.0 -pl smallrye-reactive-messaging-kafka --also-make', + 'name': 'Kafka tests against Kafka Broker 2.8.0' + }, { 'version': '16', 'opts': '--illegal-access=permit' # required for kotlin