From 221395f8a3f98d7b1a5702ae99ee3214c61ada63 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Fri, 22 Dec 2023 12:45:56 +0000 Subject: [PATCH 001/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f95f27f08d..8b766d5191 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.15.0 + 0.16.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.15.0 + HEAD From a773b3b352558d127ca956a1f80467586dccfac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 22 Dec 2023 14:01:17 +0100 Subject: [PATCH 002/449] Set release version to 0.16.0.RC1 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index 977920ef86..e9966ab412 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,4 +1,4 @@ -RELEASE_VERSION="0.15.0" +RELEASE_VERSION="0.16.0.RC1" DEVELOPMENT_VERSION="0.16.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 62abf849844849683c51727d360242b9715e8cb6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 16:15:43 +0000 Subject: [PATCH 003/449] Bump org.asciidoctor:asciidoctorj-diagram from 2.2.13 to 2.2.14 Bumps [org.asciidoctor:asciidoctorj-diagram](https://github.com/asciidoctor/asciidoctorj-diagram) from 2.2.13 to 2.2.14. - [Release notes](https://github.com/asciidoctor/asciidoctorj-diagram/releases) - [Commits](https://github.com/asciidoctor/asciidoctorj-diagram/compare/v2.2.13...v2.2.14) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj-diagram dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8b766d5191..053dadcfd3 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.4.0 2.2.4 2.5.11 - 2.2.13 + 2.2.14 1.4 1.37 2.41.1 From f5155e2eb07c51b5d468c07e1c773b3f7be0d2af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 16:15:47 +0000 Subject: [PATCH 004/449] Bump org.apache.maven.plugins:maven-compiler-plugin Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.12.0 to 3.12.1. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.12.0...maven-compiler-plugin-3.12.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8b766d5191..229b9af937 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 1.2.5 1.2.1 1.0.2 - 3.12.0 + 3.12.1 3.2.3 2.7.6 1.11 From ab62be678c3df12cd92f9cf30c955114bc81157e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jan 2024 16:50:09 +0000 Subject: [PATCH 005/449] Bump org.assertj:assertj-core from 3.24.2 to 3.25.0 Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.24.2 to 3.25.0. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.24.2...assertj-build-3.25.0) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8b766d5191..5f7e8ecfe8 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.8.0 1.1.10.5 5.10.1 - 3.24.2 + 3.25.0 5.8.0 5.20.0 3.14.0 From 8da4397d534a851d7a2c6606a3487fbe9eac3534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 2 Jan 2024 09:40:06 +0100 Subject: [PATCH 006/449] Exclude slf4j 2.0+ from upgrades --- .github/dependabot.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6c10bc7cd2..c7a053526a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,8 +11,10 @@ updates: - dependency-name: "com.swiftmq:swiftmq-client" - dependency-name: "org.springframework.boot:spring-boot-maven-plugin" versions: ["[2.7,)"] + - dependency-name: "org.slf4j:slf4j-api" + versions: [ "[2.0,)" ] - package-ecosystem: "github-actions" directory: "/" schedule: interval: "daily" - target-branch: "main" \ No newline at end of file + target-branch: "main" From 5647c2e548d1b289d3331e287363bac47210f527 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 2 Jan 2024 16:28:24 +0100 Subject: [PATCH 007/449] Enforce entity by connection limit more strictly Lock producer and consumer creation in respective coordinator. This adds some contention but should be acceptable as creations are not hot and concurrent operations. Fixes #464 --- .../stream/impl/ConsumersCoordinator.java | 93 ++++++++++--------- .../stream/impl/ProducersCoordinator.java | 37 ++++---- .../java/com/rabbitmq/stream/impl/Utils.java | 10 ++ .../stream/impl/StreamEnvironmentTest.java | 51 ++++++++-- 4 files changed, 121 insertions(+), 70 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java index 99191cee2a..ce8fdf9f74 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java @@ -14,13 +14,7 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; -import static com.rabbitmq.stream.impl.Utils.convertCodeToException; -import static com.rabbitmq.stream.impl.Utils.formatConstant; -import static com.rabbitmq.stream.impl.Utils.isSac; -import static com.rabbitmq.stream.impl.Utils.jsonField; -import static com.rabbitmq.stream.impl.Utils.namedFunction; -import static com.rabbitmq.stream.impl.Utils.namedRunnable; -import static com.rabbitmq.stream.impl.Utils.quote; +import static com.rabbitmq.stream.impl.Utils.*; import static java.lang.String.format; import com.rabbitmq.stream.*; @@ -51,6 +45,8 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import java.util.function.*; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -80,6 +76,7 @@ class ConsumersCoordinator { new DefaultExecutorServiceFactory( Runtime.getRuntime().availableProcessors(), 10, "rabbitmq-stream-consumer-connection-"); private final boolean forceReplica; + private final Lock coordinatorLock = new ReentrantLock(); ConsumersCoordinator( StreamEnvironment environment, @@ -116,47 +113,51 @@ Runnable subscribe( MessageHandler messageHandler, Map subscriptionProperties, ConsumerFlowStrategy flowStrategy) { - List candidates = findBrokersForStream(stream, forceReplica); - Client.Broker newNode = pickBroker(candidates); - if (newNode == null) { - throw new IllegalStateException("No available node to subscribe to"); - } - - // create stream subscription to track final and changing state of this very subscription - // we keep this instance when we move the subscription from a client to another one - SubscriptionTracker subscriptionTracker = - new SubscriptionTracker( - this.trackerIdSequence.getAndIncrement(), - consumer, - stream, - offsetSpecification, - trackingReference, - subscriptionListener, - trackingClosingCallback, - messageHandler, - subscriptionProperties, - flowStrategy); + return lock( + this.coordinatorLock, + () -> { + List candidates = findBrokersForStream(stream, forceReplica); + Client.Broker newNode = pickBroker(candidates); + if (newNode == null) { + throw new IllegalStateException("No available node to subscribe to"); + } - try { - addToManager(newNode, subscriptionTracker, offsetSpecification, true); - } catch (ConnectionStreamException e) { - // these exceptions are not public - throw new StreamException(e.getMessage()); - } + // create stream subscription to track final and changing state of this very subscription + // we keep this instance when we move the subscription from a client to another one + SubscriptionTracker subscriptionTracker = + new SubscriptionTracker( + this.trackerIdSequence.getAndIncrement(), + consumer, + stream, + offsetSpecification, + trackingReference, + subscriptionListener, + trackingClosingCallback, + messageHandler, + subscriptionProperties, + flowStrategy); + + try { + addToManager(newNode, subscriptionTracker, offsetSpecification, true); + } catch (ConnectionStreamException e) { + // these exceptions are not public + throw new StreamException(e.getMessage()); + } - if (debug) { - this.trackers.add(subscriptionTracker); - return () -> { - try { - this.trackers.remove(subscriptionTracker); - } catch (Exception e) { - LOGGER.debug("Error while removing subscription tracker from list"); - } - subscriptionTracker.cancel(); - }; - } else { - return subscriptionTracker::cancel; - } + if (debug) { + this.trackers.add(subscriptionTracker); + return () -> { + try { + this.trackers.remove(subscriptionTracker); + } catch (Exception e) { + LOGGER.debug("Error while removing subscription tracker from list"); + } + subscriptionTracker.cancel(); + }; + } else { + return subscriptionTracker::cancel; + } + }); } private void addToManager( diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java index 143ef57204..57e82d67fb 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java @@ -14,12 +14,7 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; -import static com.rabbitmq.stream.impl.Utils.callAndMaybeRetry; -import static com.rabbitmq.stream.impl.Utils.formatConstant; -import static com.rabbitmq.stream.impl.Utils.jsonField; -import static com.rabbitmq.stream.impl.Utils.namedFunction; -import static com.rabbitmq.stream.impl.Utils.namedRunnable; -import static com.rabbitmq.stream.impl.Utils.quote; +import static com.rabbitmq.stream.impl.Utils.*; import static java.util.stream.Collectors.toSet; import com.rabbitmq.stream.BackOffDelayPolicy; @@ -52,6 +47,8 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; @@ -75,6 +72,7 @@ class ProducersCoordinator { private final ExecutorServiceFactory executorServiceFactory = new DefaultExecutorServiceFactory( Runtime.getRuntime().availableProcessors(), 10, "rabbitmq-stream-producer-connection-"); + private final Lock coordinatorLock = new ReentrantLock(); ProducersCoordinator( StreamEnvironment environment, @@ -94,19 +92,26 @@ private static String keyForNode(Client.Broker broker) { } Runnable registerProducer(StreamProducer producer, String reference, String stream) { - ProducerTracker tracker = - new ProducerTracker(trackerIdSequence.getAndIncrement(), reference, stream, producer); - if (debug) { - this.producerTrackers.add(tracker); - } - return registerAgentTracker(tracker, stream); + return lock( + this.coordinatorLock, + () -> { + ProducerTracker tracker = + new ProducerTracker(trackerIdSequence.getAndIncrement(), reference, stream, producer); + if (debug) { + this.producerTrackers.add(tracker); + } + return registerAgentTracker(tracker, stream); + }); } Runnable registerTrackingConsumer(StreamConsumer consumer) { - return registerAgentTracker( - new TrackingConsumerTracker( - trackerIdSequence.getAndIncrement(), consumer.stream(), consumer), - consumer.stream()); + return lock( + this.coordinatorLock, + () -> + registerAgentTracker( + new TrackingConsumerTracker( + trackerIdSequence.getAndIncrement(), consumer.stream(), consumer), + consumer.stream())); } private Runnable registerAgentTracker(AgentTracker tracker, String stream) { diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index f600f98809..70d4086ad5 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -39,6 +39,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.locks.Lock; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.LongConsumer; @@ -662,4 +663,13 @@ boolean get() { return this.value; } } + + static T lock(Lock lock, Supplier action) { + lock.lock(); + try { + return action.get(); + } finally { + lock.unlock(); + } + } } diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java index 9a7d23e210..003e0eae79 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java @@ -14,6 +14,7 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; +import static com.rabbitmq.stream.impl.TestUtils.CountDownLatchConditions.completed; import static com.rabbitmq.stream.impl.TestUtils.ExceptionConditions.responseCode; import static com.rabbitmq.stream.impl.TestUtils.latchAssert; import static com.rabbitmq.stream.impl.TestUtils.localhost; @@ -69,9 +70,7 @@ import java.util.Random; import java.util.Set; import java.util.UUID; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.CountDownLatch; +import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; @@ -82,11 +81,7 @@ import javax.net.ssl.SNIHostName; import javax.net.ssl.SSLParameters; import org.assertj.core.api.ThrowableAssert.ThrowingCallable; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.*; import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.junit.jupiter.api.condition.EnabledOnOs; import org.junit.jupiter.api.condition.OS; @@ -778,4 +773,44 @@ void nativeEpollWorksOnLinux() { epollEventLoopGroup.shutdownGracefully(0, 0, SECONDS); } } + + @Test + void enforceEntityPerConnectionLimits() { + int entityCount = 10; + int limit = 3; + ExecutorService executor = Executors.newCachedThreadPool(); + try (Environment env = + environmentBuilder + .maxProducersByConnection(limit) + .maxConsumersByConnection(limit) + .maxTrackingConsumersByConnection(limit) + .build()) { + CountDownLatch latch = new CountDownLatch(entityCount * 2); + IntStream.range(0, entityCount) + .forEach( + i -> { + executor.execute( + () -> { + env.producerBuilder().stream(stream).name(String.valueOf(i)).build(); + latch.countDown(); + }); + }); + IntStream.range(0, entityCount) + .forEach( + i -> { + executor.execute( + () -> { + env.consumerBuilder().stream(stream).messageHandler((ctx, msg) -> {}).build(); + latch.countDown(); + }); + }); + assertThat(latch).is(completed()); + EnvironmentInfo envInfo = MonitoringTestUtils.extract(env); + int expectedConnectionCount = entityCount / limit + 1; + assertThat(envInfo.getProducers().clientCount()).isEqualTo(expectedConnectionCount); + assertThat(envInfo.getConsumers().clients()).hasSize(expectedConnectionCount); + } finally { + executor.shutdownNow(); + } + } } From a9090c9fc816585bab3093ac9814634fb61f1cd2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Jan 2024 16:07:58 +0000 Subject: [PATCH 008/449] Bump org.assertj:assertj-core from 3.25.0 to 3.25.1 Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.25.0 to 3.25.1. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.25.0...assertj-build-3.25.1) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1826dc86aa..2fa246aef2 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.8.0 1.1.10.5 5.10.1 - 3.25.0 + 3.25.1 5.8.0 5.20.0 3.14.0 From 1b9dd1391f181893bfb12305dc1be5b4f57fd08c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 5 Jan 2024 18:23:21 +0100 Subject: [PATCH 009/449] Add links to dependency management in readme --- README.adoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.adoc b/README.adoc index 306b00e52f..66e4a4d6e1 100644 --- a/README.adoc +++ b/README.adoc @@ -29,6 +29,11 @@ Features and API are subject to change, but https://rabbitmq.github.io/rabbitmq- The library requires Java 8 or later. Java 11 is recommended. +=== Dependencies + +* https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmlsingle/#dependencies[Release] +* https://rabbitmq.github.io/rabbitmq-stream-java-client/snapshot/htmlsingle/#dependencies[Snapshot] + === Documentation ==== Release From df3136f0f58ce609882942f2ee10d8089ebd2e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 8 Jan 2024 11:07:27 +0100 Subject: [PATCH 010/449] Test againt Java Semeru 17 --- .github/workflows/test-supported-java-versions.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index 7c610309b9..f7e1d3aa31 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -10,8 +10,12 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - java: [ '8', '11', '17', '21', '22-ea' ] - name: Test against Java ${{ matrix.java }} + distribution: [ 'temurin' ] + version: [ '8', '11', '17', '21', '22-ea' ] + include: + - distribution: 'semeru' + version: '17' + name: Test against Java ${{ matrix.distribution }} ${{ matrix.version }} steps: - uses: actions/checkout@v4 - name: Checkout tls-gen @@ -22,8 +26,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'temurin' - java-version: ${{ matrix.java }} + distribution: ${{ matrix.distribution }} + java-version: ${{ matrix.version }} cache: 'maven' - name: Start broker run: ci/start-broker.sh From dc69f0f2dc83f4c16e5bdf9bd62c6b527ed474e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 16:29:14 +0000 Subject: [PATCH 011/449] Bump io.micrometer:micrometer-core from 1.12.1 to 1.12.2 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.12.1 to 1.12.2. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.12.1...v1.12.2) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2fa246aef2..2f439ca469 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.104.Final 0.34.1 4.2.23 - 1.12.1 + 1.12.2 12.2.2 4.7.5 1.25.0 From 3fc222415ddb2850bd433fc8baea9ebcbface9b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 16:29:19 +0000 Subject: [PATCH 012/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.2.1 to 1.2.2. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.2.1...v1.2.2) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2fa246aef2..a69a9b8d0f 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.10.1 0.10.4 1.2.5 - 1.2.1 + 1.2.2 1.0.2 3.12.1 3.2.3 From 80edd62796f3f628c39b262a1695be3a9bd011c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jan 2024 16:28:17 +0000 Subject: [PATCH 013/449] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.3 to 3.2.5 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.3 to 3.2.5. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.3...surefire-3.2.5) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6f0ec5c74c..1c5526a1c9 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ 1.2.2 1.0.2 3.12.1 - 3.2.3 + 3.2.5 2.7.6 1.11 3.1.0 From 72670c17ff0fccd7c52c8be74fde170d8631936f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 12 Jan 2024 09:07:26 +0100 Subject: [PATCH 014/449] Add link to support timeline page in readme --- README.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.adoc b/README.adoc index 66e4a4d6e1..37b36dc9a2 100644 --- a/README.adoc +++ b/README.adoc @@ -23,6 +23,8 @@ Features and API are subject to change, but https://rabbitmq.github.io/rabbitmq- * For questions: https://groups.google.com/forum/#!forum/rabbitmq-users[RabbitMQ Users] * For bugs and feature requests: https://github.com/rabbitmq/rabbitmq-stream-java-client/issues[GitHub Issues] +See the https://www.rabbitmq.com/java-versions.html[RabbitMQ Java libraries support page] for the support timeline of this library. + == How to Use === Pre-requisites From 68eaa7237b43c3952807b90fbd918bd1e9749b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 12 Jan 2024 15:31:51 +0100 Subject: [PATCH 015/449] Add Java requirement in several places --- README.adoc | 3 ++- src/docs/asciidoc/index.adoc | 2 ++ src/docs/asciidoc/overview.adoc | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 37b36dc9a2..8c2ce1632f 100644 --- a/README.adoc +++ b/README.adoc @@ -8,6 +8,7 @@ The RabbitMQ Stream Java Client is a Java library to communicate with the https://rabbitmq.com/stream.html[RabbitMQ Stream Plugin]. It allows to create and delete streams, as well as to publish to and consume from these streams. +This library requires at least Java 8, but Java 11 or more is recommended. https://github.com/rabbitmq/rabbitmq-stream-perf-test[Stream PerfTest] is a performance testing tool based on this client library. @@ -29,7 +30,7 @@ See the https://www.rabbitmq.com/java-versions.html[RabbitMQ Java libraries supp === Pre-requisites -The library requires Java 8 or later. Java 11 is recommended. +This library requires at least Java 8, but Java 11 or more is recommended. === Dependencies diff --git a/src/docs/asciidoc/index.adoc b/src/docs/asciidoc/index.adoc index 887c6409a6..a28aefcd91 100644 --- a/src/docs/asciidoc/index.adoc +++ b/src/docs/asciidoc/index.adoc @@ -11,6 +11,8 @@ the https://rabbitmq.com/stream.html[RabbitMQ Stream Plugin]. It allows creating and deleting streams, as well as publishing to and consuming from these streams. Learn more in the <>. +This library requires at least Java 8, but Java 11 or more is recommended. + https://github.com/rabbitmq/rabbitmq-stream-perf-test[Stream PerfTest] is a performance testing tool based on this client library. diff --git a/src/docs/asciidoc/overview.adoc b/src/docs/asciidoc/overview.adoc index c37112f19f..c133d2af38 100644 --- a/src/docs/asciidoc/overview.adoc +++ b/src/docs/asciidoc/overview.adoc @@ -99,4 +99,4 @@ The client contains 2 sets of programming interfaces whose stability are of inte == Pre-requisites -The library requires Java 8 or later. Java 11 is recommended (CRC calculation uses methods available as of Java 9.) +This library requires at least Java 8, but Java 11 or more is recommended (CRC calculation uses methods available as of Java 9). From 51f5ade8aaf08b79ff69f391dbe4d4e8c950684f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 12 Jan 2024 16:51:50 +0100 Subject: [PATCH 016/449] Add test for permission updates after re-authentication References rabbitmq/rabbitmq-server#10292 --- .../stream/impl/AuthorisationTest.java | 195 ++++++++++++++++-- 1 file changed, 174 insertions(+), 21 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java b/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java index 47d595da6b..8a86547fbf 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java @@ -14,23 +14,32 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; +import static com.rabbitmq.stream.Constants.*; import static com.rabbitmq.stream.Host.*; -import static com.rabbitmq.stream.impl.TestUtils.b; -import static com.rabbitmq.stream.impl.TestUtils.waitAtMost; +import static com.rabbitmq.stream.OffsetSpecification.first; +import static com.rabbitmq.stream.impl.TestUtils.*; +import static com.rabbitmq.stream.impl.TestUtils.ResponseConditions.ok; +import static java.util.Arrays.asList; import static java.util.concurrent.TimeUnit.SECONDS; import static org.assertj.core.api.Assertions.assertThat; import com.rabbitmq.stream.Constants; -import com.rabbitmq.stream.OffsetSpecification; +import com.rabbitmq.stream.Message; +import com.rabbitmq.stream.sasl.CredentialsProvider; +import com.rabbitmq.stream.sasl.DefaultUsernamePasswordCredentialsProvider; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.util.Collections; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Function; import java.util.stream.IntStream; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.api.extension.ExtendWith; @ExtendWith(TestUtils.StreamTestInfrastructureExtension.class) @@ -74,11 +83,11 @@ void createStreamWithAuthorisedNameShouldSucceed() { String stream = "stream-authorized" + i; Client.Response response = client.create(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); response = deletionClient.delete(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); }); } @@ -105,11 +114,11 @@ void deleteStreamWithAuthorisedNameShouldSucceed() { String stream = "stream-authorized" + i; Client.Response response = creationClient.create(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); response = client.delete(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); }); } @@ -123,7 +132,7 @@ void deleteStreamWithUnauthorisedNameShouldFail() { String stream = "not-authorized" + i; Client.Response response = creationClient.create(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); response = client.delete(stream); assertThat(response.isOk()).isFalse(); @@ -132,7 +141,7 @@ void deleteStreamWithUnauthorisedNameShouldFail() { response = creationClient.delete(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); }); } @@ -146,15 +155,15 @@ void subscribeToAuthorisedStreamShouldSucceed() { String stream = "stream-authorized" + i; Client.Response response = configurationClient.create(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); - response = client.subscribe(b(1), stream, OffsetSpecification.first(), 10); + response = client.subscribe(b(1), stream, first(), 10); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); response = configurationClient.delete(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); }); } @@ -168,16 +177,16 @@ void subscribeToUnauthorisedStreamShouldFail() { String stream = "not-authorized" + i; Client.Response response = configurationClient.create(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); - response = client.subscribe(b(1), stream, OffsetSpecification.first(), 10); + response = client.subscribe(b(1), stream, first(), 10); assertThat(response.isOk()).isFalse(); assertThat(response.getResponseCode()) .isEqualTo(Constants.RESPONSE_CODE_ACCESS_REFUSED); response = configurationClient.delete(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); }); } @@ -191,7 +200,7 @@ void publishToAuthorisedStreamShouldSucceed() { String stream = "stream-authorized" + i; Client.Response response = configurationClient.create(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); int messageCount = 1000; CountDownLatch publishConfirmLatch = new CountDownLatch(messageCount); @@ -223,7 +232,7 @@ void publishToAuthorisedStreamShouldSucceed() { response = configurationClient.delete(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); }); } @@ -237,7 +246,7 @@ void publishToUnauthorisedStreamShouldFail() { String stream = "not-authorized" + i; Client.Response response = configurationClient.create(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); int messageCount = 1000; CountDownLatch publishErrorLatch = new CountDownLatch(messageCount); @@ -270,7 +279,7 @@ void publishToUnauthorisedStreamShouldFail() { response = configurationClient.delete(stream); assertThat(response.isOk()).isTrue(); - assertThat(response.getResponseCode()).isEqualTo(Constants.RESPONSE_CODE_OK); + assertThat(response.getResponseCode()).isEqualTo(RESPONSE_CODE_OK); }); } @@ -304,6 +313,142 @@ void storeQueryOffsetShouldSucceedOnAuthorisedStreamShouldFailOnUnauthorisedStre } } + @Test + @TestUtils.BrokerVersionAtLeast(TestUtils.BrokerVersion.RABBITMQ_3_13_0) + void shouldReceiveMetadataUpdateAfterUpdateSecret(TestInfo info) throws Exception { + try { + String newPassword = "new-password"; + String prefix = "passthrough-"; + String pubSub = TestUtils.streamName(info); + String authorizedPubSub = prefix + TestUtils.streamName(info); + String pub = TestUtils.streamName(info); + String authorizedPub = prefix + TestUtils.streamName(info); + String sub = TestUtils.streamName(info); + String authorizedSub = prefix + TestUtils.streamName(info); + setPermissions(USERNAME, VH, ".*"); + Set metadataUpdates = ConcurrentHashMap.newKeySet(); + ConcurrentMap publishConfirms = new ConcurrentHashMap<>(); + ConcurrentMap creditNotifications = new ConcurrentHashMap<>(); + Set receivedMessages = ConcurrentHashMap.newKeySet(); + Client client = + cf.get( + parameters() + .virtualHost(VH) + .username(USERNAME) + .password(USERNAME) + .publishConfirmListener( + (publisherId, publishingId) -> + publishConfirms.put(publisherId, RESPONSE_CODE_OK)) + .publishErrorListener( + (publisherId, publishingId, errorCode) -> + publishConfirms.put(publisherId, errorCode)) + .creditNotification( + (subscriptionId, responseCode) -> + creditNotifications.put(subscriptionId, responseCode)) + .messageListener( + (subscriptionId, + offset, + chunkTimestamp, + committedChunkId, + chunkContext, + message) -> receivedMessages.add(subscriptionId)) + .metadataListener((stream, code) -> metadataUpdates.add(stream))); + assertThat(client.create(pubSub)).is(ok()); + assertThat(client.create(authorizedPubSub)).is(ok()); + assertThat(client.create(pub)).is(ok()); + assertThat(client.create(authorizedPub)).is(ok()); + assertThat(client.create(sub)).is(ok()); + assertThat(client.create(authorizedSub)).is(ok()); + + Map publishers = new HashMap<>(); + publishers.put(pubSub, b(0)); + publishers.put(authorizedPubSub, b(1)); + publishers.put(pub, b(2)); + publishers.put(authorizedPub, b(3)); + publishers.forEach((s, id) -> assertThat(client.declarePublisher(id, null, s)).is(ok())); + Map subscriptions = new HashMap<>(); + subscriptions.put(pubSub, b(0)); + subscriptions.put(authorizedPubSub, b(1)); + subscriptions.put(sub, b(2)); + subscriptions.put(authorizedSub, b(3)); + subscriptions.forEach((s, id) -> assertThat(client.subscribe(id, s, first(), 1)).is(ok())); + + Function toPub = publishers::get; + Function toSub = subscriptions::get; + + // change password and permissions and re-authenticate + changePassword(USERNAME, newPassword); + setPermissions(USERNAME, VH, "^passthrough.*$"); + client.authenticate(credentialsProvider(USERNAME, newPassword)); + + waitAtMost(() -> metadataUpdates.containsAll(asList(pubSub, pub, sub))); + + List message = Collections.singletonList(client.messageBuilder().build()); + + // publishers for unauthorized streams should be gone + asList(toPub.apply(pubSub), toPub.apply(pub)) + .forEach( + wrap( + pubId -> { + assertThat(publishConfirms).doesNotContainKey(pubId); + client.publish(pubId, message); + waitAtMost(() -> publishConfirms.containsKey(pubId)); + assertThat(publishConfirms) + .containsEntry(pubId, RESPONSE_CODE_PUBLISHER_DOES_NOT_EXIST); + })); + + // subscriptions for unauthorized streams should be gone + asList(toSub.apply(pubSub), toSub.apply(sub)) + .forEach( + wrap( + subId -> { + assertThat(creditNotifications).doesNotContainKey(subId); + client.credit(subId, 1); + waitAtMost(() -> creditNotifications.containsKey(subId)); + assertThat(creditNotifications) + .containsEntry(subId, RESPONSE_CODE_SUBSCRIPTION_ID_DOES_NOT_EXIST); + })); + + // subscriptions for authorized streams still work + asList(toSub.apply(authorizedPubSub), toSub.apply(authorizedSub)) + .forEach(subId -> client.credit(subId, 1)); + + assertThat(receivedMessages).isEmpty(); + // publishers for authorized streams should still work + asList(toPub.apply(authorizedPubSub), toPub.apply(authorizedPub)) + .forEach( + wrap( + pubId -> { + client.publish(pubId, message); + waitAtMost(() -> publishConfirms.containsKey(pubId)); + assertThat(publishConfirms).containsEntry(pubId, RESPONSE_CODE_OK); + })); + + waitAtMost(() -> receivedMessages.contains(b(1))); + + // send message to authorized subscription stream + assertThat(client.declarePublisher(b(5), null, authorizedSub)).is(ok()); + client.publish(b(5), message); + waitAtMost(() -> receivedMessages.contains(toSub.apply(authorizedSub))); + + // last checks to make sure nothing unexpected arrived late + assertThat(metadataUpdates).hasSize(3); + assertThat(creditNotifications).containsOnlyKeys(b(0), b(2)); + assertThat(publishConfirms) + .hasSize(4 + 1) + .containsEntry(toPub.apply(pubSub), RESPONSE_CODE_PUBLISHER_DOES_NOT_EXIST) + .containsEntry(toPub.apply(authorizedPubSub), RESPONSE_CODE_OK) + .containsEntry(toPub.apply(pub), RESPONSE_CODE_PUBLISHER_DOES_NOT_EXIST) + .containsEntry(toPub.apply(authorizedPub), RESPONSE_CODE_OK); + assertThat(receivedMessages).hasSize(2); + + client.close(); + } finally { + changePassword(USERNAME, PASSWORD); + setPermissions(USERNAME, VH, "^stream.*$"); + } + } + Client configurationClient() { return cf.get(new Client.ClientParameters().virtualHost(VH)); } @@ -315,4 +460,12 @@ Client client() { Client client(Client.ClientParameters parameters) { return cf.get(parameters.virtualHost(VH).username(USERNAME).password(PASSWORD)); } + + private static Client.ClientParameters parameters() { + return new Client.ClientParameters(); + } + + private static CredentialsProvider credentialsProvider(String username, String password) { + return new DefaultUsernamePasswordCredentialsProvider(username, password); + } } From d9fe7d5408c434c691d7c6c44905a02059fea9c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 12 Jan 2024 16:55:04 +0100 Subject: [PATCH 017/449] Adapt broker Docker image for PR --- .github/workflows/test-pr.yml | 2 ++ .../java/com/rabbitmq/stream/impl/StreamEnvironment.java | 7 ++++++- src/test/resources/logback-test.xml | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 4d491b4e33..1cc79d9baa 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -24,6 +24,8 @@ jobs: cache: 'maven' - name: Start broker run: ci/start-broker.sh + env: + RABBITMQ_IMAGE: 'pivotalrabbitmq/rabbitmq:token-expiration-in-stream-connections-otp-max-bazel' - name: Test run: | ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index ac97403f9d..c457b44796 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -974,7 +974,12 @@ private Address address() { } private String label() { - return address.host() + ":" + address.port(); + Client c = this.nullableClient(); + if (c == null) { + return address.host() + ":" + address.port(); + } else { + return c.getHost() + ":" + c.getPort(); + } } @Override diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 4bec720537..6931d5f21a 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -6,6 +6,7 @@ + From 323bf833b3a5982e797cd6589556ade8888cf3df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Jan 2024 16:44:47 +0000 Subject: [PATCH 018/449] Bump org.asciidoctor:asciidoctor-maven-plugin from 2.2.4 to 2.2.5 Bumps [org.asciidoctor:asciidoctor-maven-plugin](https://github.com/asciidoctor/asciidoctor-maven-plugin) from 2.2.4 to 2.2.5. - [Release notes](https://github.com/asciidoctor/asciidoctor-maven-plugin/releases) - [Changelog](https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/asciidoctor-maven-plugin-2.2.5/CHANGELOG.adoc) - [Commits](https://github.com/asciidoctor/asciidoctor-maven-plugin/compare/asciidoctor-maven-plugin-2.2.4...asciidoctor-maven-plugin-2.2.5) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctor-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1c5526a1c9..ad0d0aa030 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.6.3 3.3.0 3.4.0 - 2.2.4 + 2.2.5 2.5.11 2.2.14 1.4 From 505aa55070b5c5b1c2ac59eea9f221287fdc3c47 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:25:29 +0000 Subject: [PATCH 019/449] Bump org.mockito:mockito-core from 5.8.0 to 5.9.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.8.0 to 5.9.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.8.0...v5.9.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ad0d0aa030..d4fca1d11d 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.1.10.5 5.10.1 3.25.1 - 5.8.0 + 5.9.0 5.20.0 3.14.0 1.16.0 From 2a550fff4532400224f6c8d5df97939fc91fb921 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 16:25:36 +0000 Subject: [PATCH 020/449] Bump com.diffplug.spotless:spotless-maven-plugin from 2.41.1 to 2.42.0 Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.41.1 to 2.42.0. - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/maven/2.41.1...lib/2.42.0) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ad0d0aa030..bbc70a5c5b 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ 2.2.14 1.4 1.37 - 2.41.1 + 2.42.0 1.18.1 0.8.11 From 868a9bbc5ae39e0d9a460bb1c6d7bf568ad119b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jan 2024 16:54:15 +0000 Subject: [PATCH 021/449] Bump netty.version from 4.1.104.Final to 4.1.105.Final Bumps `netty.version` from 4.1.104.Final to 4.1.105.Final. Updates `io.netty:netty-transport` from 4.1.104.Final to 4.1.105.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.104.Final...netty-4.1.105.Final) Updates `io.netty:netty-codec` from 4.1.104.Final to 4.1.105.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.104.Final...netty-4.1.105.Final) Updates `io.netty:netty-handler` from 4.1.104.Final to 4.1.105.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.104.Final...netty-4.1.105.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.104.Final to 4.1.105.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.104.Final...netty-4.1.105.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3fd35fd344..4d107637ee 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.12 - 4.1.104.Final + 4.1.105.Final 0.34.1 4.2.23 1.12.2 From b4cb0ff2b4ccc5fa37135528bb751262ff0d7c18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jan 2024 16:16:01 +0000 Subject: [PATCH 022/449] Bump netty.version from 4.1.105.Final to 4.1.106.Final Bumps `netty.version` from 4.1.105.Final to 4.1.106.Final. Updates `io.netty:netty-transport` from 4.1.105.Final to 4.1.106.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.105.Final...netty-4.1.106.Final) Updates `io.netty:netty-codec` from 4.1.105.Final to 4.1.106.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.105.Final...netty-4.1.106.Final) Updates `io.netty:netty-handler` from 4.1.105.Final to 4.1.106.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.105.Final...netty-4.1.106.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.105.Final to 4.1.106.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.105.Final...netty-4.1.106.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4d107637ee..ad750f73b3 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.12 - 4.1.105.Final + 4.1.106.Final 0.34.1 4.2.23 1.12.2 From 2c79a0ba8bcd0d6c491847519025dc93b77cbda9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 22 Jan 2024 11:07:59 +0100 Subject: [PATCH 023/449] Use latest broker image for PR --- .github/workflows/test-pr.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 1cc79d9baa..4d491b4e33 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -24,8 +24,6 @@ jobs: cache: 'maven' - name: Start broker run: ci/start-broker.sh - env: - RABBITMQ_IMAGE: 'pivotalrabbitmq/rabbitmq:token-expiration-in-stream-connections-otp-max-bazel' - name: Test run: | ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ From 9c3030ccf13f9f8fdfcbbe6edb0f3988c8d47499 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 17:01:48 +0000 Subject: [PATCH 024/449] Bump io.dropwizard.metrics:metrics-core from 4.2.23 to 4.2.24 Bumps [io.dropwizard.metrics:metrics-core](https://github.com/dropwizard/metrics) from 4.2.23 to 4.2.24. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.23...v4.2.24) --- updated-dependencies: - dependency-name: io.dropwizard.metrics:metrics-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ad750f73b3..69d726da1c 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 1.2.12 4.1.106.Final 0.34.1 - 4.2.23 + 4.2.24 1.12.2 12.2.2 4.7.5 From 3cf9bf6fe8a16003e73f331e934168adcbd82bc6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 16:12:47 +0000 Subject: [PATCH 025/449] Bump com.diffplug.spotless:spotless-maven-plugin from 2.42.0 to 2.43.0 Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.42.0 to 2.43.0. - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/lib/2.42.0...lib/2.43.0) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 69d726da1c..acc498d38e 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ 2.2.14 1.4 1.37 - 2.42.0 + 2.43.0 1.18.1 0.8.11 From 9a1908673ed801b35d9c315f38de5b28ebe996fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 24 Jan 2024 08:56:32 +0100 Subject: [PATCH 026/449] Bump Java Google format to 1.19.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index acc498d38e..63c9991613 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 1.4 1.37 2.43.0 - 1.18.1 + 1.19.2 0.8.11 3.12 From 23f462c10943c34921da5f5be7664c47973782ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 24 Jan 2024 09:06:28 +0100 Subject: [PATCH 027/449] Format --- pom.xml | 3 ++- src/main/java/com/rabbitmq/stream/Address.java | 4 ++-- src/main/java/com/rabbitmq/stream/AddressResolver.java | 4 ++-- .../com/rabbitmq/stream/AuthenticationFailureException.java | 4 ++-- src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java | 4 ++-- src/main/java/com/rabbitmq/stream/ByteCapacity.java | 4 ++-- src/main/java/com/rabbitmq/stream/ChunkChecksum.java | 4 ++-- .../com/rabbitmq/stream/ChunkChecksumValidationException.java | 4 ++-- src/main/java/com/rabbitmq/stream/Codec.java | 4 ++-- src/main/java/com/rabbitmq/stream/ConfirmationHandler.java | 4 ++-- src/main/java/com/rabbitmq/stream/ConfirmationStatus.java | 4 ++-- src/main/java/com/rabbitmq/stream/Constants.java | 4 ++-- src/main/java/com/rabbitmq/stream/Consumer.java | 4 ++-- src/main/java/com/rabbitmq/stream/ConsumerBuilder.java | 4 ++-- src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java | 4 ++-- src/main/java/com/rabbitmq/stream/ConsumerUpdateListener.java | 4 ++-- src/main/java/com/rabbitmq/stream/Environment.java | 4 ++-- src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java | 4 ++-- src/main/java/com/rabbitmq/stream/Message.java | 4 ++-- src/main/java/com/rabbitmq/stream/MessageBuilder.java | 4 ++-- src/main/java/com/rabbitmq/stream/MessageHandler.java | 4 ++-- src/main/java/com/rabbitmq/stream/NoOffsetException.java | 4 ++-- src/main/java/com/rabbitmq/stream/ObservationCollector.java | 4 ++-- src/main/java/com/rabbitmq/stream/OffsetSpecification.java | 4 ++-- src/main/java/com/rabbitmq/stream/Producer.java | 4 ++-- src/main/java/com/rabbitmq/stream/ProducerBuilder.java | 4 ++-- src/main/java/com/rabbitmq/stream/Properties.java | 4 ++-- src/main/java/com/rabbitmq/stream/RoutingStrategy.java | 4 ++-- src/main/java/com/rabbitmq/stream/StreamCreator.java | 4 ++-- .../java/com/rabbitmq/stream/StreamDoesNotExistException.java | 4 ++-- src/main/java/com/rabbitmq/stream/StreamException.java | 4 ++-- .../java/com/rabbitmq/stream/StreamNotAvailableException.java | 4 ++-- src/main/java/com/rabbitmq/stream/StreamStats.java | 4 ++-- src/main/java/com/rabbitmq/stream/SubscriptionListener.java | 4 ++-- src/main/java/com/rabbitmq/stream/amqp/Symbol.java | 4 ++-- src/main/java/com/rabbitmq/stream/amqp/UnsignedByte.java | 4 ++-- src/main/java/com/rabbitmq/stream/amqp/UnsignedInteger.java | 4 ++-- src/main/java/com/rabbitmq/stream/amqp/UnsignedLong.java | 4 ++-- src/main/java/com/rabbitmq/stream/amqp/UnsignedShort.java | 4 ++-- src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java | 4 ++-- .../com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java | 4 ++-- src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java | 4 ++-- src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java | 4 ++-- .../java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java | 4 ++-- .../java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java | 4 ++-- .../compression/CommonsCompressCompressionCodecFactory.java | 4 ++-- .../java/com/rabbitmq/stream/compression/Compression.java | 4 ++-- .../com/rabbitmq/stream/compression/CompressionCodec.java | 4 ++-- .../rabbitmq/stream/compression/CompressionCodecFactory.java | 4 ++-- .../com/rabbitmq/stream/compression/CompressionException.java | 4 ++-- .../com/rabbitmq/stream/compression/CompressionUtils.java | 4 ++-- .../stream/compression/DefaultCompressionCodecFactory.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/Client.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/ClientProperties.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/Clock.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/Codecs.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/CompressionCodecs.java | 4 ++-- .../com/rabbitmq/stream/impl/ConnectionStreamException.java | 4 ++-- .../java/com/rabbitmq/stream/impl/ConsumersCoordinator.java | 4 ++-- .../rabbitmq/stream/impl/DefaultExecutorServiceFactory.java | 4 ++-- .../java/com/rabbitmq/stream/impl/ExecutorServiceFactory.java | 4 ++-- .../java/com/rabbitmq/stream/impl/HashRoutingStrategy.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/HashUtils.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java | 4 ++-- .../java/com/rabbitmq/stream/impl/MessageAccumulator.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/MessageBatch.java | 4 ++-- .../com/rabbitmq/stream/impl/OffsetTrackingCoordinator.java | 4 ++-- .../com/rabbitmq/stream/impl/ParameterizedTypeReference.java | 4 ++-- .../java/com/rabbitmq/stream/impl/ProducersCoordinator.java | 4 ++-- .../com/rabbitmq/stream/impl/RoutingKeyRoutingStrategy.java | 4 ++-- .../rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java | 4 ++-- .../java/com/rabbitmq/stream/impl/ServerFrameHandler.java | 4 ++-- .../com/rabbitmq/stream/impl/SimpleMessageAccumulator.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java | 4 ++-- .../java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java | 4 ++-- .../com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/StreamProducer.java | 4 ++-- .../java/com/rabbitmq/stream/impl/StreamProducerBuilder.java | 4 ++-- .../java/com/rabbitmq/stream/impl/StreamStreamCreator.java | 4 ++-- .../com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java | 4 ++-- .../java/com/rabbitmq/stream/impl/SuperStreamConsumer.java | 4 ++-- .../java/com/rabbitmq/stream/impl/SuperStreamProducer.java | 4 ++-- .../java/com/rabbitmq/stream/impl/TimeoutStreamException.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/Utils.java | 4 ++-- .../rabbitmq/stream/metrics/DropwizardMetricsCollector.java | 4 ++-- .../java/com/rabbitmq/stream/metrics/MetricsCollector.java | 4 ++-- .../rabbitmq/stream/metrics/MicrometerMetricsCollector.java | 4 ++-- .../com/rabbitmq/stream/metrics/NoOpMetricsCollector.java | 4 ++-- .../micrometer/DefaultProcessObservationConvention.java | 4 ++-- .../micrometer/DefaultPublishObservationConvention.java | 4 ++-- .../micrometer/MicrometerObservationCollector.java | 4 ++-- .../micrometer/MicrometerObservationCollectorBuilder.java | 4 ++-- .../stream/observation/micrometer/ProcessContext.java | 4 ++-- .../observation/micrometer/ProcessObservationConvention.java | 4 ++-- .../stream/observation/micrometer/PublishContext.java | 4 ++-- .../observation/micrometer/PublishObservationConvention.java | 4 ++-- .../micrometer/StreamObservationDocumentation.java | 4 ++-- .../java/com/rabbitmq/stream/sasl/CredentialsProvider.java | 4 ++-- .../com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java | 4 ++-- .../sasl/DefaultUsernamePasswordCredentialsProvider.java | 4 ++-- .../java/com/rabbitmq/stream/sasl/ExternalSaslMechanism.java | 4 ++-- .../java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java | 4 ++-- .../java/com/rabbitmq/stream/sasl/PlainSaslMechanism.java | 4 ++-- src/main/java/com/rabbitmq/stream/sasl/SaslConfiguration.java | 4 ++-- src/main/java/com/rabbitmq/stream/sasl/SaslMechanism.java | 4 ++-- .../java/com/rabbitmq/stream/sasl/StreamSaslException.java | 4 ++-- .../stream/sasl/UsernamePasswordCredentialsProvider.java | 4 ++-- src/test/java/com/rabbitmq/stream/BackOffDelayPolicyTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/ByteCapacityTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/Host.java | 4 ++-- src/test/java/com/rabbitmq/stream/HostTest.java | 4 ++-- .../rabbitmq/stream/benchmark/ChecksumAlgorithmBenchmark.java | 4 ++-- .../stream/benchmark/CompressDecompressBenchmark.java | 4 ++-- .../benchmark/EncodeDecodeForPerformanceToolBenchmark.java | 4 ++-- .../rabbitmq/stream/benchmark/EncodingDecodingBenchmark.java | 4 ++-- .../com/rabbitmq/stream/benchmark/FilteringBenchmark.java | 4 ++-- .../com/rabbitmq/stream/benchmark/HashAlgorithmBenchmark.java | 4 ++-- .../java/com/rabbitmq/stream/benchmark/ModuloBenchmark.java | 4 ++-- src/test/java/com/rabbitmq/stream/codec/CodecsTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java | 4 ++-- .../com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java | 4 ++-- .../com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/AuthenticationTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/ClientFlowControlTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/ClientParametersTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/ClientTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/CompressionCodecsTest.java | 4 ++-- .../com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java | 4 ++-- .../stream/impl/DefaultExecutorServiceFactoryTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/DeliveryTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/FilteringTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/FrameTest.java | 4 ++-- .../com/rabbitmq/stream/impl/HashRoutingStrategyTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/HashUtilsTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/HeartbeatTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java | 4 ++-- .../stream/impl/MessageCountConsumerFlowStrategyTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/MetadataTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/MetricsCollectionTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/MonitoringTestUtils.java | 4 ++-- .../com/rabbitmq/stream/impl/MqttInteroperabilityTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/NotificationTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/OffsetTest.java | 4 ++-- .../rabbitmq/stream/impl/OffsetTrackingCoordinatorTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/OffsetTrackingTest.java | 4 ++-- .../com/rabbitmq/stream/impl/OutboundMappingCallbackTest.java | 4 ++-- .../com/rabbitmq/stream/impl/ProducersCoordinatorTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/PublisherTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/RetentionClientTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/RoutePartitionsTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/SacClientTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java | 4 ++-- .../com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/ServerFrameHandlerTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/ShutdownListenerTest.java | 4 ++-- .../rabbitmq/stream/impl/SingleActiveConsumerTestSuite.java | 4 ++-- .../com/rabbitmq/stream/impl/StompInteroperabilityTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/StreamConsumerTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/StreamCreatorTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java | 4 ++-- .../com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/StreamProducerTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java | 4 ++-- .../java/com/rabbitmq/stream/impl/SubEntryBatchingTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/SubscriptionTest.java | 4 ++-- .../com/rabbitmq/stream/impl/SuperStreamConsumerTest.java | 4 ++-- .../com/rabbitmq/stream/impl/SuperStreamManagementTest.java | 4 ++-- .../com/rabbitmq/stream/impl/SuperStreamProducerTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/SuperStreamTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/TestUtils.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/TlsTest.java | 4 ++-- src/test/java/com/rabbitmq/stream/impl/UtilsTest.java | 4 ++-- .../com/rabbitmq/stream/metrics/MetricsCollectorsTest.java | 4 ++-- .../micrometer/MicrometerObservationCollectorTest.java | 4 ++-- .../rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java | 4 ++-- .../java/com/rabbitmq/stream/sasl/PlainSaslMechanismTest.java | 4 ++-- 183 files changed, 366 insertions(+), 365 deletions(-) diff --git a/pom.xml b/pom.xml index 63c9991613..0f0e2b76c4 100644 --- a/pom.xml +++ b/pom.xml @@ -500,7 +500,8 @@ - // Copyright (c) $YEAR Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + // Copyright (c) $YEAR Broadcom. All Rights Reserved. + // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/Address.java b/src/main/java/com/rabbitmq/stream/Address.java index db0a382bbe..a838d1e31c 100644 --- a/src/main/java/com/rabbitmq/stream/Address.java +++ b/src/main/java/com/rabbitmq/stream/Address.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/AddressResolver.java b/src/main/java/com/rabbitmq/stream/AddressResolver.java index 5ebfcc8b42..860806632a 100644 --- a/src/main/java/com/rabbitmq/stream/AddressResolver.java +++ b/src/main/java/com/rabbitmq/stream/AddressResolver.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/AuthenticationFailureException.java b/src/main/java/com/rabbitmq/stream/AuthenticationFailureException.java index 3afa579b77..4be66506ec 100644 --- a/src/main/java/com/rabbitmq/stream/AuthenticationFailureException.java +++ b/src/main/java/com/rabbitmq/stream/AuthenticationFailureException.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java b/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java index 3e70e140f4..ac9b730b5a 100644 --- a/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java +++ b/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/ByteCapacity.java b/src/main/java/com/rabbitmq/stream/ByteCapacity.java index a879af16b3..cc984c5250 100644 --- a/src/main/java/com/rabbitmq/stream/ByteCapacity.java +++ b/src/main/java/com/rabbitmq/stream/ByteCapacity.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/ChunkChecksum.java b/src/main/java/com/rabbitmq/stream/ChunkChecksum.java index 860f52dcd0..6547277dde 100644 --- a/src/main/java/com/rabbitmq/stream/ChunkChecksum.java +++ b/src/main/java/com/rabbitmq/stream/ChunkChecksum.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/ChunkChecksumValidationException.java b/src/main/java/com/rabbitmq/stream/ChunkChecksumValidationException.java index e2b65c5ba9..b531be77d7 100644 --- a/src/main/java/com/rabbitmq/stream/ChunkChecksumValidationException.java +++ b/src/main/java/com/rabbitmq/stream/ChunkChecksumValidationException.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/Codec.java b/src/main/java/com/rabbitmq/stream/Codec.java index d5d4ec645a..2f6941cf45 100644 --- a/src/main/java/com/rabbitmq/stream/Codec.java +++ b/src/main/java/com/rabbitmq/stream/Codec.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/ConfirmationHandler.java b/src/main/java/com/rabbitmq/stream/ConfirmationHandler.java index d70eb7c2c5..c5180ab9ec 100644 --- a/src/main/java/com/rabbitmq/stream/ConfirmationHandler.java +++ b/src/main/java/com/rabbitmq/stream/ConfirmationHandler.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/ConfirmationStatus.java b/src/main/java/com/rabbitmq/stream/ConfirmationStatus.java index 9479f0ccec..851407425f 100644 --- a/src/main/java/com/rabbitmq/stream/ConfirmationStatus.java +++ b/src/main/java/com/rabbitmq/stream/ConfirmationStatus.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/Constants.java b/src/main/java/com/rabbitmq/stream/Constants.java index fddaf44c05..05a4d2bae7 100644 --- a/src/main/java/com/rabbitmq/stream/Constants.java +++ b/src/main/java/com/rabbitmq/stream/Constants.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/Consumer.java b/src/main/java/com/rabbitmq/stream/Consumer.java index f51cfc935c..26472ab87e 100644 --- a/src/main/java/com/rabbitmq/stream/Consumer.java +++ b/src/main/java/com/rabbitmq/stream/Consumer.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/ConsumerBuilder.java b/src/main/java/com/rabbitmq/stream/ConsumerBuilder.java index 5deaa9adcb..9e391d525c 100644 --- a/src/main/java/com/rabbitmq/stream/ConsumerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ConsumerBuilder.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java b/src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java index e4af19b118..3d6b6e94b1 100644 --- a/src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java +++ b/src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/ConsumerUpdateListener.java b/src/main/java/com/rabbitmq/stream/ConsumerUpdateListener.java index e7d9c8d56e..5c5cf07410 100644 --- a/src/main/java/com/rabbitmq/stream/ConsumerUpdateListener.java +++ b/src/main/java/com/rabbitmq/stream/ConsumerUpdateListener.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/Environment.java b/src/main/java/com/rabbitmq/stream/Environment.java index 2645d61807..2ef6cfaab3 100644 --- a/src/main/java/com/rabbitmq/stream/Environment.java +++ b/src/main/java/com/rabbitmq/stream/Environment.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java index db3b6a4b2a..d8feb03670 100644 --- a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/Message.java b/src/main/java/com/rabbitmq/stream/Message.java index 70f39ddc2a..06757f4755 100644 --- a/src/main/java/com/rabbitmq/stream/Message.java +++ b/src/main/java/com/rabbitmq/stream/Message.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/MessageBuilder.java b/src/main/java/com/rabbitmq/stream/MessageBuilder.java index d9e1fcc390..908cc78534 100644 --- a/src/main/java/com/rabbitmq/stream/MessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/MessageBuilder.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/MessageHandler.java b/src/main/java/com/rabbitmq/stream/MessageHandler.java index 0aca4cb5cf..847f34733a 100644 --- a/src/main/java/com/rabbitmq/stream/MessageHandler.java +++ b/src/main/java/com/rabbitmq/stream/MessageHandler.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/NoOffsetException.java b/src/main/java/com/rabbitmq/stream/NoOffsetException.java index caf43d41b6..76385621db 100644 --- a/src/main/java/com/rabbitmq/stream/NoOffsetException.java +++ b/src/main/java/com/rabbitmq/stream/NoOffsetException.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/ObservationCollector.java b/src/main/java/com/rabbitmq/stream/ObservationCollector.java index a17744b1e9..47e9abdfc5 100644 --- a/src/main/java/com/rabbitmq/stream/ObservationCollector.java +++ b/src/main/java/com/rabbitmq/stream/ObservationCollector.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/OffsetSpecification.java b/src/main/java/com/rabbitmq/stream/OffsetSpecification.java index 55e6a8b045..dcdcbfa066 100644 --- a/src/main/java/com/rabbitmq/stream/OffsetSpecification.java +++ b/src/main/java/com/rabbitmq/stream/OffsetSpecification.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/Producer.java b/src/main/java/com/rabbitmq/stream/Producer.java index 78226efdd8..525181473d 100644 --- a/src/main/java/com/rabbitmq/stream/Producer.java +++ b/src/main/java/com/rabbitmq/stream/Producer.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java index 956ebb763c..1d340090b5 100644 --- a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/Properties.java b/src/main/java/com/rabbitmq/stream/Properties.java index 4a4be68b72..e6471e45d0 100644 --- a/src/main/java/com/rabbitmq/stream/Properties.java +++ b/src/main/java/com/rabbitmq/stream/Properties.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/RoutingStrategy.java b/src/main/java/com/rabbitmq/stream/RoutingStrategy.java index f6426d00f6..89e9225ec4 100644 --- a/src/main/java/com/rabbitmq/stream/RoutingStrategy.java +++ b/src/main/java/com/rabbitmq/stream/RoutingStrategy.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/StreamCreator.java b/src/main/java/com/rabbitmq/stream/StreamCreator.java index 125500ee71..73f1360592 100644 --- a/src/main/java/com/rabbitmq/stream/StreamCreator.java +++ b/src/main/java/com/rabbitmq/stream/StreamCreator.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/StreamDoesNotExistException.java b/src/main/java/com/rabbitmq/stream/StreamDoesNotExistException.java index 4483a55035..a7442748da 100644 --- a/src/main/java/com/rabbitmq/stream/StreamDoesNotExistException.java +++ b/src/main/java/com/rabbitmq/stream/StreamDoesNotExistException.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/StreamException.java b/src/main/java/com/rabbitmq/stream/StreamException.java index 41128c12f3..6f45150f15 100644 --- a/src/main/java/com/rabbitmq/stream/StreamException.java +++ b/src/main/java/com/rabbitmq/stream/StreamException.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/StreamNotAvailableException.java b/src/main/java/com/rabbitmq/stream/StreamNotAvailableException.java index 054ee8a141..0142ec9f4c 100644 --- a/src/main/java/com/rabbitmq/stream/StreamNotAvailableException.java +++ b/src/main/java/com/rabbitmq/stream/StreamNotAvailableException.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/StreamStats.java b/src/main/java/com/rabbitmq/stream/StreamStats.java index 4e146d0b58..1ed84a5281 100644 --- a/src/main/java/com/rabbitmq/stream/StreamStats.java +++ b/src/main/java/com/rabbitmq/stream/StreamStats.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/SubscriptionListener.java b/src/main/java/com/rabbitmq/stream/SubscriptionListener.java index b2be288c2c..4f5e5d96db 100644 --- a/src/main/java/com/rabbitmq/stream/SubscriptionListener.java +++ b/src/main/java/com/rabbitmq/stream/SubscriptionListener.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/amqp/Symbol.java b/src/main/java/com/rabbitmq/stream/amqp/Symbol.java index e5a134a31a..df59623da4 100644 --- a/src/main/java/com/rabbitmq/stream/amqp/Symbol.java +++ b/src/main/java/com/rabbitmq/stream/amqp/Symbol.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/amqp/UnsignedByte.java b/src/main/java/com/rabbitmq/stream/amqp/UnsignedByte.java index bc4ea09f86..87a36d8e34 100644 --- a/src/main/java/com/rabbitmq/stream/amqp/UnsignedByte.java +++ b/src/main/java/com/rabbitmq/stream/amqp/UnsignedByte.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/amqp/UnsignedInteger.java b/src/main/java/com/rabbitmq/stream/amqp/UnsignedInteger.java index dd2b5ccae4..6d0b87fe24 100644 --- a/src/main/java/com/rabbitmq/stream/amqp/UnsignedInteger.java +++ b/src/main/java/com/rabbitmq/stream/amqp/UnsignedInteger.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/amqp/UnsignedLong.java b/src/main/java/com/rabbitmq/stream/amqp/UnsignedLong.java index 2b32c62a8b..f862843352 100644 --- a/src/main/java/com/rabbitmq/stream/amqp/UnsignedLong.java +++ b/src/main/java/com/rabbitmq/stream/amqp/UnsignedLong.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/amqp/UnsignedShort.java b/src/main/java/com/rabbitmq/stream/amqp/UnsignedShort.java index ead79747bb..e21b42ab95 100644 --- a/src/main/java/com/rabbitmq/stream/amqp/UnsignedShort.java +++ b/src/main/java/com/rabbitmq/stream/amqp/UnsignedShort.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java b/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java index 804a1277f6..8c2bf3080a 100644 --- a/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java index 09dcc46127..60c6f0bf83 100644 --- a/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java b/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java index 77f36afe4c..6138cd65a7 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java b/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java index 9871ec2140..1f947a943d 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java index 39e43840bb..5585b4db7c 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java index 56b59fe501..cb6f5013ff 100644 --- a/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/compression/CommonsCompressCompressionCodecFactory.java b/src/main/java/com/rabbitmq/stream/compression/CommonsCompressCompressionCodecFactory.java index 1c5e9f1217..7b33171344 100644 --- a/src/main/java/com/rabbitmq/stream/compression/CommonsCompressCompressionCodecFactory.java +++ b/src/main/java/com/rabbitmq/stream/compression/CommonsCompressCompressionCodecFactory.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/compression/Compression.java b/src/main/java/com/rabbitmq/stream/compression/Compression.java index 83c80dc1d6..1fe3d41a17 100644 --- a/src/main/java/com/rabbitmq/stream/compression/Compression.java +++ b/src/main/java/com/rabbitmq/stream/compression/Compression.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/compression/CompressionCodec.java b/src/main/java/com/rabbitmq/stream/compression/CompressionCodec.java index 137b187101..66f17afdf8 100644 --- a/src/main/java/com/rabbitmq/stream/compression/CompressionCodec.java +++ b/src/main/java/com/rabbitmq/stream/compression/CompressionCodec.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/compression/CompressionCodecFactory.java b/src/main/java/com/rabbitmq/stream/compression/CompressionCodecFactory.java index 2a95ab66a5..c75be737f4 100644 --- a/src/main/java/com/rabbitmq/stream/compression/CompressionCodecFactory.java +++ b/src/main/java/com/rabbitmq/stream/compression/CompressionCodecFactory.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/compression/CompressionException.java b/src/main/java/com/rabbitmq/stream/compression/CompressionException.java index c674cbdd62..b8519347bf 100644 --- a/src/main/java/com/rabbitmq/stream/compression/CompressionException.java +++ b/src/main/java/com/rabbitmq/stream/compression/CompressionException.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/compression/CompressionUtils.java b/src/main/java/com/rabbitmq/stream/compression/CompressionUtils.java index 5171edc405..1717f81484 100644 --- a/src/main/java/com/rabbitmq/stream/compression/CompressionUtils.java +++ b/src/main/java/com/rabbitmq/stream/compression/CompressionUtils.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/compression/DefaultCompressionCodecFactory.java b/src/main/java/com/rabbitmq/stream/compression/DefaultCompressionCodecFactory.java index 332d6ce0b7..1607adf704 100644 --- a/src/main/java/com/rabbitmq/stream/compression/DefaultCompressionCodecFactory.java +++ b/src/main/java/com/rabbitmq/stream/compression/DefaultCompressionCodecFactory.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java b/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java index 65c46f8995..0354988996 100644 --- a/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java +++ b/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index ca668fd168..5f8cb2a214 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java b/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java index 2a6c206585..5985596645 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java +++ b/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/Clock.java b/src/main/java/com/rabbitmq/stream/impl/Clock.java index f2a2f615df..45c1a0197a 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Clock.java +++ b/src/main/java/com/rabbitmq/stream/impl/Clock.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/Codecs.java b/src/main/java/com/rabbitmq/stream/impl/Codecs.java index ab9fa008ef..49e9321fba 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Codecs.java +++ b/src/main/java/com/rabbitmq/stream/impl/Codecs.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/CompressionCodecs.java b/src/main/java/com/rabbitmq/stream/impl/CompressionCodecs.java index 1928205ad6..10087836d7 100644 --- a/src/main/java/com/rabbitmq/stream/impl/CompressionCodecs.java +++ b/src/main/java/com/rabbitmq/stream/impl/CompressionCodecs.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/ConnectionStreamException.java b/src/main/java/com/rabbitmq/stream/impl/ConnectionStreamException.java index 9bb278aad7..21c43a01de 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConnectionStreamException.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConnectionStreamException.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java index ce8fdf9f74..c88d571fa6 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java b/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java index 0c2757d575..2eb494a260 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java +++ b/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/ExecutorServiceFactory.java b/src/main/java/com/rabbitmq/stream/impl/ExecutorServiceFactory.java index e1971189df..938db67c8e 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ExecutorServiceFactory.java +++ b/src/main/java/com/rabbitmq/stream/impl/ExecutorServiceFactory.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/HashRoutingStrategy.java b/src/main/java/com/rabbitmq/stream/impl/HashRoutingStrategy.java index 3335cf1c88..1b80c938ea 100644 --- a/src/main/java/com/rabbitmq/stream/impl/HashRoutingStrategy.java +++ b/src/main/java/com/rabbitmq/stream/impl/HashRoutingStrategy.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/HashUtils.java b/src/main/java/com/rabbitmq/stream/impl/HashUtils.java index b89a714756..705e4bc48c 100644 --- a/src/main/java/com/rabbitmq/stream/impl/HashUtils.java +++ b/src/main/java/com/rabbitmq/stream/impl/HashUtils.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java b/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java index da64d4f0f3..33e7174c48 100644 --- a/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java +++ b/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java index 18298c7557..c35271f29f 100644 --- a/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/MessageBatch.java b/src/main/java/com/rabbitmq/stream/impl/MessageBatch.java index 34e5e23bb6..5016830cb0 100644 --- a/src/main/java/com/rabbitmq/stream/impl/MessageBatch.java +++ b/src/main/java/com/rabbitmq/stream/impl/MessageBatch.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinator.java index 179dc71353..b88c612ba7 100644 --- a/src/main/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinator.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/ParameterizedTypeReference.java b/src/main/java/com/rabbitmq/stream/impl/ParameterizedTypeReference.java index 2a07ef6fa9..d10306e2e7 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ParameterizedTypeReference.java +++ b/src/main/java/com/rabbitmq/stream/impl/ParameterizedTypeReference.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java index 57e82d67fb..36b6a5f4ba 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/RoutingKeyRoutingStrategy.java b/src/main/java/com/rabbitmq/stream/impl/RoutingKeyRoutingStrategy.java index 46d33d2bba..3cbd3b27df 100644 --- a/src/main/java/com/rabbitmq/stream/impl/RoutingKeyRoutingStrategy.java +++ b/src/main/java/com/rabbitmq/stream/impl/RoutingKeyRoutingStrategy.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java b/src/main/java/com/rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java index 47308b7d57..94652f5afb 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java +++ b/src/main/java/com/rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java index bd0dc3c84e..c646803eae 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java +++ b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java index dc18c8687d..718f253da7 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java index 4e11f3cfdf..72d86eece0 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java index 3a077ae918..7e2a428b9d 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index c457b44796..cfbbfaec83 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java index b31f93ba6d..8c2039da17 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index 5a72ac4c2b..855004fead 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java index b5f5f30263..0497c53e64 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java b/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java index c7986f72d3..f0928487ec 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java index c2c0d8b1e6..9693aea50c 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/SuperStreamConsumer.java b/src/main/java/com/rabbitmq/stream/impl/SuperStreamConsumer.java index 7b0d844548..ce417b6b91 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SuperStreamConsumer.java +++ b/src/main/java/com/rabbitmq/stream/impl/SuperStreamConsumer.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/SuperStreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/SuperStreamProducer.java index 4f4af0ea62..e6bb3b94d1 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SuperStreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/SuperStreamProducer.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/TimeoutStreamException.java b/src/main/java/com/rabbitmq/stream/impl/TimeoutStreamException.java index 092a387704..cf1f630e9b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/TimeoutStreamException.java +++ b/src/main/java/com/rabbitmq/stream/impl/TimeoutStreamException.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index 70d4086ad5..4a861cbba3 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/metrics/DropwizardMetricsCollector.java b/src/main/java/com/rabbitmq/stream/metrics/DropwizardMetricsCollector.java index 859dfddbe4..1bb2c4600c 100644 --- a/src/main/java/com/rabbitmq/stream/metrics/DropwizardMetricsCollector.java +++ b/src/main/java/com/rabbitmq/stream/metrics/DropwizardMetricsCollector.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/metrics/MetricsCollector.java b/src/main/java/com/rabbitmq/stream/metrics/MetricsCollector.java index 87e9474c33..7cfc79a729 100644 --- a/src/main/java/com/rabbitmq/stream/metrics/MetricsCollector.java +++ b/src/main/java/com/rabbitmq/stream/metrics/MetricsCollector.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/metrics/MicrometerMetricsCollector.java b/src/main/java/com/rabbitmq/stream/metrics/MicrometerMetricsCollector.java index c3fb86abea..4010d8e99e 100644 --- a/src/main/java/com/rabbitmq/stream/metrics/MicrometerMetricsCollector.java +++ b/src/main/java/com/rabbitmq/stream/metrics/MicrometerMetricsCollector.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/metrics/NoOpMetricsCollector.java b/src/main/java/com/rabbitmq/stream/metrics/NoOpMetricsCollector.java index fdd6c34a4b..885dde49d4 100644 --- a/src/main/java/com/rabbitmq/stream/metrics/NoOpMetricsCollector.java +++ b/src/main/java/com/rabbitmq/stream/metrics/NoOpMetricsCollector.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultProcessObservationConvention.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultProcessObservationConvention.java index db20684965..bf4ec8bc33 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultProcessObservationConvention.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultProcessObservationConvention.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultPublishObservationConvention.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultPublishObservationConvention.java index d01bfc7138..005b793a1b 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultPublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultPublishObservationConvention.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollector.java index 75367f1ca2..72e3afb97f 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollector.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorBuilder.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorBuilder.java index bfcdd9b447..29c98ef28a 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorBuilder.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorBuilder.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessContext.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessContext.java index bdb155d76f..c281891624 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessContext.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessContext.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessObservationConvention.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessObservationConvention.java index b5ca7474f7..3e6045c1d7 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessObservationConvention.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessObservationConvention.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishContext.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishContext.java index 535e0cc791..1e5f8e6507 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishContext.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishContext.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishObservationConvention.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishObservationConvention.java index e098b566df..db3ca18344 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishObservationConvention.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/StreamObservationDocumentation.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/StreamObservationDocumentation.java index cb4e4f4d43..aeaa4446e1 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/StreamObservationDocumentation.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/StreamObservationDocumentation.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/sasl/CredentialsProvider.java b/src/main/java/com/rabbitmq/stream/sasl/CredentialsProvider.java index 1e98c5a5f7..96e211e632 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/CredentialsProvider.java +++ b/src/main/java/com/rabbitmq/stream/sasl/CredentialsProvider.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java b/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java index 70affae74f..b8e351b59d 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java +++ b/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/sasl/DefaultUsernamePasswordCredentialsProvider.java b/src/main/java/com/rabbitmq/stream/sasl/DefaultUsernamePasswordCredentialsProvider.java index 5fbfecebc8..601b2c533a 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/DefaultUsernamePasswordCredentialsProvider.java +++ b/src/main/java/com/rabbitmq/stream/sasl/DefaultUsernamePasswordCredentialsProvider.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/sasl/ExternalSaslMechanism.java b/src/main/java/com/rabbitmq/stream/sasl/ExternalSaslMechanism.java index 67c7e64a0f..c1bc2579d7 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/ExternalSaslMechanism.java +++ b/src/main/java/com/rabbitmq/stream/sasl/ExternalSaslMechanism.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java b/src/main/java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java index 1c732e94e0..13ae33c70f 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java +++ b/src/main/java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/sasl/PlainSaslMechanism.java b/src/main/java/com/rabbitmq/stream/sasl/PlainSaslMechanism.java index 36ad4083b0..8fe0b7a687 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/PlainSaslMechanism.java +++ b/src/main/java/com/rabbitmq/stream/sasl/PlainSaslMechanism.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/sasl/SaslConfiguration.java b/src/main/java/com/rabbitmq/stream/sasl/SaslConfiguration.java index 92c2d08e5f..7e32581355 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/SaslConfiguration.java +++ b/src/main/java/com/rabbitmq/stream/sasl/SaslConfiguration.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/sasl/SaslMechanism.java b/src/main/java/com/rabbitmq/stream/sasl/SaslMechanism.java index 2f9adc8cb5..26b75a9406 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/SaslMechanism.java +++ b/src/main/java/com/rabbitmq/stream/sasl/SaslMechanism.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/sasl/StreamSaslException.java b/src/main/java/com/rabbitmq/stream/sasl/StreamSaslException.java index 12f8a035d6..252b16de52 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/StreamSaslException.java +++ b/src/main/java/com/rabbitmq/stream/sasl/StreamSaslException.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/main/java/com/rabbitmq/stream/sasl/UsernamePasswordCredentialsProvider.java b/src/main/java/com/rabbitmq/stream/sasl/UsernamePasswordCredentialsProvider.java index ca849c9a27..a61398f332 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/UsernamePasswordCredentialsProvider.java +++ b/src/main/java/com/rabbitmq/stream/sasl/UsernamePasswordCredentialsProvider.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/BackOffDelayPolicyTest.java b/src/test/java/com/rabbitmq/stream/BackOffDelayPolicyTest.java index 21f157d1b1..6d6dc5fecb 100644 --- a/src/test/java/com/rabbitmq/stream/BackOffDelayPolicyTest.java +++ b/src/test/java/com/rabbitmq/stream/BackOffDelayPolicyTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/ByteCapacityTest.java b/src/test/java/com/rabbitmq/stream/ByteCapacityTest.java index 6fd87de86d..00edc8ccf2 100644 --- a/src/test/java/com/rabbitmq/stream/ByteCapacityTest.java +++ b/src/test/java/com/rabbitmq/stream/ByteCapacityTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java b/src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java index de78b978be..bf106a7215 100644 --- a/src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java +++ b/src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/Host.java b/src/test/java/com/rabbitmq/stream/Host.java index 10a263a01c..28b63de828 100644 --- a/src/test/java/com/rabbitmq/stream/Host.java +++ b/src/test/java/com/rabbitmq/stream/Host.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/HostTest.java b/src/test/java/com/rabbitmq/stream/HostTest.java index 2ed89e0c9a..bfe3e81157 100644 --- a/src/test/java/com/rabbitmq/stream/HostTest.java +++ b/src/test/java/com/rabbitmq/stream/HostTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/benchmark/ChecksumAlgorithmBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/ChecksumAlgorithmBenchmark.java index b3a03acd58..88a1717a3e 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/ChecksumAlgorithmBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/ChecksumAlgorithmBenchmark.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/benchmark/CompressDecompressBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/CompressDecompressBenchmark.java index 417a0c5090..5ed348040f 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/CompressDecompressBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/CompressDecompressBenchmark.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/benchmark/EncodeDecodeForPerformanceToolBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/EncodeDecodeForPerformanceToolBenchmark.java index 86e73459e2..70c391373b 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/EncodeDecodeForPerformanceToolBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/EncodeDecodeForPerformanceToolBenchmark.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/benchmark/EncodingDecodingBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/EncodingDecodingBenchmark.java index b2d64070a8..a9f4fc948f 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/EncodingDecodingBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/EncodingDecodingBenchmark.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/benchmark/FilteringBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/FilteringBenchmark.java index 5e53182051..9677b0b359 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/FilteringBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/FilteringBenchmark.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/benchmark/HashAlgorithmBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/HashAlgorithmBenchmark.java index f08e5abb5f..10f4a76638 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/HashAlgorithmBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/HashAlgorithmBenchmark.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/benchmark/ModuloBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/ModuloBenchmark.java index df7344bfce..e2c77c9926 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/ModuloBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/ModuloBenchmark.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/codec/CodecsTest.java b/src/test/java/com/rabbitmq/stream/codec/CodecsTest.java index 9dee3dc74f..5179cf278b 100644 --- a/src/test/java/com/rabbitmq/stream/codec/CodecsTest.java +++ b/src/test/java/com/rabbitmq/stream/codec/CodecsTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java b/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java index 0a30e807be..27121f00b2 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java index e0a84f9fb3..264fabba70 100644 --- a/src/test/java/com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java index 620030d4c3..f20019054a 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java b/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java index 75bcde1d05..fb6db57bc7 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java b/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java index 83c1e091bf..91040c5523 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java b/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java index 8a86547fbf..f1d679b751 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/ClientFlowControlTest.java b/src/test/java/com/rabbitmq/stream/impl/ClientFlowControlTest.java index a0758bd5fa..420e8fa916 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ClientFlowControlTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ClientFlowControlTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/ClientParametersTest.java b/src/test/java/com/rabbitmq/stream/impl/ClientParametersTest.java index 947cc4ae1d..f94bbc32a6 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ClientParametersTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ClientParametersTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/ClientTest.java b/src/test/java/com/rabbitmq/stream/impl/ClientTest.java index d7deeacfe5..d3320153d8 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ClientTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ClientTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/CompressionCodecsTest.java b/src/test/java/com/rabbitmq/stream/impl/CompressionCodecsTest.java index ce5d1044ff..c172934d9f 100644 --- a/src/test/java/com/rabbitmq/stream/impl/CompressionCodecsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/CompressionCodecsTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java index 3bd6d24025..110e5b946b 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactoryTest.java b/src/test/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactoryTest.java index 853e7fa5ce..085766f4bc 100644 --- a/src/test/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactoryTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactoryTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/DeliveryTest.java b/src/test/java/com/rabbitmq/stream/impl/DeliveryTest.java index 8371940a0e..27d3724a6c 100644 --- a/src/test/java/com/rabbitmq/stream/impl/DeliveryTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/DeliveryTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/FilteringTest.java b/src/test/java/com/rabbitmq/stream/impl/FilteringTest.java index 2b8ebbb638..54740b8a5d 100644 --- a/src/test/java/com/rabbitmq/stream/impl/FilteringTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/FilteringTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/FrameTest.java b/src/test/java/com/rabbitmq/stream/impl/FrameTest.java index 1c12a35557..6202dc61b5 100644 --- a/src/test/java/com/rabbitmq/stream/impl/FrameTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/FrameTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/HashRoutingStrategyTest.java b/src/test/java/com/rabbitmq/stream/impl/HashRoutingStrategyTest.java index 56ce9691f8..5b7406d363 100644 --- a/src/test/java/com/rabbitmq/stream/impl/HashRoutingStrategyTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/HashRoutingStrategyTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2022-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2022-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/HashUtilsTest.java b/src/test/java/com/rabbitmq/stream/impl/HashUtilsTest.java index a1fa9c9b79..e7f1e16b5f 100644 --- a/src/test/java/com/rabbitmq/stream/impl/HashUtilsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/HashUtilsTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/HeartbeatTest.java b/src/test/java/com/rabbitmq/stream/impl/HeartbeatTest.java index 2618b21fb7..bfe25b6557 100644 --- a/src/test/java/com/rabbitmq/stream/impl/HeartbeatTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/HeartbeatTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java b/src/test/java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java index 534ed59446..e6016b72d1 100644 --- a/src/test/java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/MessageCountConsumerFlowStrategyTest.java b/src/test/java/com/rabbitmq/stream/impl/MessageCountConsumerFlowStrategyTest.java index 81f5c81f51..34166a8f2e 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MessageCountConsumerFlowStrategyTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/MessageCountConsumerFlowStrategyTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/MetadataTest.java b/src/test/java/com/rabbitmq/stream/impl/MetadataTest.java index d1633caac9..cd7f6266c3 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MetadataTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/MetadataTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/MetricsCollectionTest.java b/src/test/java/com/rabbitmq/stream/impl/MetricsCollectionTest.java index 374d0472a2..069fe3f427 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MetricsCollectionTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/MetricsCollectionTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/MonitoringTestUtils.java b/src/test/java/com/rabbitmq/stream/impl/MonitoringTestUtils.java index 7f45b1fec2..4fc9ae051a 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MonitoringTestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/MonitoringTestUtils.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/MqttInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/MqttInteroperabilityTest.java index 797ca242c2..372cd612a1 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MqttInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/MqttInteroperabilityTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/NotificationTest.java b/src/test/java/com/rabbitmq/stream/impl/NotificationTest.java index f3073d0490..320bc4128a 100644 --- a/src/test/java/com/rabbitmq/stream/impl/NotificationTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/NotificationTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/OffsetTest.java b/src/test/java/com/rabbitmq/stream/impl/OffsetTest.java index 0057925ce2..8663026b08 100644 --- a/src/test/java/com/rabbitmq/stream/impl/OffsetTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/OffsetTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinatorTest.java index 54138ac96c..4af5ee44a6 100644 --- a/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinatorTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingTest.java b/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingTest.java index e1b73f56f2..ab3399c799 100644 --- a/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/OutboundMappingCallbackTest.java b/src/test/java/com/rabbitmq/stream/impl/OutboundMappingCallbackTest.java index c0865c5b49..f0d98f1db4 100644 --- a/src/test/java/com/rabbitmq/stream/impl/OutboundMappingCallbackTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/OutboundMappingCallbackTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java index 68ed0cd4dd..34817e6752 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/PublisherTest.java b/src/test/java/com/rabbitmq/stream/impl/PublisherTest.java index d6a31d4b99..e9eac1fcec 100644 --- a/src/test/java/com/rabbitmq/stream/impl/PublisherTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/PublisherTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/RetentionClientTest.java b/src/test/java/com/rabbitmq/stream/impl/RetentionClientTest.java index c76c3db892..dc25d4f50a 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RetentionClientTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RetentionClientTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/RoutePartitionsTest.java b/src/test/java/com/rabbitmq/stream/impl/RoutePartitionsTest.java index 93980c1b81..300fd1e07f 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RoutePartitionsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RoutePartitionsTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/SacClientTest.java b/src/test/java/com/rabbitmq/stream/impl/SacClientTest.java index 7eb8924f00..e0405968fb 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SacClientTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SacClientTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2022-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2022-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java index beab11cd85..af108a9659 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2022-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2022-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java index 7864118563..afb8e86131 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/ServerFrameHandlerTest.java b/src/test/java/com/rabbitmq/stream/impl/ServerFrameHandlerTest.java index 2581d6580c..1859236a3b 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ServerFrameHandlerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ServerFrameHandlerTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/ShutdownListenerTest.java b/src/test/java/com/rabbitmq/stream/impl/ShutdownListenerTest.java index 93bfee3e0a..d6dc802305 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ShutdownListenerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ShutdownListenerTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/SingleActiveConsumerTestSuite.java b/src/test/java/com/rabbitmq/stream/impl/SingleActiveConsumerTestSuite.java index cf46d49dac..49464fd02c 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SingleActiveConsumerTestSuite.java +++ b/src/test/java/com/rabbitmq/stream/impl/SingleActiveConsumerTestSuite.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/StompInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/StompInteroperabilityTest.java index 8566d44043..a0ebfaee58 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StompInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StompInteroperabilityTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java index 9c676937d7..f0e1a44108 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java index 3fab5e8849..5f7556d43d 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamCreatorTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamCreatorTest.java index f0445a01c6..3969c9dad7 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamCreatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamCreatorTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java index 003e0eae79..064f8f2e2c 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java index 7d80172660..c422d454a3 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java index 775f12eb97..6cf06356d0 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java index ecc1440ee6..92fa41d124 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/SubEntryBatchingTest.java b/src/test/java/com/rabbitmq/stream/impl/SubEntryBatchingTest.java index c7eb7891f1..6816919428 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SubEntryBatchingTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SubEntryBatchingTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/SubscriptionTest.java b/src/test/java/com/rabbitmq/stream/impl/SubscriptionTest.java index d7cc8df41b..ecdb5e7425 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SubscriptionTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SubscriptionTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java index fb41100709..11b0ff360e 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/SuperStreamManagementTest.java b/src/test/java/com/rabbitmq/stream/impl/SuperStreamManagementTest.java index 88da50289f..1e74973362 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SuperStreamManagementTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SuperStreamManagementTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/SuperStreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/SuperStreamProducerTest.java index a08f6ba50c..47f5ec9ff6 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SuperStreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SuperStreamProducerTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/SuperStreamTest.java b/src/test/java/com/rabbitmq/stream/impl/SuperStreamTest.java index 2d5db3f42e..ea14c8fdf8 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SuperStreamTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SuperStreamTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index 1b676e53fc..205222f5ff 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java b/src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java index b1e889fa25..a67fcd1d69 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/TlsTest.java b/src/test/java/com/rabbitmq/stream/impl/TlsTest.java index e45b89e171..1b1a88404c 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TlsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/TlsTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/UtilsTest.java b/src/test/java/com/rabbitmq/stream/impl/UtilsTest.java index dc83319e31..b8b3e8c1b3 100644 --- a/src/test/java/com/rabbitmq/stream/impl/UtilsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/UtilsTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/metrics/MetricsCollectorsTest.java b/src/test/java/com/rabbitmq/stream/metrics/MetricsCollectorsTest.java index 638913de7a..0f0dab16de 100644 --- a/src/test/java/com/rabbitmq/stream/metrics/MetricsCollectorsTest.java +++ b/src/test/java/com/rabbitmq/stream/metrics/MetricsCollectorsTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorTest.java b/src/test/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorTest.java index 026b90e641..bd027d0aec 100644 --- a/src/test/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorTest.java +++ b/src/test/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. -// and/or its subsidiaries. +// Copyright (c) 2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java b/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java index 579f955eff..49acf86d90 100644 --- a/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java +++ b/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/sasl/PlainSaslMechanismTest.java b/src/test/java/com/rabbitmq/stream/sasl/PlainSaslMechanismTest.java index 011df695aa..273cac924e 100644 --- a/src/test/java/com/rabbitmq/stream/sasl/PlainSaslMechanismTest.java +++ b/src/test/java/com/rabbitmq/stream/sasl/PlainSaslMechanismTest.java @@ -1,5 +1,5 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom -// Inc. and/or its subsidiaries. +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). From 2995be4790c471309ba05da7f4a7067f301c4a45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:50:47 +0000 Subject: [PATCH 028/449] Bump io.dropwizard.metrics:metrics-core from 4.2.24 to 4.2.25 Bumps [io.dropwizard.metrics:metrics-core](https://github.com/dropwizard/metrics) from 4.2.24 to 4.2.25. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.24...v4.2.25) --- updated-dependencies: - dependency-name: io.dropwizard.metrics:metrics-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0f0e2b76c4..87538bc454 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 1.2.12 4.1.106.Final 0.34.1 - 4.2.24 + 4.2.25 1.12.2 12.2.2 4.7.5 From 85c50f24f29ff63fe3fb584c5313bc23fcba6e9b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:50:54 +0000 Subject: [PATCH 029/449] Bump org.mockito:mockito-core from 5.9.0 to 5.10.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.9.0 to 5.10.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.9.0...v5.10.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0f0e2b76c4..f6a221a218 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.1.10.5 5.10.1 3.25.1 - 5.9.0 + 5.10.0 5.20.0 3.14.0 1.16.0 From bf3fb65e0b666cf7679536bc0bf8c546549eeb7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Jan 2024 08:08:14 +0000 Subject: [PATCH 030/449] Bump org.assertj:assertj-core from 3.25.1 to 3.25.2 Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.25.1 to 3.25.2. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.25.1...assertj-build-3.25.2) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3d60318796..6c2627b30d 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.8.0 1.1.10.5 5.10.1 - 3.25.1 + 3.25.2 5.10.0 5.20.0 3.14.0 From 929d8b99e038c76b64a1d178a10f36b9701d37ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:48:59 +0000 Subject: [PATCH 031/449] Bump org.assertj:assertj-core from 3.25.2 to 3.25.3 Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.25.2 to 3.25.3. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.25.2...assertj-build-3.25.3) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6c2627b30d..5021170d42 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.8.0 1.1.10.5 5.10.1 - 3.25.2 + 3.25.3 5.10.0 5.20.0 3.14.0 From af5d1f01a670ac09c8d95d30e5aaae9c1e4c2ec0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:49:11 +0000 Subject: [PATCH 032/449] Bump org.asciidoctor:asciidoctorj-diagram from 2.2.14 to 2.2.17 Bumps [org.asciidoctor:asciidoctorj-diagram](https://github.com/asciidoctor/asciidoctorj-diagram) from 2.2.14 to 2.2.17. - [Release notes](https://github.com/asciidoctor/asciidoctorj-diagram/releases) - [Commits](https://github.com/asciidoctor/asciidoctorj-diagram/compare/v2.2.14...v2.2.17) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj-diagram dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6c2627b30d..719fccb821 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.4.0 2.2.5 2.5.11 - 2.2.14 + 2.2.17 1.4 1.37 2.43.0 From 61df702794c47fcdff4dada343cb9610daf8161b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:55:01 +0000 Subject: [PATCH 033/449] Bump org.junit:junit-bom from 5.10.1 to 5.10.2 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.10.1 to 5.10.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.1...r5.10.2) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1a2ba3b648..767f60ef48 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.5.5-11 1.8.0 1.1.10.5 - 5.10.1 + 5.10.2 3.25.3 5.10.0 5.20.0 From 762e57ae40be7171cf9301e1f66dea35b419e373 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Feb 2024 16:16:18 +0000 Subject: [PATCH 034/449] Bump commons-codec:commons-codec from 1.16.0 to 1.16.1 Bumps [commons-codec:commons-codec](https://github.com/apache/commons-codec) from 1.16.0 to 1.16.1. - [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.16.0...rel/commons-codec-1.16.1) --- updated-dependencies: - dependency-name: commons-codec:commons-codec dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 767f60ef48..d615d2f569 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 5.10.0 5.20.0 3.14.0 - 1.16.0 + 1.16.1 2.10.1 0.10.4 1.2.5 From 8472460c866dd3b0ad79db31af690205d1138fdd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 15:14:32 +0000 Subject: [PATCH 035/449] Bump org.asciidoctor:asciidoctorj-diagram from 2.2.17 to 2.3.0 Bumps [org.asciidoctor:asciidoctorj-diagram](https://github.com/asciidoctor/asciidoctorj-diagram) from 2.2.17 to 2.3.0. - [Release notes](https://github.com/asciidoctor/asciidoctorj-diagram/releases) - [Commits](https://github.com/asciidoctor/asciidoctorj-diagram/commits) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj-diagram dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d615d2f569..b4ae7f370f 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.4.0 2.2.5 2.5.11 - 2.2.17 + 2.3.0 1.4 1.37 2.43.0 From 1dd360d3476378c5cafa701bd38c3d802922983d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 15:14:45 +0000 Subject: [PATCH 036/449] Bump org.asciidoctor:asciidoctor-maven-plugin from 2.2.5 to 2.2.6 Bumps [org.asciidoctor:asciidoctor-maven-plugin](https://github.com/asciidoctor/asciidoctor-maven-plugin) from 2.2.5 to 2.2.6. - [Release notes](https://github.com/asciidoctor/asciidoctor-maven-plugin/releases) - [Changelog](https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/asciidoctor-maven-plugin-2.2.6/CHANGELOG.adoc) - [Commits](https://github.com/asciidoctor/asciidoctor-maven-plugin/compare/asciidoctor-maven-plugin-2.2.5...asciidoctor-maven-plugin-2.2.6) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctor-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d615d2f569..392b865b8a 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.6.3 3.3.0 3.4.0 - 2.2.5 + 2.2.6 2.5.11 2.2.17 1.4 From ced0560258ed824055c1d79eb71d02e8b8dfa792 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:42:50 +0000 Subject: [PATCH 037/449] Bump netty.version from 4.1.106.Final to 4.1.107.Final Bumps `netty.version` from 4.1.106.Final to 4.1.107.Final. Updates `io.netty:netty-transport` from 4.1.106.Final to 4.1.107.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.106.Final...netty-4.1.107.Final) Updates `io.netty:netty-codec` from 4.1.106.Final to 4.1.107.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.106.Final...netty-4.1.107.Final) Updates `io.netty:netty-handler` from 4.1.106.Final to 4.1.107.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.106.Final...netty-4.1.107.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.106.Final to 4.1.107.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.106.Final...netty-4.1.107.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cb65322bc6..a3b49396d0 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.12 - 4.1.106.Final + 4.1.107.Final 0.34.1 4.2.25 1.12.2 From 7a3b1622638155dbcbda43268fa71c0ed57ed463 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:42:54 +0000 Subject: [PATCH 038/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.2.2...v1.2.3) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cb65322bc6..2eb84fa355 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.10.1 0.10.4 1.2.5 - 1.2.2 + 1.2.3 1.0.2 3.12.1 3.2.5 From 2fa9fec4c4bb6092f8173ceb99da8c18e21c6f4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 16:43:05 +0000 Subject: [PATCH 039/449] Bump io.micrometer:micrometer-core from 1.12.2 to 1.12.3 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.12.2 to 1.12.3. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.12.2...v1.12.3) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cb65322bc6..3fc2ee1fa6 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.106.Final 0.34.1 4.2.25 - 1.12.2 + 1.12.3 12.2.2 4.7.5 1.25.0 From 053811a7c754a6951359d872a432b75d413edce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 14 Feb 2024 15:07:37 +0100 Subject: [PATCH 040/449] Add Logback dependency (test) --- pom.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5b8412981d..aa37aa9961 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,7 @@ true 1.7.36 - 1.2.12 + 1.2.13 4.1.107.Final 0.34.1 4.2.25 @@ -289,6 +289,12 @@ ${jmh.version} test + + ch.qos.logback + logback-classic + ${logback.version} + test + From 12b90fb05f4617b90b68d6e2e5958feb82bd3fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 15 Feb 2024 09:11:42 +0100 Subject: [PATCH 041/449] Do not upgrade Logback after 1.2.x It's not compatible with SLF4J 1.7.x and it is just used as a test dependency in the project. --- .github/dependabot.yml | 4 ++-- pom.xml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c7a053526a..03a868b14b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,10 +9,10 @@ updates: open-pull-requests-limit: 20 ignore: - dependency-name: "com.swiftmq:swiftmq-client" - - dependency-name: "org.springframework.boot:spring-boot-maven-plugin" - versions: ["[2.7,)"] - dependency-name: "org.slf4j:slf4j-api" versions: [ "[2.0,)" ] + - dependency-name: "ch.qos.logback:logback-classic" + versions: [ "[1.3,)" ] - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/pom.xml b/pom.xml index aa37aa9961..96c2e6f467 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,6 @@ 1.0.2 3.12.1 3.2.5 - 2.7.6 1.11 3.1.0 3.2.0 From 1be316688292efc3e6ce4a38d18738c503f86329 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 15 Feb 2024 08:13:40 +0000 Subject: [PATCH 042/449] Bump org.asciidoctor:asciidoctor-maven-plugin from 2.2.6 to 3.0.0 Bumps [org.asciidoctor:asciidoctor-maven-plugin](https://github.com/asciidoctor/asciidoctor-maven-plugin) from 2.2.6 to 3.0.0. - [Release notes](https://github.com/asciidoctor/asciidoctor-maven-plugin/releases) - [Changelog](https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/main/CHANGELOG.adoc) - [Commits](https://github.com/asciidoctor/asciidoctor-maven-plugin/compare/asciidoctor-maven-plugin-2.2.6...asciidoctor-maven-tools-3.0.0) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctor-maven-plugin 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 96c2e6f467..8e4c3265c6 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ 3.6.3 3.3.0 3.4.0 - 2.2.6 + 3.0.0 2.5.11 2.3.0 1.4 From 0ecb20a4d694560d3a8ba0b8dab909fc7db0a59d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 16:29:59 +0000 Subject: [PATCH 043/449] Bump org.apache.commons:commons-compress from 1.25.0 to 1.26.0 Bumps org.apache.commons:commons-compress from 1.25.0 to 1.26.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-compress dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8e4c3265c6..58777f0957 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.12.3 12.2.2 4.7.5 - 1.25.0 + 1.26.0 1.5.5-11 1.8.0 1.1.10.5 From 459209ad78a35964d0327647e887c21e9fb0c610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 26 Feb 2024 10:18:38 +0100 Subject: [PATCH 044/449] Remove performance tool packaging script --- ci/package-stream-perf-test.sh | 46 ---------------------------------- 1 file changed, 46 deletions(-) delete mode 100755 ci/package-stream-perf-test.sh diff --git a/ci/package-stream-perf-test.sh b/ci/package-stream-perf-test.sh deleted file mode 100755 index 35f36bbc1c..0000000000 --- a/ci/package-stream-perf-test.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash - -source $(pwd)/performance-tool.txt -source $(pwd)/release-versions.txt - -if [ -z ${RELEASE+x} ] -then - CURRENT_DATE=$(date --utc '+%Y%m%d-%H%M%S') - RELEASE_VERSION="$(cat pom.xml | grep -oPm1 '(?<=)[^<]+')-$CURRENT_DATE" - FINAL_NAME="$PERF_TOOL_BASE_NAME-$RELEASE_VERSION" -fi - -FINAL_NAME="$PERF_TOOL_BASE_NAME-$RELEASE_VERSION" - -mkdir packages - -./mvnw clean package checksum:files gpg:sign -Dgpg.skip=false -Dmaven.test.skip -P performance-tool -DfinalName="$FINAL_NAME" --no-transfer-progress - -./mvnw test-compile exec:java -Dexec.mainClass="picocli.AutoComplete" -Dexec.classpathScope=test -Dexec.args="-f -n $PERF_TOOL_BASE_NAME com.rabbitmq.stream.perf.AggregatingCommandForAutoComplete" --no-transfer-progress -cp "$PERF_TOOL_BASE_NAME"_completion packages/"$PERF_TOOL_BASE_NAME"-"$RELEASE_VERSION"_completion - -rm target/*.original -cp target/"$FINAL_NAME".jar packages -cp target/"$FINAL_NAME".jar.* packages - -if [ -z ${RELEASE+x} ] -then - mkdir packages-latest - cp target/"$FINAL_NAME".jar packages-latest - cp target/"$FINAL_NAME".jar.* packages-latest - cp packages/*_completion packages-latest - - for filename in packages-latest/*; do - [ -f "$filename" ] || continue - filename_without_version=$(echo "$filename" | sed -e "s/$RELEASE_VERSION/latest/g") - mv "$filename" "$filename_without_version" - done - echo "release_name=$PERF_TOOL_BASE_NAME-$RELEASE_VERSION" >> $GITHUB_ENV - echo "tag_name=v-$PERF_TOOL_BASE_NAME-$RELEASE_VERSION" >> $GITHUB_ENV -else - echo "release_name=$RELEASE_VERSION" >> $GITHUB_ENV - echo "tag_name=v$RELEASE_VERSION" >> $GITHUB_ENV -fi - -echo "release_version=$RELEASE_VERSION" >> $GITHUB_ENV -echo "release_branch=$RELEASE_BRANCH" >> $GITHUB_ENV From ff812d8958b20aec7ff363f75928461a9a45a7ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 26 Feb 2024 10:20:48 +0100 Subject: [PATCH 045/449] Use RabbitMQ 3.13 in test suite --- .github/workflows/test-rabbitmq-alphas.yml | 2 +- ci/start-broker.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index c8b2b000a7..244ce1d25e 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v3.12.x-otp-max-bazel', 'pivotalrabbitmq/rabbitmq:main-otp-max-bazel' ] + rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v3.13.x-otp-max-bazel', 'pivotalrabbitmq/rabbitmq:main-otp-max-bazel' ] name: Test against ${{ matrix.rabbitmq-image }} steps: - uses: actions/checkout@v4 diff --git a/ci/start-broker.sh b/ci/start-broker.sh index 9e88f12a04..e41d0db43a 100755 --- a/ci/start-broker.sh +++ b/ci/start-broker.sh @@ -2,7 +2,7 @@ LOCAL_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:3.12} +RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:3.13} wait_for_message() { while ! docker logs "$1" | grep -q "$2"; From 70bb355cf4c49df598ff74b485953d6c3c632921 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 26 Feb 2024 10:21:59 +0100 Subject: [PATCH 046/449] Fix workflow titles --- .github/workflows/test-pr.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 4d491b4e33..4c6ae773f5 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -1,4 +1,4 @@ -name: Test against RabbitMQ 3.12 stable (PR) +name: Test against RabbitMQ 3.13 stable (PR) on: pull_request: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 173bac2b49..40cd261878 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test against RabbitMQ 3.12 stable +name: Test against RabbitMQ 3.13 stable on: push: From 65676b5290acae71985aef7f6d61633146c4b6dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:53:48 +0000 Subject: [PATCH 047/449] Bump org.mockito:mockito-core from 5.10.0 to 5.11.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.10.0 to 5.11.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.10.0...v5.11.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 58777f0957..48726f32d4 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.1.10.5 5.10.2 3.25.3 - 5.10.0 + 5.11.0 5.20.0 3.14.0 1.16.1 From 7b017ac5e80baa0a9fe9be50360db9ea10ee61c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 4 Mar 2024 11:01:26 +0100 Subject: [PATCH 048/449] Fix interop test (temporary fix) --- .../rabbitmq/stream/impl/AmqpInteroperabilityTest.java | 6 ++++-- src/test/java/com/rabbitmq/stream/impl/TestUtils.java | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java index f20019054a..c0bebf1df3 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java @@ -302,6 +302,7 @@ void publishToStreamConsumeFromStreamQueue(Codec codec, TestInfo info) { int messageCount = 1_000; ConnectionFactory connectionFactory = new ConnectionFactory(); Date timestamp = new Date(); + String subject = "the subject"; UUID messageIdUuid = UUID.randomUUID(); UUID correlationIdUuid = UUID.randomUUID(); @@ -496,7 +497,7 @@ void publishToStreamConsumeFromStreamQueue(Codec codec, TestInfo info) { assertThat(d.getProperties().getUserId()) .isEqualTo("the user ID")), mo(mb -> mb.properties().to("the to address"), d -> {}), - mo(mb -> mb.properties().subject("the subject"), d -> {}), + mo(mb -> mb.properties().subject(subject), d -> {}), mo( mb -> mb.properties().replyTo("the reply to address"), d -> @@ -631,7 +632,8 @@ void publishToStreamConsumeFromStreamQueue(Codec codec, TestInfo info) { Delivery message = messages.iterator().next(); assertThat(message.getEnvelope().getExchange()).isEmpty(); - assertThat(message.getEnvelope().getRoutingKey()).isEqualTo(s); + String expectedRoutingKey = afterNativeAmqp(brokerVersion) ? subject : s; + assertThat(message.getEnvelope().getRoutingKey()).isEqualTo(expectedRoutingKey); assertThat(message.getProperties().getHeaders()).containsKey("x-stream-offset"); testMessageOperation.deliveryConsumer.accept(message); diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index 205222f5ff..28cef26e27 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -465,6 +465,11 @@ static boolean afterMessageContainers(String currentVersion) { return Utils.versionCompare(currentVersion(currentVersion), "3.13.0") >= 0; } + static boolean afterNativeAmqp(String currentVersion) { + return Utils.versionCompare(currentVersion(currentVersion), BrokerVersion.RABBITMQ_4_0_0.value) + >= 0; + } + static boolean atLeastVersion(String expectedVersion, String currentVersion) { if (currentVersion.contains("alpha-stream")) { return true; @@ -1034,7 +1039,8 @@ public enum BrokerVersion { RABBITMQ_3_11_9("3.11.9"), RABBITMQ_3_11_11("3.11.11"), RABBITMQ_3_11_14("3.11.14"), - RABBITMQ_3_13_0("3.13.0"); + RABBITMQ_3_13_0("3.13.0"), + RABBITMQ_4_0_0("4.0.0"); final String value; From 6de214bb9e4f2134ca3aa2c0d5f24e5caaf2c71c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 4 Mar 2024 17:19:16 +0100 Subject: [PATCH 049/449] Revert "Fix interop test (temporary fix)" This reverts commit 7b017ac5e80baa0a9fe9be50360db9ea10ee61c0. --- .../rabbitmq/stream/impl/AmqpInteroperabilityTest.java | 6 ++---- src/test/java/com/rabbitmq/stream/impl/TestUtils.java | 8 +------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java index c0bebf1df3..f20019054a 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java @@ -302,7 +302,6 @@ void publishToStreamConsumeFromStreamQueue(Codec codec, TestInfo info) { int messageCount = 1_000; ConnectionFactory connectionFactory = new ConnectionFactory(); Date timestamp = new Date(); - String subject = "the subject"; UUID messageIdUuid = UUID.randomUUID(); UUID correlationIdUuid = UUID.randomUUID(); @@ -497,7 +496,7 @@ void publishToStreamConsumeFromStreamQueue(Codec codec, TestInfo info) { assertThat(d.getProperties().getUserId()) .isEqualTo("the user ID")), mo(mb -> mb.properties().to("the to address"), d -> {}), - mo(mb -> mb.properties().subject(subject), d -> {}), + mo(mb -> mb.properties().subject("the subject"), d -> {}), mo( mb -> mb.properties().replyTo("the reply to address"), d -> @@ -632,8 +631,7 @@ void publishToStreamConsumeFromStreamQueue(Codec codec, TestInfo info) { Delivery message = messages.iterator().next(); assertThat(message.getEnvelope().getExchange()).isEmpty(); - String expectedRoutingKey = afterNativeAmqp(brokerVersion) ? subject : s; - assertThat(message.getEnvelope().getRoutingKey()).isEqualTo(expectedRoutingKey); + assertThat(message.getEnvelope().getRoutingKey()).isEqualTo(s); assertThat(message.getProperties().getHeaders()).containsKey("x-stream-offset"); testMessageOperation.deliveryConsumer.accept(message); diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index 28cef26e27..205222f5ff 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -465,11 +465,6 @@ static boolean afterMessageContainers(String currentVersion) { return Utils.versionCompare(currentVersion(currentVersion), "3.13.0") >= 0; } - static boolean afterNativeAmqp(String currentVersion) { - return Utils.versionCompare(currentVersion(currentVersion), BrokerVersion.RABBITMQ_4_0_0.value) - >= 0; - } - static boolean atLeastVersion(String expectedVersion, String currentVersion) { if (currentVersion.contains("alpha-stream")) { return true; @@ -1039,8 +1034,7 @@ public enum BrokerVersion { RABBITMQ_3_11_9("3.11.9"), RABBITMQ_3_11_11("3.11.11"), RABBITMQ_3_11_14("3.11.14"), - RABBITMQ_3_13_0("3.13.0"), - RABBITMQ_4_0_0("4.0.0"); + RABBITMQ_3_13_0("3.13.0"); final String value; From c7e1cb2e59c960fdf761650b3b74916857a8ed79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 5 Mar 2024 11:18:03 +0100 Subject: [PATCH 050/449] Use Java 21 to generate documentation In release workflow. --- .github/workflows/release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 856252bcbd..d9f97d7430 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,6 +42,12 @@ jobs: MAVEN_USERNAME: '' MAVEN_PASSWORD: ${{ secrets.PACKAGECLOUD_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + - name: Set up JDK to generate documentation + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '21' + cache: 'maven' - name: Publish Documentation run: | git config user.name "rabbitmq-ci" From 69217d379e8cf207ae5cd04c7b8a74e93b95b969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 6 Mar 2024 09:38:41 +0100 Subject: [PATCH 051/449] Bump Google Java format to 1.21.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 48726f32d4..886bcdf14d 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ 1.4 1.37 2.43.0 - 1.19.2 + 1.21.0 0.8.11 3.12 From f3c154ee78f59374f755fb7ce8221e47d0ea304c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:45:37 +0000 Subject: [PATCH 052/449] Bump org.apache.commons:commons-compress from 1.26.0 to 1.26.1 Bumps org.apache.commons:commons-compress from 1.26.0 to 1.26.1. --- updated-dependencies: - dependency-name: org.apache.commons:commons-compress dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 886bcdf14d..3cb7daef5f 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.12.3 12.2.2 4.7.5 - 1.26.0 + 1.26.1 1.5.5-11 1.8.0 1.1.10.5 From 515efd1c2155a173b8a018498c9f3d8df3e42582 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:45:43 +0000 Subject: [PATCH 053/449] Bump org.asciidoctor:asciidoctorj from 2.5.11 to 2.5.12 Bumps [org.asciidoctor:asciidoctorj](https://github.com/asciidoctor/asciidoctorj) from 2.5.11 to 2.5.12. - [Release notes](https://github.com/asciidoctor/asciidoctorj/releases) - [Changelog](https://github.com/asciidoctor/asciidoctorj/blob/v2.5.12/CHANGELOG.adoc) - [Commits](https://github.com/asciidoctor/asciidoctorj/compare/v2.5.11...v2.5.12) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 886bcdf14d..3d0d85bf41 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.3.0 3.4.0 3.0.0 - 2.5.11 + 2.5.12 2.3.0 1.4 1.37 From a13b9cb300c092da809f15959ab56909da1ae7ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:45:50 +0000 Subject: [PATCH 054/449] Bump io.micrometer:micrometer-core from 1.12.3 to 1.12.4 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.12.3 to 1.12.4. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.12.3...v1.12.4) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 886bcdf14d..9bbae5b27f 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.107.Final 0.34.1 4.2.25 - 1.12.3 + 1.12.4 12.2.2 4.7.5 1.26.0 From 52b8001e55f526ff750105d03c5a459dba60cbfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 16:45:54 +0000 Subject: [PATCH 055/449] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.1.0 to 3.2.0 Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.1.0 to 3.2.0. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.1.0...maven-gpg-plugin-3.2.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 886bcdf14d..213e688ec4 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 3.12.1 3.2.5 1.11 - 3.1.0 + 3.2.0 3.2.0 3.3.1 3.3.0 From b07ab5a6028a97d28c114264e158f5fc696a4ad9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 16:34:05 +0000 Subject: [PATCH 056/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.2.3...v1.2.4) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8c93f8807a..ec80896898 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.10.1 0.10.4 1.2.5 - 1.2.3 + 1.2.4 1.0.2 3.12.1 3.2.5 From 436f28c07804f9c09b6b01c3c8e757f44da9bbc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 13 Mar 2024 17:34:32 +0100 Subject: [PATCH 057/449] Add dependency to Google Java format In test scope. To get updates from dependabot. --- pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pom.xml b/pom.xml index ec80896898..0e361a9c23 100644 --- a/pom.xml +++ b/pom.xml @@ -294,6 +294,14 @@ ${logback.version} test + + + com.google.googlejavaformat + google-java-format + ${google-java-format.version} + test + + From 0239fdfe09739e4b0a56a28e3a641732998ba5ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 18 Mar 2024 09:33:05 +0100 Subject: [PATCH 058/449] Fix typo in documentation --- src/docs/asciidoc/setup.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/asciidoc/setup.adoc b/src/docs/asciidoc/setup.adoc index b19f970c9d..e9eaaa6df8 100644 --- a/src/docs/asciidoc/setup.adoc +++ b/src/docs/asciidoc/setup.adoc @@ -129,7 +129,7 @@ Snapshots require to declare the <>. === Snapshots Releases are available from Maven Central, which does not require specific declaration. -Snapshots are available from a repositoriy which must be declared in the dependency management configuration. +Snapshots are available from a repository which must be declared in the dependency management configuration. With Maven: From 5c795826a55b94e71c092872f00c8a6110042bec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:18:38 +0000 Subject: [PATCH 059/449] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.0 to 3.2.1 Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.0 to 3.2.1. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.0...maven-gpg-plugin-3.2.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0e361a9c23..e37b9ae2dd 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 3.12.1 3.2.5 1.11 - 3.2.0 + 3.2.1 3.2.0 3.3.1 3.3.0 From e463db9767d4f7736f901a5ade687c6984a15764 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:24:39 +0000 Subject: [PATCH 060/449] Bump org.apache.maven.plugins:maven-compiler-plugin Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.12.1 to 3.13.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.12.1...maven-compiler-plugin-3.13.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0e361a9c23..9a62c0a2e3 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 1.2.5 1.2.4 1.0.2 - 3.12.1 + 3.13.0 3.2.5 1.11 3.2.0 From 7d9d282a698a7fd5aaeef66250560ae37dba3407 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Mar 2024 16:38:42 +0000 Subject: [PATCH 061/449] Bump netty.version from 4.1.107.Final to 4.1.108.Final Bumps `netty.version` from 4.1.107.Final to 4.1.108.Final. Updates `io.netty:netty-transport` from 4.1.107.Final to 4.1.108.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.107.Final...netty-4.1.108.Final) Updates `io.netty:netty-codec` from 4.1.107.Final to 4.1.108.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.107.Final...netty-4.1.108.Final) Updates `io.netty:netty-handler` from 4.1.107.Final to 4.1.108.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.107.Final...netty-4.1.108.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.107.Final to 4.1.108.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.107.Final...netty-4.1.108.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9a62c0a2e3..ca917ed04c 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.107.Final + 4.1.108.Final 0.34.1 4.2.25 1.12.4 From 01027438c4940c38a9f19fb03e77c7626267470d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 22 Mar 2024 09:23:28 +0100 Subject: [PATCH 062/449] Test against Java 22 --- .github/workflows/test-supported-java-versions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index f7e1d3aa31..f8eb833294 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: distribution: [ 'temurin' ] - version: [ '8', '11', '17', '21', '22-ea' ] + version: [ '8', '11', '17', '21', '22' ] include: - distribution: 'semeru' version: '17' From 733e4826a5739dc33db903546df4e79611d705a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 22 Mar 2024 09:32:52 +0100 Subject: [PATCH 063/449] Update link to support timeline page --- README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index 8c2ce1632f..fe0d18becc 100644 --- a/README.adoc +++ b/README.adoc @@ -24,7 +24,7 @@ Features and API are subject to change, but https://rabbitmq.github.io/rabbitmq- * For questions: https://groups.google.com/forum/#!forum/rabbitmq-users[RabbitMQ Users] * For bugs and feature requests: https://github.com/rabbitmq/rabbitmq-stream-java-client/issues[GitHub Issues] -See the https://www.rabbitmq.com/java-versions.html[RabbitMQ Java libraries support page] for the support timeline of this library. +See the https://www.rabbitmq.com/client-libraries/java-versions[RabbitMQ Java libraries support page] for the support timeline of this library. == How to Use From a615c16d62cecd0ede5a5385ddbb493c47f480cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 17:00:46 +0000 Subject: [PATCH 064/449] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.1 to 3.2.2 Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.1 to 3.2.2. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.1...maven-gpg-plugin-3.2.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b217a91282..5101280aac 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 3.13.0 3.2.5 1.11 - 3.2.1 + 3.2.2 3.2.0 3.3.1 3.3.0 From f4ee916733ce9829fdb6b1074428eb508b688446 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 28 Mar 2024 16:04:41 +0000 Subject: [PATCH 065/449] Bump com.github.luben:zstd-jni from 1.5.5-11 to 1.5.6-1 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.5-11 to 1.5.6-1. - [Commits](https://github.com/luben/zstd-jni/compare/v1.5.5-11...v1.5.6-1) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5101280aac..e6aa645e9e 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 12.2.2 4.7.5 1.26.1 - 1.5.5-11 + 1.5.6-1 1.8.0 1.1.10.5 5.10.2 From d5b1edcb3838f69a125005510742c908db69173a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 16:17:00 +0000 Subject: [PATCH 066/449] Bump com.google.googlejavaformat:google-java-format Bumps [com.google.googlejavaformat:google-java-format](https://github.com/google/google-java-format) from 1.21.0 to 1.22.0. - [Release notes](https://github.com/google/google-java-format/releases) - [Commits](https://github.com/google/google-java-format/compare/v1.21.0...v1.22.0) --- updated-dependencies: - dependency-name: com.google.googlejavaformat:google-java-format dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e6aa645e9e..bb1cd0a1b4 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ 1.4 1.37 2.43.0 - 1.21.0 + 1.22.0 0.8.11 3.12 From 6842dace61a930e2958686ca1c58bf82fe783473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 3 Apr 2024 09:18:53 +0200 Subject: [PATCH 067/449] Test against Java 23 ea --- .github/workflows/test-supported-java-versions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index f8eb833294..a9649e2b29 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: distribution: [ 'temurin' ] - version: [ '8', '11', '17', '21', '22' ] + version: [ '8', '11', '17', '21', '22', '23-ea' ] include: - distribution: 'semeru' version: '17' From 647ffb95d56bb86c3824d85005b896ff75c1e4c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 16:33:25 +0000 Subject: [PATCH 068/449] Bump org.jacoco:jacoco-maven-plugin from 0.8.11 to 0.8.12 Bumps [org.jacoco:jacoco-maven-plugin](https://github.com/jacoco/jacoco) from 0.8.11 to 0.8.12. - [Release notes](https://github.com/jacoco/jacoco/releases) - [Commits](https://github.com/jacoco/jacoco/compare/v0.8.11...v0.8.12) --- updated-dependencies: - dependency-name: org.jacoco:jacoco-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bb1cd0a1b4..46ac9895dc 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 1.37 2.43.0 1.22.0 - 0.8.11 + 0.8.12 3.12 From 60875b6c655e7d899b9882a54a0577a2877b096b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:35:28 +0000 Subject: [PATCH 069/449] Bump com.github.luben:zstd-jni from 1.5.6-1 to 1.5.6-2 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.6-1 to 1.5.6-2. - [Commits](https://github.com/luben/zstd-jni/compare/v1.5.6-1...v1.5.6-2) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 46ac9895dc..911961c690 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 12.2.2 4.7.5 1.26.1 - 1.5.6-1 + 1.5.6-2 1.8.0 1.1.10.5 5.10.2 From 5bbc3960614aebb7f180adf1e12ebc63d5134256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 5 Apr 2024 10:40:59 +0200 Subject: [PATCH 070/449] Update tag name for broker alphas No more OTP variant. --- .github/workflows/test-rabbitmq-alphas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index 244ce1d25e..813603d97e 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v3.13.x-otp-max-bazel', 'pivotalrabbitmq/rabbitmq:main-otp-max-bazel' ] + rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v3.13.x', 'pivotalrabbitmq/rabbitmq:main' ] name: Test against ${{ matrix.rabbitmq-image }} steps: - uses: actions/checkout@v4 From 2850508edb3b4f6286b9806f9401b4f3c846d48a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:10:21 +0000 Subject: [PATCH 071/449] Bump org.apache.maven.plugins:maven-source-plugin from 3.3.0 to 3.3.1 Bumps [org.apache.maven.plugins:maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.3.0 to 3.3.1. - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.3.0...maven-source-plugin-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-source-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 911961c690..6cf2bf54df 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,7 @@ 3.2.2 3.2.0 3.3.1 - 3.3.0 + 3.3.1 3.6.3 3.3.0 3.4.0 From 79acb254c0d9c63aed8412bb6af453875e4c85cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 16:04:26 +0000 Subject: [PATCH 072/449] Bump com.rabbitmq:amqp-client from 5.20.0 to 5.21.0 Bumps [com.rabbitmq:amqp-client](https://github.com/rabbitmq/rabbitmq-java-client) from 5.20.0 to 5.21.0. - [Release notes](https://github.com/rabbitmq/rabbitmq-java-client/releases) - [Commits](https://github.com/rabbitmq/rabbitmq-java-client/compare/v5.20.0...v5.21.0) --- updated-dependencies: - dependency-name: com.rabbitmq:amqp-client dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6cf2bf54df..3db5342520 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 5.10.2 3.25.3 5.11.0 - 5.20.0 + 5.21.0 3.14.0 1.16.1 2.10.1 From 1c54e97808b4578e4467a1debc0cab1a15979f9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 16:04:35 +0000 Subject: [PATCH 073/449] Bump io.micrometer:micrometer-core from 1.12.4 to 1.12.5 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.12.4 to 1.12.5. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.12.4...v1.12.5) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6cf2bf54df..d58ec72de1 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.108.Final 0.34.1 4.2.25 - 1.12.4 + 1.12.5 12.2.2 4.7.5 1.26.1 From 8b2279f6622484c336984d53e2cdffba503d8149 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 16:04:39 +0000 Subject: [PATCH 074/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.2.4 to 1.2.5. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.2.4...v1.2.5) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6cf2bf54df..8cbd2372bc 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.10.1 0.10.4 1.2.5 - 1.2.4 + 1.2.5 1.0.2 3.13.0 3.2.5 From 61c929636c519121243de59f6f0a305839ca6dae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 10 Apr 2024 18:40:10 +0200 Subject: [PATCH 075/449] Mention publishers cannot share the same name with dedup --- src/docs/asciidoc/api.adoc | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/docs/asciidoc/api.adoc b/src/docs/asciidoc/api.adoc index 70c14b3821..fbca3ae4d9 100644 --- a/src/docs/asciidoc/api.adoc +++ b/src/docs/asciidoc/api.adoc @@ -575,6 +575,23 @@ message will be persisted twice. Luckily RabbitMQ Stream can detect and filter out duplicated messages, based on 2 client-side elements: the _producer name_ and the _message publishing ID_. +[[deduplication-multithreading]] +[WARNING] +.Only one publisher instance with a given name and no multithreading to guarantee deduplication +==== +We'll see below that deduplication works using a strictly increasing sequence for messages. +This means messages must be published in order, so there must be only _one publisher instance with a given name_ and this instance must publish messages _within a single thread_. + +With several publisher instances with the same name, one instance can be "ahead" of the others for the sequence ID: if it publishes a message with sequence ID 100, any message from any instance with a smaller lower sequence ID will be filtered out. + +If there is only one publisher instance with a given name, it should publish messages in a single thread. +Even if messages are _created_ in order, with the proper sequence ID, they can get out of order if they are published in several threads, e.g. message 5 can be _published_ before message 2. +The deduplication mechanism will then filter out message 2 in this case. + +You have to be very careful about the way your applications publish messages when deduplication is in use: make sure publisher instances do not share the same name and use only a single thread. +If you worry about performance, note it is possible to publish hundreds of thousands of messages in a single thread with RabbitMQ Stream. +==== + [WARNING] .Deduplication is not guaranteed when using sub-entries batching ==== @@ -585,19 +602,6 @@ batching messages in a single publish frame, which can already provide very high throughput. ==== -[[deduplication-multithreading]] -[WARNING] -.Deduplication is not guaranteed when publishing on several threads -==== -We'll see below that deduplication works using a strictly increasing sequence for messages. -This means messages must be published in order and the preferred way to do this is usually _within a single thread_. -Even if messages are _created_ in order, with the proper sequence ID, if they are published in several threads, they can get out of order, e.g. message 5 can be _published_ before message 2. -The deduplication mechanism will then filter out message 2 in this case. - -So you have to be very careful about the way your applications publish messages when deduplication is in use. -If you worry about performance, note it is possible to publish hundreds of thousands of messages in a single thread with RabbitMQ Stream. -==== - ===== Setting the Name of a Producer The producer name is set when creating the producer instance, which automatically From fbabde28ae30d19469382836114118a137ae4691 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 16:37:31 +0000 Subject: [PATCH 076/449] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.2 to 3.2.3 Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.2 to 3.2.3. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.2...maven-gpg-plugin-3.2.3) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a21827e2c7..abc600ad3d 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 3.13.0 3.2.5 1.11 - 3.2.2 + 3.2.3 3.2.0 3.3.1 3.3.1 From 2b1551075b33f576788e24e4db3b27b4b7547b44 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:55:24 +0000 Subject: [PATCH 077/449] Bump netty.version from 4.1.108.Final to 4.1.109.Final Bumps `netty.version` from 4.1.108.Final to 4.1.109.Final. Updates `io.netty:netty-transport` from 4.1.108.Final to 4.1.109.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.108.Final...netty-4.1.109.Final) Updates `io.netty:netty-codec` from 4.1.108.Final to 4.1.109.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.108.Final...netty-4.1.109.Final) Updates `io.netty:netty-handler` from 4.1.108.Final to 4.1.109.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.108.Final...netty-4.1.109.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.108.Final to 4.1.109.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.108.Final...netty-4.1.109.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index abc600ad3d..a534edd2df 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.108.Final + 4.1.109.Final 0.34.1 4.2.25 1.12.5 From e50de5bfdc188f1c7bf5b3df2d088c47adfbf615 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 16:55:36 +0000 Subject: [PATCH 078/449] Bump org.apache.maven.plugins:maven-jar-plugin from 3.3.0 to 3.4.0 Bumps [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.3.0 to 3.4.0. - [Release notes](https://github.com/apache/maven-jar-plugin/releases) - [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.3.0...maven-jar-plugin-3.4.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-jar-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index abc600ad3d..eb44a168e3 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 3.3.1 3.3.1 3.6.3 - 3.3.0 + 3.4.0 3.4.0 3.0.0 2.5.12 From cb337a065da39e6c83fc67e0e0a7588b61d67ec4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:34:46 +0000 Subject: [PATCH 079/449] Bump org.codehaus.mojo:buildnumber-maven-plugin from 1.4 to 3.2.0 Bumps [org.codehaus.mojo:buildnumber-maven-plugin](https://github.com/mojohaus/buildnumber-maven-plugin) from 1.4 to 3.2.0. - [Release notes](https://github.com/mojohaus/buildnumber-maven-plugin/releases) - [Commits](https://github.com/mojohaus/buildnumber-maven-plugin/compare/buildnumber-maven-plugin-1.4...3.2.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:buildnumber-maven-plugin 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 3c437e760a..43e9016b0a 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.0.0 2.5.12 2.3.0 - 1.4 + 3.2.0 1.37 2.43.0 1.22.0 From 02792ee6da7075259ff0aa2779eee0924accff1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 16:20:24 +0000 Subject: [PATCH 080/449] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.3 to 3.2.4 Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.3 to 3.2.4. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.3...maven-gpg-plugin-3.2.4) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 43e9016b0a..a3f7a2d616 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 3.13.0 3.2.5 1.11 - 3.2.3 + 3.2.4 3.2.0 3.3.1 3.3.1 From a9a986a39e8711f383060e32267884b0e4e12c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 22 Apr 2024 17:11:46 +0200 Subject: [PATCH 081/449] Add sanity check flow --- .github/workflows/sanity-check.yml | 44 ++++++++++++++++++++++++++++++ src/test/java/SanityCheck.java | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/sanity-check.yml diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml new file mode 100644 index 0000000000..7805894ad0 --- /dev/null +++ b/.github/workflows/sanity-check.yml @@ -0,0 +1,44 @@ +name: Library Sanity Check + +on: + workflow_dispatch: + inputs: + library_version: + description: 'Library version (e.g. 5.21.0)' + required: true + type: string + default: '5.21.0' + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + - name: Checkout tls-gen + uses: actions/checkout@v4 + with: + repository: rabbitmq/tls-gen + path: './tls-gen' + - name: Set up JDK + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: '21' + cache: 'maven' + - uses: actions/cache@v4 + with: + path: /root/.jbang + key: $-jbang-$ + restore-keys: | + $-jbang- + - name: Start broker + run: ci/start-broker.sh + - name: Sanity Check + uses: jbangdev/jbang-action@v0.116.0 + with: + script: src/test/java/SanityCheck.java + env: + RABBITMQ_LIBRARY_VERSION: ${{ inputs.library_version }} + - name: Stop broker + run: docker stop rabbitmq && docker rm rabbitmq \ No newline at end of file diff --git a/src/test/java/SanityCheck.java b/src/test/java/SanityCheck.java index 61065fc0b5..4e550c8bd2 100755 --- a/src/test/java/SanityCheck.java +++ b/src/test/java/SanityCheck.java @@ -1,6 +1,6 @@ ///usr/bin/env jbang "$0" "$@" ; exit $? //REPOS mavencentral,ossrh-staging=https://oss.sonatype.org/content/groups/staging/,rabbitmq-packagecloud-milestones=https://packagecloud.io/rabbitmq/maven-milestones/maven2 -//DEPS com.rabbitmq:stream-client:${version} +//DEPS com.rabbitmq:stream-client:${env.RABBITMQ_LIBRARY_VERSION} //DEPS org.slf4j:slf4j-simple:1.7.36 import com.rabbitmq.stream.Environment; From 6b8e31f0fe2ae5c13ddb95eaa801cf46a964860f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 22 Apr 2024 17:14:02 +0200 Subject: [PATCH 082/449] Fix action version --- .github/workflows/sanity-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 7805894ad0..c6f3ecaabc 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -35,7 +35,7 @@ jobs: - name: Start broker run: ci/start-broker.sh - name: Sanity Check - uses: jbangdev/jbang-action@v0.116.0 + uses: jbangdev/jbang-action@v0.115.0 with: script: src/test/java/SanityCheck.java env: From 0ebe8ccbf967668cb1e159738e7175b59329219a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 22 Apr 2024 17:25:16 +0200 Subject: [PATCH 083/449] Execute JBang without installation --- .github/workflows/sanity-check.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index c6f3ecaabc..8b7a82c205 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -4,10 +4,10 @@ on: workflow_dispatch: inputs: library_version: - description: 'Library version (e.g. 5.21.0)' + description: 'Library version (e.g. 0.15.0)' required: true type: string - default: '5.21.0' + default: '0.15.0' jobs: build: @@ -26,18 +26,11 @@ jobs: distribution: 'zulu' java-version: '21' cache: 'maven' - - uses: actions/cache@v4 - with: - path: /root/.jbang - key: $-jbang-$ - restore-keys: | - $-jbang- - name: Start broker run: ci/start-broker.sh - name: Sanity Check - uses: jbangdev/jbang-action@v0.115.0 - with: - script: src/test/java/SanityCheck.java + run: | + curl -Ls https://sh.jbang.dev | bash -s - src/test/java/SanityCheck.java env: RABBITMQ_LIBRARY_VERSION: ${{ inputs.library_version }} - name: Stop broker From fd61e41ddec9c34e0f1514619b39ee4788345e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 22 Apr 2024 17:36:40 +0200 Subject: [PATCH 084/449] Add sanity check to release script --- .github/workflows/release.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d9f97d7430..7193da0937 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,12 +42,27 @@ jobs: MAVEN_USERNAME: '' MAVEN_PASSWORD: ${{ secrets.PACKAGECLOUD_TOKEN }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - - name: Set up JDK to generate documentation + - name: Checkout tls-gen + uses: actions/checkout@v4 + with: + repository: rabbitmq/tls-gen + path: './tls-gen' + - name: Start broker + run: ci/start-broker.sh + - name: Set up JDK for sanity check and documentation generation uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '21' cache: 'maven' + - name: Sanity Check + run: | + source ./release-versions.txt + curl -Ls https://sh.jbang.dev | bash -s - src/test/java/SanityCheck.java + env: + RABBITMQ_LIBRARY_VERSION: ${{ inputs.library_version }} + - name: Stop broker + run: docker stop rabbitmq && docker rm rabbitmq - name: Publish Documentation run: | git config user.name "rabbitmq-ci" From ff227e8fbe011642ebf696c0864f66d471530a16 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 22 Apr 2024 15:42:39 +0000 Subject: [PATCH 085/449] [maven-release-plugin] prepare release v0.16.0.RC1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a3f7a2d616..06fba8da89 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.16.0-SNAPSHOT + 0.16.0.RC1 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.16.0.RC1 From 54b85e192e2a52cd0d87b378ff9e3f8f4bc7bc52 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 22 Apr 2024 15:42:40 +0000 Subject: [PATCH 086/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 06fba8da89..a3f7a2d616 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.16.0.RC1 + 0.16.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.16.0.RC1 + HEAD From 4e4f34e5bb61d73217d8ca8cfe092a6797b4c6d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 22 Apr 2024 18:04:00 +0200 Subject: [PATCH 087/449] Fix sanity check invocation --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7193da0937..bdb5643a22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,9 +58,8 @@ jobs: - name: Sanity Check run: | source ./release-versions.txt + export RABBITMQ_LIBRARY_VERSION=$RELEASE_VERSION curl -Ls https://sh.jbang.dev | bash -s - src/test/java/SanityCheck.java - env: - RABBITMQ_LIBRARY_VERSION: ${{ inputs.library_version }} - name: Stop broker run: docker stop rabbitmq && docker rm rabbitmq - name: Publish Documentation From 332ea10d2d721b36867d232b51f1c0010ba8ade7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 16:05:23 +0000 Subject: [PATCH 088/449] Bump org.apache.maven.plugins:maven-jar-plugin from 3.4.0 to 3.4.1 Bumps [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.4.0 to 3.4.1. - [Release notes](https://github.com/apache/maven-jar-plugin/releases) - [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.4.0...maven-jar-plugin-3.4.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-jar-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a3f7a2d616..4908c72663 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 3.3.1 3.3.1 3.6.3 - 3.4.0 + 3.4.1 3.4.0 3.0.0 2.5.12 From 0d2f52d7a29ec6f53ad4ab628a5f2f44c4ea04ec Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 22 Apr 2024 16:15:09 +0000 Subject: [PATCH 089/449] [maven-release-plugin] prepare release v0.16.0.RC1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a3f7a2d616..06fba8da89 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.16.0-SNAPSHOT + 0.16.0.RC1 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.16.0.RC1 From cc483393784118cb7cfab0c544d555b816092f46 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 22 Apr 2024 16:15:11 +0000 Subject: [PATCH 090/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 06fba8da89..a3f7a2d616 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.16.0.RC1 + 0.16.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.16.0.RC1 + HEAD From 3cf8b4115cd022392c5dbfea4abf3a99bf3a1124 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:13:42 +0000 Subject: [PATCH 091/449] Bump com.github.luben:zstd-jni from 1.5.6-2 to 1.5.6-3 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.6-2 to 1.5.6-3. - [Commits](https://github.com/luben/zstd-jni/compare/v1.5.6-2...v1.5.6-3) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4908c72663..7e2efa8ffc 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 12.2.2 4.7.5 1.26.1 - 1.5.6-2 + 1.5.6-3 1.8.0 1.1.10.5 5.10.2 From ec1c2ea6ef99137e68640ecf249703c1806b3c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 26 Apr 2024 14:42:38 +0200 Subject: [PATCH 092/449] Expose stream name in SubscriptionListener.SubscriptionContext Fixes #540 --- .../com/rabbitmq/stream/SubscriptionListener.java | 7 +++++++ .../rabbitmq/stream/impl/ConsumersCoordinator.java | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/SubscriptionListener.java b/src/main/java/com/rabbitmq/stream/SubscriptionListener.java index 4f5e5d96db..30d2f1ab15 100644 --- a/src/main/java/com/rabbitmq/stream/SubscriptionListener.java +++ b/src/main/java/com/rabbitmq/stream/SubscriptionListener.java @@ -64,5 +64,12 @@ interface SubscriptionContext { * @param offsetSpecification the offset specification to use */ void offsetSpecification(OffsetSpecification offsetSpecification); + + /** + * The stream involved. + * + * @return the stream + */ + String stream(); } } diff --git a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java index c88d571fa6..43cf96afc2 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java @@ -1021,7 +1021,7 @@ synchronized void add( // TODO consider using/emulating ConsumerUpdateListener, to have only one API, not 2 // even when the consumer is not a SAC. SubscriptionContext subscriptionContext = - new DefaultSubscriptionContext(offsetSpecification); + new DefaultSubscriptionContext(offsetSpecification, subscriptionTracker.stream); subscriptionTracker.subscriptionListener.preSubscribe(subscriptionContext); LOGGER.info( "Computed offset specification {}, offset specification used after subscription listener {}", @@ -1217,9 +1217,12 @@ public int hashCode() { private static final class DefaultSubscriptionContext implements SubscriptionContext { private volatile OffsetSpecification offsetSpecification; + private final String name; - private DefaultSubscriptionContext(OffsetSpecification computedOffsetSpecification) { + private DefaultSubscriptionContext( + OffsetSpecification computedOffsetSpecification, String name) { this.offsetSpecification = computedOffsetSpecification; + this.name = name; } @Override @@ -1232,6 +1235,11 @@ public void offsetSpecification(OffsetSpecification offsetSpecification) { this.offsetSpecification = offsetSpecification; } + @Override + public String stream() { + return this.name; + } + @Override public String toString() { return "SubscriptionContext{" + "offsetSpecification=" + offsetSpecification + '}'; From d221d39e8c0571e5020478f5fd4413b27d1b5b5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:16:46 +0000 Subject: [PATCH 093/449] Bump commons-codec:commons-codec from 1.16.1 to 1.17.0 Bumps [commons-codec:commons-codec](https://github.com/apache/commons-codec) from 1.16.1 to 1.17.0. - [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.16.1...rel/commons-codec-1.17.0) --- updated-dependencies: - dependency-name: commons-codec:commons-codec dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7e2efa8ffc..e300267b30 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 5.11.0 5.21.0 3.14.0 - 1.16.1 + 1.17.0 2.10.1 0.10.4 1.2.5 From 77dec7a5e50bcedbb7bb76d81c40482f31e238ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 30 Apr 2024 10:45:13 +0200 Subject: [PATCH 094/449] Update link to documentation --- .../java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java index 8c2039da17..3fc919aaba 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java @@ -365,7 +365,7 @@ public TlsConfiguration trustEverything() { LOGGER.warn( "SECURITY ALERT: this feature trusts every server certificate, effectively disabling peer verification. " + "This is convenient for local development but offers no protection against man-in-the-middle attacks. " - + "Please see https://www.rabbitmq.com/ssl.html to learn more about peer certificate verification."); + + "Please see https://www.rabbitmq.com/docs/ssl to learn more about peer certificate verification."); try { this.sslContext( SslContextBuilder.forClient() From d85c2d444fbeb518d819d46e439befef4792559f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 13 May 2024 16:16:11 +0200 Subject: [PATCH 095/449] Send empty message body instead of null message body Null message body is forbidden in the AMQP 1.0 specification. We set a data section with an empty binary when the message body has not been set. Stream messages are not checked on the server side, but messages from other protocols will be checked for a non-null body in RabbitMQ 4.0, and letting null body stream messages through will crash when those messages are read with other protocols. References rabbitmq/rabbitmq-server#6835 Fixes #544 --- .../com/rabbitmq/stream/codec/QpidProtonCodec.java | 12 +++++++----- .../stream/codec/QpidProtonMessageBuilder.java | 5 +++++ .../java/com/rabbitmq/stream/codec/SimpleCodec.java | 5 ++++- .../java/com/rabbitmq/stream/codec/SwiftMqCodec.java | 6 +++++- .../rabbitmq/stream/codec/SwiftMqMessageBuilder.java | 3 +++ .../rabbitmq/stream/codec/WrapperMessageBuilder.java | 2 +- .../stream/impl/AmqpInteroperabilityTest.java | 2 -- 7 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java b/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java index 8c2bf3080a..7b97048ead 100644 --- a/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java @@ -25,15 +25,14 @@ import java.util.UUID; import java.util.function.Function; import org.apache.qpid.proton.amqp.*; -import org.apache.qpid.proton.amqp.messaging.AmqpValue; -import org.apache.qpid.proton.amqp.messaging.ApplicationProperties; -import org.apache.qpid.proton.amqp.messaging.Data; -import org.apache.qpid.proton.amqp.messaging.MessageAnnotations; +import org.apache.qpid.proton.amqp.messaging.*; import org.apache.qpid.proton.codec.ReadableBuffer; import org.apache.qpid.proton.codec.WritableBuffer; public class QpidProtonCodec implements Codec { + static final Section EMPTY_BODY = new Data(new Binary(new byte[0])); + private static final Function MESSAGE_ANNOTATIONS_STRING_KEY_EXTRACTOR = k -> k; private static final Function MESSAGE_ANNOTATIONS_SYMBOL_KEY_EXTRACTOR = Symbol::toString; @@ -233,13 +232,16 @@ public EncodedMessage encode(Message message) { qpidMessage.setMessageAnnotations(new MessageAnnotations(messageAnnotations)); } - if (message.getBodyAsBinary() != null) { + if (message.getBodyAsBinary() == null) { + qpidMessage.setBody(EMPTY_BODY); + } else { qpidMessage.setBody(new Data(new Binary(message.getBodyAsBinary()))); } } int bufferSize; if (qpidMessage.getBody() instanceof Data) { bufferSize = (int) (((Data) qpidMessage.getBody()).getValue().getLength() * 1.5); + bufferSize = bufferSize == 0 ? 128 : bufferSize; } else { bufferSize = 8192; } diff --git a/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java index 60c6f0bf83..523fbf8eb2 100644 --- a/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java @@ -14,6 +14,8 @@ // info@rabbitmq.com. package com.rabbitmq.stream.codec; +import static com.rabbitmq.stream.codec.QpidProtonCodec.EMPTY_BODY; + import com.rabbitmq.stream.Message; import com.rabbitmq.stream.MessageBuilder; import java.math.BigDecimal; @@ -57,6 +59,9 @@ public Message build() { message.setMessageAnnotations( new MessageAnnotations(messageAnnotationsBuilder.messageAnnotations)); } + if (message.getBody() == null) { + message.setBody(EMPTY_BODY); + } return new QpidProtonCodec.QpidProtonAmqpMessageWrapper( hasPublishingId, publishingId, message); } else { diff --git a/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java b/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java index 6138cd65a7..1f62c33577 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java @@ -23,9 +23,12 @@ public class SimpleCodec implements Codec { + static final byte[] EMPTY_BODY = new byte[0]; + @Override public EncodedMessage encode(Message message) { - return new EncodedMessage(message.getBodyAsBinary().length, message.getBodyAsBinary()); + byte[] body = message.getBodyAsBinary() == null ? EMPTY_BODY : message.getBodyAsBinary(); + return new EncodedMessage(body.length, body); } @Override diff --git a/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java b/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java index 1f947a943d..4277b3ebdc 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java @@ -32,6 +32,8 @@ public class SwiftMqCodec implements Codec { + static final Data EMPTY_BODY = new Data(new byte[0]); + private static Object convertAmqpMapValue(AMQPType value) { if (value instanceof AMQPBoolean) { return ((AMQPBoolean) value).getValue() ? Boolean.TRUE : Boolean.FALSE; @@ -260,7 +262,9 @@ public EncodedMessage encode(Message message) { } } - if (message.getBodyAsBinary() != null) { + if (message.getBodyAsBinary() == null) { + outboundMessage.addData(EMPTY_BODY); + } else { outboundMessage.addData(new Data(message.getBodyAsBinary())); } } diff --git a/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java index 5585b4db7c..75803b1c8c 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java @@ -66,6 +66,9 @@ public Message build() { throw new StreamException("Error while setting application properties", e); } } + if (outboundMessage.getData() == null) { + outboundMessage.addData(SwiftMqCodec.EMPTY_BODY); + } return new SwiftMqCodec.SwiftMqAmqpMessageWrapper( hasPublishingId, publishingId, outboundMessage); } else { diff --git a/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java index cb6f5013ff..78acb9d9d1 100644 --- a/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java @@ -42,7 +42,7 @@ public Message build() { return new SimpleMessage( this.hasPublishingId, this.publishingId, - body, + body == null ? SimpleCodec.EMPTY_BODY : body, this.messageAnnotationsBuilder == null ? null : this.messageAnnotationsBuilder.messageAnnotations, diff --git a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java index f20019054a..1ea1182725 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java @@ -31,8 +31,6 @@ import com.rabbitmq.stream.codec.SwiftMqCodec; import com.rabbitmq.stream.impl.Client.ClientParameters; import com.rabbitmq.stream.impl.Client.Response; -import com.rabbitmq.stream.impl.TestUtils.BrokerVersion; -import com.rabbitmq.stream.impl.TestUtils.BrokerVersionAtLeast; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.*; From c5fc22379bd8143afe8892f235b465bcbb1fd842 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 16:24:05 +0000 Subject: [PATCH 096/449] Bump io.micrometer:micrometer-core from 1.12.5 to 1.12.6 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.12.5 to 1.12.6. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.12.5...v1.12.6) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e300267b30..14490ebfc4 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.109.Final 0.34.1 4.2.25 - 1.12.5 + 1.12.6 12.2.2 4.7.5 1.26.1 From 1c4427cdca40314ab5dd3e6492a114f6796c34fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 16:24:10 +0000 Subject: [PATCH 097/449] Bump org.mockito:mockito-core from 5.11.0 to 5.12.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.11.0 to 5.12.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.11.0...v5.12.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e300267b30..d35c9bbbe5 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.1.10.5 5.10.2 3.25.3 - 5.11.0 + 5.12.0 5.21.0 3.14.0 1.17.0 From 0f3e3b4937e4a5125659e58304c27ae7f82f020e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 16:24:14 +0000 Subject: [PATCH 098/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.2.5...v1.2.6) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e300267b30..6a9209db3c 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.10.1 0.10.4 1.2.5 - 1.2.5 + 1.2.6 1.0.2 3.13.0 3.2.5 From 42669b83d999c941b7cfa3cc0e92c49cf6f58d6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 16:48:49 +0000 Subject: [PATCH 099/449] Bump io.micrometer:micrometer-core from 1.12.6 to 1.13.0 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.12.6 to 1.13.0. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.12.6...v1.13.0) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9756cafd9d..f02e37ed31 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.109.Final 0.34.1 4.2.25 - 1.12.6 + 1.13.0 12.2.2 4.7.5 1.26.1 From 12afe0f9438925b796f62bf19250e94ea0572756 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 16:48:58 +0000 Subject: [PATCH 100/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.2.6 to 1.3.0. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.2.6...v1.3.0) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9756cafd9d..71a9feb08b 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.10.1 0.10.4 1.2.5 - 1.2.6 + 1.3.0 1.0.2 3.13.0 3.2.5 From b8e634f3ec959645dde8becc3eb42b9ea05e20db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 16:04:04 +0000 Subject: [PATCH 101/449] Bump org.asciidoctor:asciidoctorj from 2.5.12 to 2.5.13 Bumps [org.asciidoctor:asciidoctorj](https://github.com/asciidoctor/asciidoctorj) from 2.5.12 to 2.5.13. - [Release notes](https://github.com/asciidoctor/asciidoctorj/releases) - [Changelog](https://github.com/asciidoctor/asciidoctorj/blob/v2.5.13/CHANGELOG.adoc) - [Commits](https://github.com/asciidoctor/asciidoctorj/compare/v2.5.12...v2.5.13) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e934e9e374..bfed176f50 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.4.1 3.4.0 3.0.0 - 2.5.12 + 2.5.13 2.3.0 3.2.0 1.37 From 33736ce7972781fab249341eb2f82b37271f0b5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 16:04:13 +0000 Subject: [PATCH 102/449] Bump com.google.code.gson:gson from 2.10.1 to 2.11.0 Bumps [com.google.code.gson:gson](https://github.com/google/gson) from 2.10.1 to 2.11.0. - [Release notes](https://github.com/google/gson/releases) - [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md) - [Commits](https://github.com/google/gson/compare/gson-parent-2.10.1...gson-parent-2.11.0) --- updated-dependencies: - dependency-name: com.google.code.gson:gson dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e934e9e374..12105e511a 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ 5.21.0 3.14.0 1.17.0 - 2.10.1 + 2.11.0 0.10.4 1.2.5 1.3.0 From e81b0a2210e4fdd2df1c8ca967597e3cb8312675 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 May 2024 16:46:50 +0000 Subject: [PATCH 103/449] --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6ea381eff1..70fd19fc06 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.109.Final + 4.1.110.Final 0.34.1 4.2.25 1.13.0 From 3f2a88b4ad9ce0423e5a57f66cdfa676ee927e10 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 May 2024 16:41:12 +0000 Subject: [PATCH 104/449] Bump org.apache.commons:commons-compress from 1.26.1 to 1.26.2 Bumps org.apache.commons:commons-compress from 1.26.1 to 1.26.2. --- updated-dependencies: - dependency-name: org.apache.commons:commons-compress dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 70fd19fc06..967faedf07 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.13.0 12.2.2 4.7.5 - 1.26.1 + 1.26.2 1.5.6-3 1.8.0 1.1.10.5 From e8d30a7d4669d527df4f8930314fec2bfe98f522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 27 May 2024 15:10:51 +0200 Subject: [PATCH 105/449] Set up Spotbugs and squash warnings --- pom.xml | 28 +++++++++++++++++++ .../rabbitmq/stream/BackOffDelayPolicy.java | 2 +- .../com/rabbitmq/stream/ByteCapacity.java | 2 +- src/main/java/com/rabbitmq/stream/Codec.java | 4 +++ .../rabbitmq/stream/codec/SwiftMqCodec.java | 2 +- .../java/com/rabbitmq/stream/impl/Client.java | 17 +++++++---- .../stream/impl/ConsumersCoordinator.java | 10 +++---- .../stream/impl/JdkChunkChecksum.java | 6 ++-- .../rabbitmq/stream/impl/MessageBatch.java | 26 ++--------------- .../impl/ParameterizedTypeReference.java | 4 ++- .../stream/impl/ProducersCoordinator.java | 10 +++---- .../rabbitmq/stream/impl/StreamConsumer.java | 5 +++- .../stream/impl/StreamEnvironment.java | 2 ++ .../rabbitmq/stream/impl/StreamProducer.java | 2 ++ .../stream/impl/SuperStreamProducer.java | 2 +- ...MicrometerObservationCollectorBuilder.java | 2 ++ .../stream/sasl/DefaultSaslConfiguration.java | 2 +- .../stream/sasl/JdkSaslConfiguration.java | 7 ++--- 18 files changed, 79 insertions(+), 54 deletions(-) diff --git a/pom.xml b/pom.xml index 967faedf07..cfda8b52e3 100644 --- a/pom.xml +++ b/pom.xml @@ -89,6 +89,8 @@ 2.43.0 1.22.0 0.8.12 + 4.8.5.0 + 4.8.5 3.12 @@ -302,6 +304,12 @@ test + + com.github.spotbugs + spotbugs-annotations + 4.8.5 + provided + @@ -566,6 +574,26 @@ + + com.github.spotbugs + spotbugs-maven-plugin + ${spotbugs-maven-plugin.version} + + + com.github.spotbugs + spotbugs + ${spotbugs.version} + + + + + + check + + + + + diff --git a/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java b/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java index ac9b730b5a..0d154a9c3a 100644 --- a/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java +++ b/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java @@ -98,7 +98,7 @@ public String toString() { } } - class FixedWithInitialDelayAndTimeoutBackOffPolicy implements BackOffDelayPolicy { + final class FixedWithInitialDelayAndTimeoutBackOffPolicy implements BackOffDelayPolicy { private final int attemptLimitBeforeTimeout; private final BackOffDelayPolicy delegate; diff --git a/src/main/java/com/rabbitmq/stream/ByteCapacity.java b/src/main/java/com/rabbitmq/stream/ByteCapacity.java index cc984c5250..c9b3609204 100644 --- a/src/main/java/com/rabbitmq/stream/ByteCapacity.java +++ b/src/main/java/com/rabbitmq/stream/ByteCapacity.java @@ -105,7 +105,7 @@ public long toBytes() { public static ByteCapacity from(String value) { Matcher matcher = PATTERN.matcher(value); if (matcher.matches()) { - long size = Long.valueOf(matcher.group(GROUP_SIZE)); + long size = Long.parseLong(matcher.group(GROUP_SIZE)); String unit = matcher.group(GROUP_UNIT); ByteCapacity result; if (unit == null) { diff --git a/src/main/java/com/rabbitmq/stream/Codec.java b/src/main/java/com/rabbitmq/stream/Codec.java index 2f6941cf45..07d79ec74b 100644 --- a/src/main/java/com/rabbitmq/stream/Codec.java +++ b/src/main/java/com/rabbitmq/stream/Codec.java @@ -14,6 +14,8 @@ // info@rabbitmq.com. package com.rabbitmq.stream; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + /** * Codec to encode and decode messages. * @@ -34,11 +36,13 @@ class EncodedMessage { private final int size; private final byte[] data; + @SuppressFBWarnings("EI_EXPOSE_REP2") public EncodedMessage(int size, byte[] data) { this.size = size; this.data = data; } + @SuppressFBWarnings("EI_EXPOSE_REP") public byte[] getData() { return data; } diff --git a/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java b/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java index 4277b3ebdc..eb6e92d17a 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java @@ -320,7 +320,7 @@ protected static AMQPType convertToSwiftMqType(Object value) { return new AMQPSymbol(value.toString()); } else if (value instanceof UUID) { return new AMQPUuid((UUID) value); - } else if (value == value) { + } else if (value == null) { return AMQPNull.NULL; } else { throw new IllegalArgumentException( diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 5f8cb2a214..31ceb08a78 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -55,6 +55,7 @@ import com.rabbitmq.stream.sasl.SaslConfiguration; import com.rabbitmq.stream.sasl.SaslMechanism; import com.rabbitmq.stream.sasl.UsernamePasswordCredentialsProvider; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.netty.bootstrap.Bootstrap; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; @@ -194,10 +195,12 @@ public long applyAsLong(Object value) { private final boolean filteringSupported; private final Runnable superStreamManagementCommandVersionsCheck; + @SuppressFBWarnings("CT_CONSTRUCTOR_THROW") public Client() { this(new ClientParameters()); } + @SuppressFBWarnings("CT_CONSTRUCTOR_THROW") public Client(ClientParameters parameters) { this.publishConfirmListener = parameters.publishConfirmListener; this.publishErrorListener = parameters.publishErrorListener; @@ -1678,7 +1681,7 @@ String serverAdvertisedHost() { } int serverAdvertisedPort() { - return Integer.valueOf(this.connectionProperties("advertised_port")); + return Integer.parseInt(this.connectionProperties("advertised_port")); } public String brokerVersion() { @@ -2233,7 +2236,7 @@ public StreamMetadata(String stream, short responseCode, Broker leader, List build() { - return parameters; + return new HashMap<>(parameters); } } diff --git a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java index 43cf96afc2..d563ffb3b1 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java @@ -57,6 +57,7 @@ class ConsumersCoordinator { static final int MAX_SUBSCRIPTIONS_PER_CLIENT = 256; static final int MAX_ATTEMPT_BEFORE_FALLING_BACK_TO_LEADER = 5; + private static final boolean DEBUG = false; static final OffsetSpecification DEFAULT_OFFSET_SPECIFICATION = OffsetSpecification.next(); @@ -70,7 +71,6 @@ class ConsumersCoordinator { private final NavigableSet managers = new ConcurrentSkipListSet<>(); private final AtomicLong trackerIdSequence = new AtomicLong(0); - private final boolean debug = false; private final List trackers = new CopyOnWriteArrayList<>(); private final ExecutorServiceFactory executorServiceFactory = new DefaultExecutorServiceFactory( @@ -144,7 +144,7 @@ Runnable subscribe( throw new StreamException(e.getMessage()); } - if (debug) { + if (DEBUG) { this.trackers.add(subscriptionTracker); return () -> { try { @@ -366,7 +366,7 @@ public String toString() { }) .collect(Collectors.joining(","))); builder.append("]"); - if (debug) { + if (DEBUG) { builder.append(","); builder.append("\"subscription_count\" : ").append(this.trackers.size()).append(","); builder.append("\"subscriptions\" : ["); @@ -1168,7 +1168,7 @@ synchronized void close() { SubscriptionTracker tracker = this.subscriptionTrackers.get(i); if (tracker != null) { try { - if (this.client != null && this.client.isOpen() && tracker.consumer.isOpen()) { + if (this.client.isOpen() && tracker.consumer.isOpen()) { this.client.unsubscribe(tracker.subscriptionIdInClient); } } catch (Exception e) { @@ -1184,7 +1184,7 @@ synchronized void close() { streamToStreamSubscriptions.clear(); - if (this.client != null && this.client.isOpen()) { + if (this.client.isOpen()) { this.client.close(); } } diff --git a/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java b/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java index 33e7174c48..57160496f9 100644 --- a/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java +++ b/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java @@ -79,7 +79,7 @@ public void checksum(ByteBuf byteBuf, long dataLength, long expected) { } } - private static class ByteBufferDirectByteBufChecksum implements ChunkChecksum { + private static final class ByteBufferDirectByteBufChecksum implements ChunkChecksum { private final Supplier checksumSupplier; private final Method updateMethod; @@ -105,9 +105,7 @@ public void checksum(ByteBuf byteBuf, long dataLength, long expected) { try { this.updateMethod.invoke( checksum, byteBuf.nioBuffer(byteBuf.readerIndex(), byteBuf.readableBytes())); - } catch (IllegalAccessException e) { - throw new StreamException("Error while calculating CRC", e); - } catch (InvocationTargetException e) { + } catch (IllegalAccessException | InvocationTargetException e) { throw new StreamException("Error while calculating CRC", e); } } diff --git a/src/main/java/com/rabbitmq/stream/impl/MessageBatch.java b/src/main/java/com/rabbitmq/stream/impl/MessageBatch.java index 5016830cb0..6225526dca 100644 --- a/src/main/java/com/rabbitmq/stream/impl/MessageBatch.java +++ b/src/main/java/com/rabbitmq/stream/impl/MessageBatch.java @@ -16,6 +16,7 @@ import com.rabbitmq.stream.Message; import com.rabbitmq.stream.compression.Compression; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.ArrayList; import java.util.List; @@ -24,18 +25,11 @@ public final class MessageBatch { final Compression compression; final List messages; - public MessageBatch() { - this(Compression.NONE, new ArrayList<>()); - } - public MessageBatch(Compression compression) { this(compression, new ArrayList<>()); } - public MessageBatch(List messages) { - this(Compression.NONE, messages); - } - + @SuppressFBWarnings("EI_EXPOSE_REP2") public MessageBatch(Compression compression, List messages) { this.compression = compression; this.messages = messages; @@ -45,20 +39,4 @@ public MessageBatch add(Message message) { this.messages.add(message); return this; } - - public List getMessages() { - return messages; - } - - /* - 0 = no compression - 1 = gzip - 2 = snappy - 3 = lz4 - 4 = zstd - 5 = reserved - 6 = reserved - 7 = user - */ - } diff --git a/src/main/java/com/rabbitmq/stream/impl/ParameterizedTypeReference.java b/src/main/java/com/rabbitmq/stream/impl/ParameterizedTypeReference.java index d10306e2e7..0061d9c2d7 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ParameterizedTypeReference.java +++ b/src/main/java/com/rabbitmq/stream/impl/ParameterizedTypeReference.java @@ -14,6 +14,7 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; @@ -26,10 +27,11 @@ * * @param */ -public abstract class ParameterizedTypeReference { +abstract class ParameterizedTypeReference { private final Type type; + @SuppressFBWarnings("CT_CONSTRUCTOR_THROW") protected ParameterizedTypeReference() { Class parameterizedTypeReferenceSubclass = findParameterizedTypeReferenceSubclass(getClass()); diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java index 36b6a5f4ba..56143a0547 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java @@ -59,6 +59,7 @@ class ProducersCoordinator { static final int MAX_PRODUCERS_PER_CLIENT = 256; static final int MAX_TRACKING_CONSUMERS_PER_CLIENT = 50; + private static final boolean DEBUG = false; private static final Logger LOGGER = LoggerFactory.getLogger(ProducersCoordinator.class); private final StreamEnvironment environment; private final ClientFactory clientFactory; @@ -67,7 +68,6 @@ class ProducersCoordinator { private final AtomicLong managerIdSequence = new AtomicLong(0); private final NavigableSet managers = new ConcurrentSkipListSet<>(); private final AtomicLong trackerIdSequence = new AtomicLong(0); - private final boolean debug = false; private final List producerTrackers = new CopyOnWriteArrayList<>(); private final ExecutorServiceFactory executorServiceFactory = new DefaultExecutorServiceFactory( @@ -97,7 +97,7 @@ Runnable registerProducer(StreamProducer producer, String reference, String stre () -> { ProducerTracker tracker = new ProducerTracker(trackerIdSequence.getAndIncrement(), reference, stream, producer); - if (debug) { + if (DEBUG) { this.producerTrackers.add(tracker); } return registerAgentTracker(tracker, stream); @@ -119,7 +119,7 @@ private Runnable registerAgentTracker(AgentTracker tracker, String stream) { addToManager(broker, tracker); - if (debug) { + if (DEBUG) { return () -> { if (tracker instanceof ProducerTracker) { try { @@ -275,7 +275,7 @@ public String toString() { "tracking_consumer_count", this.managers.stream().mapToInt(m -> m.trackingConsumerTrackers.size()).sum())) .append(","); - if (debug) { + if (DEBUG) { builder.append(jsonField("producer_tracker_count", this.producerTrackers.size())).append(","); } builder.append(quote("clients")).append(" : ["); @@ -321,7 +321,7 @@ public String toString() { }) .collect(Collectors.joining(","))); builder.append("]"); - if (debug) { + if (DEBUG) { builder.append(","); builder.append("\"producer_trackers\" : ["); builder.append( diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java index 72d86eece0..d252c777a5 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java @@ -25,6 +25,7 @@ import com.rabbitmq.stream.impl.StreamConsumerBuilder.TrackingConfiguration; import com.rabbitmq.stream.impl.StreamEnvironment.TrackingConsumerRegistration; import com.rabbitmq.stream.impl.Utils.CompositeConsumerUpdateListener; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.Collections; import java.util.Map; import java.util.Objects; @@ -64,6 +65,7 @@ class StreamConsumer implements Consumer { private final boolean sac; private final OffsetSpecification initialOffsetSpecification; + @SuppressFBWarnings("CT_CONSTRUCTOR_THROW") StreamConsumer( String stream, OffsetSpecification offsetSpecification, @@ -188,7 +190,8 @@ class StreamConsumer implements Consumer { return result; }; // just a trick for testing - if (consumerUpdateListener instanceof CompositeConsumerUpdateListener) { + // we know the update listener is either null or a composite one + if (consumerUpdateListener != null) { ((CompositeConsumerUpdateListener) consumerUpdateListener).add(defaultListener); this.consumerUpdateListener = consumerUpdateListener; } else { diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index cfbbfaec83..4dc869af19 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -31,6 +31,7 @@ import com.rabbitmq.stream.impl.Utils.ClientConnectionType; import com.rabbitmq.stream.sasl.CredentialsProvider; import com.rabbitmq.stream.sasl.UsernamePasswordCredentialsProvider; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.netty.buffer.ByteBufAllocator; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; @@ -87,6 +88,7 @@ class StreamEnvironment implements Environment { private final ExecutorServiceFactory executorServiceFactory; private final ObservationCollector observationCollector; + @SuppressFBWarnings("CT_CONSTRUCTOR_THROW") StreamEnvironment( ScheduledExecutorService scheduledExecutorService, Client.ClientParameters clientParametersPrototype, diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index 855004fead..7553e2c838 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -29,6 +29,7 @@ import com.rabbitmq.stream.compression.Compression; import com.rabbitmq.stream.impl.Client.Response; import com.rabbitmq.stream.impl.MessageAccumulator.AccumulatedEntity; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.netty.buffer.ByteBuf; import java.nio.charset.StandardCharsets; import java.time.Duration; @@ -83,6 +84,7 @@ class StreamProducer implements Producer { private volatile ScheduledFuture confirmTimeoutFuture; private final short publishVersion; + @SuppressFBWarnings("CT_CONSTRUCTOR_THROW") StreamProducer( String name, String stream, diff --git a/src/main/java/com/rabbitmq/stream/impl/SuperStreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/SuperStreamProducer.java index e6bb3b94d1..5078453342 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SuperStreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/SuperStreamProducer.java @@ -160,7 +160,7 @@ public void close() { } } - private static class DefaultSuperStreamMetadata implements Metadata { + private static final class DefaultSuperStreamMetadata implements Metadata { private final String superStream; private final StreamEnvironment environment; diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorBuilder.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorBuilder.java index 29c98ef28a..96462022be 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorBuilder.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorBuilder.java @@ -15,6 +15,7 @@ package com.rabbitmq.stream.observation.micrometer; import com.rabbitmq.stream.ObservationCollector; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationConvention; import io.micrometer.observation.ObservationRegistry; @@ -44,6 +45,7 @@ public class MicrometerObservationCollectorBuilder { * @param registry the registry * @return this builder instance */ + @SuppressFBWarnings("EI_EXPOSE_REP2") public MicrometerObservationCollectorBuilder registry(ObservationRegistry registry) { this.registry = registry; return this; diff --git a/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java b/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java index b8e351b59d..bdc38317a2 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java +++ b/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java @@ -22,7 +22,7 @@ import java.util.Map; /** {@link SaslConfiguration} that supports our built-in mechanisms. */ -public class DefaultSaslConfiguration implements SaslConfiguration { +public final class DefaultSaslConfiguration implements SaslConfiguration { public static final SaslConfiguration PLAIN = new DefaultSaslConfiguration(PlainSaslMechanism.INSTANCE.getName()); diff --git a/src/main/java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java b/src/main/java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java index 13ae33c70f..cfffe8de01 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java +++ b/src/main/java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java @@ -72,7 +72,7 @@ public SaslMechanism getSaslMechanism(List serverMechanisms) { return null; } - private class JdkSaslMechanism implements SaslMechanism { + private static class JdkSaslMechanism implements SaslMechanism { private final SaslClient client; public JdkSaslMechanism(SaslClient client) { @@ -94,13 +94,12 @@ public byte[] handleChallenge(byte[] challenge, CredentialsProvider credentialsP } } - private class UsernamePasswordCallbackHandler implements CallbackHandler { + private static final class UsernamePasswordCallbackHandler implements CallbackHandler { private final UsernamePasswordCredentialsProvider credentialsProvider; public UsernamePasswordCallbackHandler(CredentialsProvider credentialsProvider) { - if (credentialsProvider == null - || !(credentialsProvider instanceof UsernamePasswordCredentialsProvider)) { + if (!(credentialsProvider instanceof UsernamePasswordCredentialsProvider)) { throw new IllegalArgumentException( "Only username/password credentials provider is supported, not " + CredentialsProvider.class.getSimpleName()); From 4e4db7f7f13997db0af43e2468aaaec36e8d9356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 27 May 2024 15:30:48 +0200 Subject: [PATCH 106/449] Update Murmur 3 from Commons Codec --- .../java/com/rabbitmq/stream/impl/HashUtils.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/HashUtils.java b/src/main/java/com/rabbitmq/stream/impl/HashUtils.java index 705e4bc48c..4a770ac09d 100644 --- a/src/main/java/com/rabbitmq/stream/impl/HashUtils.java +++ b/src/main/java/com/rabbitmq/stream/impl/HashUtils.java @@ -14,6 +14,7 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.nio.charset.StandardCharsets; import java.util.function.ToIntFunction; @@ -25,6 +26,7 @@ private HashUtils() {} // from // https://github.com/apache/commons-codec/blob/rel/commons-codec-1.15/src/main/java/org/apache/commons/codec/digest/MurmurHash3.java + // hash32x86 method static class Murmur3 implements ToIntFunction { private static final int DEFAULT_SEED = 104729; @@ -37,10 +39,10 @@ static class Murmur3 implements ToIntFunction { private static final int N_32 = 0xe6546b64; private static int getLittleEndianInt(final byte[] data, final int index) { - return ((data[index] & 0xff)) - | ((data[index + 1] & 0xff) << 8) - | ((data[index + 2] & 0xff) << 16) - | ((data[index + 3] & 0xff) << 24); + return data[index] & 0xff + | (data[index + 1] & 0xff) << 8 + | (data[index + 2] & 0xff) << 16 + | (data[index + 3] & 0xff) << 24; } private static int mix32(int k, int hash) { @@ -70,6 +72,7 @@ private static int fmix32(int hash) { this.seed = seed; } + @SuppressFBWarnings({"SF_SWITCH_FALLTHROUGH", "SF_SWITCH_NO_DEFAULT"}) @Override public int applyAsInt(String value) { byte[] data = value.getBytes(StandardCharsets.UTF_8); @@ -94,7 +97,7 @@ public int applyAsInt(String value) { case 2: k1 ^= (data[index + 1] & 0xff) << 8; case 1: - k1 ^= (data[index] & 0xff); + k1 ^= data[index] & 0xff; // mix functions k1 *= C1_32; From ae21212f33ff7021758db51402c0bc71963a2a3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 16:19:53 +0000 Subject: [PATCH 107/449] Bump org.assertj:assertj-core from 3.25.3 to 3.26.0 Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.25.3 to 3.26.0. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.25.3...assertj-build-3.26.0) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cfda8b52e3..df7c97ac04 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.8.0 1.1.10.5 5.10.2 - 3.25.3 + 3.26.0 5.12.0 5.21.0 3.14.0 From 591d7ac3809b0c879029c511698caacaac2bed2a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 08:39:57 +0000 Subject: [PATCH 108/449] Bump org.sonatype.plugins:nexus-staging-maven-plugin Bumps org.sonatype.plugins:nexus-staging-maven-plugin from 1.6.13 to 1.7.0. --- updated-dependencies: - dependency-name: org.sonatype.plugins:nexus-staging-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index df7c97ac04..7fc94ec019 100644 --- a/pom.xml +++ b/pom.xml @@ -98,7 +98,7 @@ yyyy-MM-dd'T'HH:mm:ss'Z' UTF-8 0.0.6 - 1.6.13 + 1.7.0 true true From c0daa2f64093529fc36219d29d1c8a4de813cd32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 28 May 2024 11:09:50 +0200 Subject: [PATCH 109/449] Fix JaCoCo reporting Needed to pass in ${argLine} to Surefire. --- pom.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 7fc94ec019..fec809bdde 100644 --- a/pom.xml +++ b/pom.xml @@ -307,7 +307,7 @@ com.github.spotbugs spotbugs-annotations - 4.8.5 + ${spotbugs.version} provided @@ -363,7 +363,7 @@ **/*TestSuite.java - ${test-arguments} + ${argLine} ${test-arguments} true DOCKER:rabbitmq @@ -673,13 +673,22 @@ 4.11.0 + + jvm-test-arguments-below-java-21 + + [11,21) + + + -Xshare:off + + jvm-test-arguments-java-21-and-more [21,) - -XX:+EnableDynamicAgentLoading + -Xshare:off -XX:+EnableDynamicAgentLoading From 49cd8a438474d89616596b5e51ec7bd7fd16bc7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 28 May 2024 11:52:57 +0200 Subject: [PATCH 110/449] Fix pom.xml for Java 8 --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index fec809bdde..3ca66fd675 100644 --- a/pom.xml +++ b/pom.xml @@ -671,6 +671,7 @@ 4.11.0 + -Xshare:off From e366b82d91a797951f019b315ba3de6a96640622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 28 May 2024 13:45:41 +0200 Subject: [PATCH 111/449] Set release version to 0.16.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index e9966ab412..8ee6f3220c 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,5 +1,5 @@ -RELEASE_VERSION="0.16.0.RC1" -DEVELOPMENT_VERSION="0.16.0-SNAPSHOT" +RELEASE_VERSION="0.16.0" +DEVELOPMENT_VERSION="0.17.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 3c28fc3d011cdbec6541d5f89d9a36422baab253 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Tue, 28 May 2024 11:49:00 +0000 Subject: [PATCH 112/449] [maven-release-plugin] prepare release v0.16.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3ca66fd675..6372345003 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.16.0-SNAPSHOT + 0.16.0 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.16.0 From 7402af02bd0557ebad2eb6aa0070a93d47fc029b Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Tue, 28 May 2024 11:49:01 +0000 Subject: [PATCH 113/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 6372345003..673e1649b9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.16.0 + 0.17.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.16.0 + HEAD From 390b4956e0ace2c3abfb52351655b6b8d024bb0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 28 May 2024 13:55:20 +0200 Subject: [PATCH 114/449] Set release version to 0.17.0.RC1 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index 8ee6f3220c..665892d35a 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,4 +1,4 @@ -RELEASE_VERSION="0.16.0" +RELEASE_VERSION="0.17.0.RC1" DEVELOPMENT_VERSION="0.17.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 48aceab8a0b984b8818a15ef6039a16a999d6806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 28 May 2024 15:15:41 +0200 Subject: [PATCH 115/449] Use RabbitMQ 3.13 in readme --- README.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.adoc b/README.adoc index fe0d18becc..a42d997289 100644 --- a/README.adoc +++ b/README.adoc @@ -80,7 +80,7 @@ Launch the broker: ---- docker run -it --rm --name rabbitmq -p 5552:5552 -p 5672:5672 \ -e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS='-rabbitmq_stream advertised_host localhost' \ - rabbitmq:3.12 + rabbitmq:3.13 ---- Enable the stream plugin: From 744205ccf9612909a13c478b2b8efab518c71172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 30 May 2024 08:59:09 +0200 Subject: [PATCH 116/449] Update URL to blog posts --- src/docs/asciidoc/api.adoc | 6 +++--- src/docs/asciidoc/overview.adoc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/docs/asciidoc/api.adoc b/src/docs/asciidoc/api.adoc index fbca3ae4d9..66f678c0d3 100644 --- a/src/docs/asciidoc/api.adoc +++ b/src/docs/asciidoc/api.adoc @@ -75,7 +75,7 @@ Creating the environment to connect to a cluster node works usually seamlessly. Creating publishers and consumers can cause problems as the client uses hints from the cluster to find the nodes where stream leaders and replicas are located to connect to the appropriate nodes. These connection hints can be accurate or less appropriate depending on the infrastructure. -If you hit some connection problems at some point โ€“ like hostnames impossible to resolve for client applications - this https://blog.rabbitmq.com/posts/2021/07/connecting-to-streams/[blog post] should help you understand what is going on and fix the issues. +If you hit some connection problems at some point โ€“ like hostnames impossible to resolve for client applications - this https://www.rabbitmq.com/blog/2021/07/23/connecting-to-streams[blog post] should help you understand what is going on and fix the issues. To make the local development experience simple, the client library can choose to always use `localhost` for producers and consumers. This happens if the following conditions are met: the initial host to connect to is `localhost`, the user is `guest`, and no custom address resolver has been provided. @@ -275,7 +275,7 @@ It is the developer's responsibility to close the `EventLoopGroup` they provide. ==== When a Load Balancer is in Use A load balancer can misguide the client when it tries to connect to nodes that host stream leaders and replicas. -The https://blog.rabbitmq.com/posts/2021/07/connecting-to-streams/["Connecting to Streams"] blog post covers why client applications must connect to the appropriate nodes in a cluster and how a https://blog.rabbitmq.com/posts/2021/07/connecting-to-streams/#with-a-load-balancer[load balancer can make things complicated] for them. +The https://www.rabbitmq.com/blog/2021/07/23/connecting-to-streams["Connecting to Streams"] blog post covers why client applications must connect to the appropriate nodes in a cluster and how a https://blog.rabbitmq.com/posts/2021/07/connecting-to-streams/#with-a-load-balancer[load balancer can make things complicated] for them. The `EnvironmentBuilder#addressResolver(AddressResolver)` method allows intercepting the node resolution after metadata hints and before connection. Applications can use this hook to ignore metadata hints and always use the load balancer, as illustrated in the following snippet: @@ -289,7 +289,7 @@ include::{test-examples}/EnvironmentUsage.java[tag=address-resolver] <2> Use load balancer address for initial connection <3> Ignore metadata hints, always use load balancer -The blog post covers the https://blog.rabbitmq.com/posts/2021/07/connecting-to-streams/#client-workaround-with-a-load-balancer[underlying details of this workaround]. +The blog post covers the https://www.rabbitmq.com/blog/2021/07/23/connecting-to-streams/#client-workaround-with-a-load-balancer[underlying details of this workaround]. ==== Managing Streams diff --git a/src/docs/asciidoc/overview.adoc b/src/docs/asciidoc/overview.adoc index c133d2af38..a293ab3ec7 100644 --- a/src/docs/asciidoc/overview.adoc +++ b/src/docs/asciidoc/overview.adoc @@ -66,7 +66,7 @@ can also be useful for development and testing. * _avoid publishing duplicate messages_ thanks to message deduplication. * _consume asynchronously from streams and resume where left off_ thanks to automatic or manual offset tracking. -* _enforce https://blog.rabbitmq.com/posts/2021/07/connecting-to-streams/[best practices] to create client connections_ โ€“ to stream leaders for publishers to minimize inter-node traffic and to stream replicas for consumers to offload leaders. +* _enforce https://www.rabbitmq.com/blog/2021/07/23/connecting-to-streams/#client-workaround-with-a-load-balancer[best practices] to create client connections_ โ€“ to stream leaders for publishers to minimize inter-node traffic and to stream replicas for consumers to offload leaders. * _optimize resources_ thanks to automatic growing and shrinking of connections depending on the number of publishers and consumers. * _let the client handle network failure_ thanks to automatic connection From 92d23c9804fc588938f293d1296b1c52b84fefc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 30 May 2024 09:12:01 +0200 Subject: [PATCH 117/449] Add item on monitoring in client overview documentation --- src/docs/asciidoc/overview.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/docs/asciidoc/overview.adoc b/src/docs/asciidoc/overview.adoc index a293ab3ec7..22cea6b4e3 100644 --- a/src/docs/asciidoc/overview.adoc +++ b/src/docs/asciidoc/overview.adoc @@ -71,6 +71,7 @@ automatic or manual offset tracking. connections depending on the number of publishers and consumers. * _let the client handle network failure_ thanks to automatic connection recovery and automatic re-subscription for consumers. +* _publish metrics_ to monitoring systems like https://prometheus.io/[Prometheus] and _ship spans_ to distributed tracing backends like https://zipkin.io/[OpenZipkin] or https://tanzu.vmware.com/observability[Wavefront] thanks to built-in support for https://micrometer.io/[Micrometer]. == Versioning From 08877cdf889c93bdd6fd3535e4d1b6f8e3141807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 30 May 2024 09:14:56 +0200 Subject: [PATCH 118/449] Add link to documentation overview in readme --- README.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/README.adoc b/README.adoc index a42d997289..bc0ad962b0 100644 --- a/README.adoc +++ b/README.adoc @@ -9,6 +9,7 @@ the https://rabbitmq.com/stream.html[RabbitMQ Stream Plugin]. It allows to create and delete streams, as well as to publish to and consume from these streams. This library requires at least Java 8, but Java 11 or more is recommended. +See the https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmlsingle/#stream-client-overview[overview] for a quick glance at the features. https://github.com/rabbitmq/rabbitmq-stream-perf-test[Stream PerfTest] is a performance testing tool based on this client library. From 5e3fe4af4c5b1e909391fd3a30b380cb0965d315 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 16:42:47 +0000 Subject: [PATCH 119/449] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.3 to 3.7.0 Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.3 to 3.7.0. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.3...maven-javadoc-plugin-3.7.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 673e1649b9..025a9337c0 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 3.2.0 3.3.1 3.3.1 - 3.6.3 + 3.7.0 3.4.1 3.4.0 3.0.0 From a40f313ba3392eeb103f52b6be46572e2e82473e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 16:40:43 +0000 Subject: [PATCH 120/449] Bump io.dropwizard.metrics:metrics-core from 4.2.25 to 4.2.26 Bumps [io.dropwizard.metrics:metrics-core](https://github.com/dropwizard/metrics) from 4.2.25 to 4.2.26. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.25...v4.2.26) --- updated-dependencies: - dependency-name: io.dropwizard.metrics:metrics-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 025a9337c0..69e1a41c81 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 1.2.13 4.1.110.Final 0.34.1 - 4.2.25 + 4.2.26 1.13.0 12.2.2 4.7.5 From 2ce1c0fa8b1677ca583b2541b0d18e6397c49b8e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:22:09 +0000 Subject: [PATCH 121/449] Bump netty.version from 4.1.110.Final to 4.1.111.Final Bumps `netty.version` from 4.1.110.Final to 4.1.111.Final. Updates `io.netty:netty-transport` from 4.1.110.Final to 4.1.111.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.110.Final...netty-4.1.111.Final) Updates `io.netty:netty-codec` from 4.1.110.Final to 4.1.111.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.110.Final...netty-4.1.111.Final) Updates `io.netty:netty-handler` from 4.1.110.Final to 4.1.111.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.110.Final...netty-4.1.111.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.110.Final to 4.1.111.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.110.Final...netty-4.1.111.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 69e1a41c81..3342d39b8f 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.110.Final + 4.1.111.Final 0.34.1 4.2.26 1.13.0 From cf2d3cd169e0588d7c1ae62147e5dc73bff58d45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:22:13 +0000 Subject: [PATCH 122/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.3.0 to 1.3.1. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.3.0...v1.3.1) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 69e1a41c81..ac2d53a764 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.11.0 0.10.4 1.2.5 - 1.3.0 + 1.3.1 1.0.2 3.13.0 3.2.5 From 197ca9560a52cb267df50f05b34514a77c1500cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 16:22:21 +0000 Subject: [PATCH 123/449] Bump io.micrometer:micrometer-core from 1.13.0 to 1.13.1 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.13.0 to 1.13.1. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.13.0...v1.13.1) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 69e1a41c81..767ba7328d 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.110.Final 0.34.1 4.2.26 - 1.13.0 + 1.13.1 12.2.2 4.7.5 1.26.2 From e00aa2df5f4f6aa7769a157fa4cfb70984f20b15 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 16:52:30 +0000 Subject: [PATCH 124/449] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.2.5 to 3.3.0 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.5 to 3.3.0. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.5...surefire-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 07e4fef48c..12cd96fdbc 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ 1.3.1 1.0.2 3.13.0 - 3.2.5 + 3.3.0 1.11 3.2.4 3.2.0 From 947be71fe5e48725d3fbdd43d97f62b02b9535f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 16:46:21 +0000 Subject: [PATCH 125/449] Bump spotbugs.version from 4.8.5 to 4.8.6 Bumps `spotbugs.version` from 4.8.5 to 4.8.6. Updates `com.github.spotbugs:spotbugs-annotations` from 4.8.5 to 4.8.6 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.8.5...4.8.6) Updates `com.github.spotbugs:spotbugs` from 4.8.5 to 4.8.6 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.8.5...4.8.6) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-annotations dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.github.spotbugs:spotbugs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 12cd96fdbc..5724523ae1 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,7 @@ 1.22.0 0.8.12 4.8.5.0 - 4.8.5 + 4.8.6 3.12 From 51b2b8acece792fc0556c5da0e99e979991fa632 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:54:54 +0000 Subject: [PATCH 126/449] Bump org.apache.maven.plugins:maven-jar-plugin from 3.4.1 to 3.4.2 Bumps [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.4.1 to 3.4.2. - [Release notes](https://github.com/apache/maven-jar-plugin/releases) - [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.4.1...maven-jar-plugin-3.4.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-jar-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5724523ae1..3d8227d8d7 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 3.3.1 3.3.1 3.7.0 - 3.4.1 + 3.4.2 3.4.0 3.0.0 2.5.13 From 649e3c2ffe8dc565390a96c24e3e8ffab3c81315 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jun 2024 16:02:36 +0000 Subject: [PATCH 127/449] Bump org.asciidoctor:asciidoctorj-diagram from 2.3.0 to 2.3.1 Bumps [org.asciidoctor:asciidoctorj-diagram](https://github.com/asciidoctor/asciidoctorj-diagram) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/asciidoctor/asciidoctorj-diagram/releases) - [Commits](https://github.com/asciidoctor/asciidoctorj-diagram/compare/v2.3.0...v2.3.1) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj-diagram dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3d8227d8d7..7f95db3b02 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,7 @@ 3.4.0 3.0.0 2.5.13 - 2.3.0 + 2.3.1 3.2.0 1.37 2.43.0 From 80feb4641a48e5f42ac3126ba56ffc63eda89bb6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 16:31:13 +0000 Subject: [PATCH 128/449] Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.5.0 to 4.8.6.0 Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.8.5.0 to 4.8.6.0. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.8.5.0...spotbugs-maven-plugin-4.8.6.0) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7f95db3b02..21c1d3ecd9 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ 2.43.0 1.22.0 0.8.12 - 4.8.5.0 + 4.8.6.0 4.8.6 3.12 From 685b8bb06401a577277bb5a3d8485e74158bd7d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:43:20 +0000 Subject: [PATCH 129/449] Bump org.junit:junit-bom from 5.10.2 to 5.10.3 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.10.2 to 5.10.3. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.2...r5.10.3) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 21c1d3ecd9..b28e157b6a 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.5.6-3 1.8.0 1.1.10.5 - 5.10.2 + 5.10.3 3.26.0 5.12.0 5.21.0 From 77012c1b2939ce14054fa22ec3287e2e8e786601 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:43:30 +0000 Subject: [PATCH 130/449] Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.6.0 to 4.8.6.1 Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.8.6.0 to 4.8.6.1. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.8.6.0...spotbugs-maven-plugin-4.8.6.1) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 21c1d3ecd9..28ef78794a 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ 2.43.0 1.22.0 0.8.12 - 4.8.6.0 + 4.8.6.1 4.8.6 3.12 From 81cc5e506783c31d5df09885a5aac37e81c5effa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:50:00 +0000 Subject: [PATCH 131/449] Bump io.micrometer:micrometer-docs-generator from 1.0.2 to 1.0.3 Bumps [io.micrometer:micrometer-docs-generator](https://github.com/micrometer-metrics/micrometer-docs-generator) from 1.0.2 to 1.0.3. - [Release notes](https://github.com/micrometer-metrics/micrometer-docs-generator/releases) - [Commits](https://github.com/micrometer-metrics/micrometer-docs-generator/compare/v1.0.2...v1.0.3) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-docs-generator dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b2696289cf..c49b4e567b 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 0.10.4 1.2.5 1.3.1 - 1.0.2 + 1.0.3 3.13.0 3.3.0 1.11 From 96d730fed3d91ecefda2af40022680ddb426fd80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jul 2024 16:50:03 +0000 Subject: [PATCH 132/449] Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.6.1 to 4.8.6.2 Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.8.6.1 to 4.8.6.2. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.8.6.1...spotbugs-maven-plugin-4.8.6.2) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b2696289cf..3988638137 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ 2.43.0 1.22.0 0.8.12 - 4.8.6.1 + 4.8.6.2 4.8.6 3.12 From 69edea2ecb0fba9b857d2952169e2ed05db985db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 16:23:56 +0000 Subject: [PATCH 133/449] Bump io.micrometer:micrometer-core from 1.13.1 to 1.13.2 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.13.1 to 1.13.2. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.13.1...v1.13.2) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9b2b360084..4159e1ce30 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.111.Final 0.34.1 4.2.26 - 1.13.1 + 1.13.2 12.2.2 4.7.5 1.26.2 From a91a6fd128079917cdafcc3b085b6a09614364ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 16:24:02 +0000 Subject: [PATCH 134/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.3.1...v1.3.2) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9b2b360084..3d57a3ffa2 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.11.0 0.10.4 1.2.5 - 1.3.1 + 1.3.2 1.0.3 3.13.0 3.3.0 From 3fb0c5b19427532ba7f471c2ff9c9dd2fddf7af2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:30:32 +0000 Subject: [PATCH 135/449] Bump org.assertj:assertj-core from 3.26.0 to 3.26.3 Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.26.0 to 3.26.3. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.26.0...assertj-build-3.26.3) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a882ae04d5..1fc509f528 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.8.0 1.1.10.5 5.10.3 - 3.26.0 + 3.26.3 5.12.0 5.21.0 3.14.0 From f2ac49a67028d33f5100c8736286b3f88dac5e32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 11 Jul 2024 09:50:21 +0200 Subject: [PATCH 136/449] Use RabbitMQ 3.13 in documentation --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1fc509f528..54d3f97ac8 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ 4.8.6.2 4.8.6 - 3.12 + 3.13 6026DFCA yyyy-MM-dd'T'HH:mm:ss'Z' From 364ffd7d04d371acdb5d71495fd8325c92104f33 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:47:09 +0000 Subject: [PATCH 137/449] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.3.0 to 3.3.1 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.3.0 to 3.3.1. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.3.0...surefire-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 54d3f97ac8..048c59f980 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ 1.3.2 1.0.3 3.13.0 - 3.3.0 + 3.3.1 1.11 3.2.4 3.2.0 From 435e27642eac75c40cdd7455dfe95660de1c86bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:37:51 +0000 Subject: [PATCH 138/449] Bump commons-codec:commons-codec from 1.17.0 to 1.17.1 Bumps [commons-codec:commons-codec](https://github.com/apache/commons-codec) from 1.17.0 to 1.17.1. - [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.17.0...rel/commons-codec-1.17.1) --- updated-dependencies: - dependency-name: commons-codec:commons-codec dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 048c59f980..1d1bf1f037 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 5.12.0 5.21.0 3.14.0 - 1.17.0 + 1.17.1 2.11.0 0.10.4 1.2.5 From 661c6cdedbf7e09879a33072004c440fb73befa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 17 Jul 2024 10:37:24 +0200 Subject: [PATCH 139/449] Test against v4.0.x Docker image --- .github/workflows/test-rabbitmq-alphas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index 813603d97e..aa841842bc 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v3.13.x', 'pivotalrabbitmq/rabbitmq:main' ] + rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v3.13.x', 'pivotalrabbitmq/rabbitmq:v4.0.x' ] name: Test against ${{ matrix.rabbitmq-image }} steps: - uses: actions/checkout@v4 From 5d9fc072df4eebdb97f4a53bb48d7cd31989751f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 17 Jul 2024 11:45:05 +0200 Subject: [PATCH 140/449] Adapt interoperability test expectation References rabbitmq/rabbitmq-server#11715 --- .../stream/impl/AmqpInteroperabilityTest.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java index 1ea1182725..a28e7abec8 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java @@ -576,9 +576,19 @@ void publishToStreamConsumeFromStreamQueue(Codec codec, TestInfo info) { mb -> mb.applicationProperties() .entry("binary", "hello".getBytes(UTF8)), - d -> - assertThat(d.getProperties().getHeaders()) - .containsEntry("binary", "hello".getBytes(UTF8)))); + d -> { + // TODO leave only LongString expectation once 3.13.5 is out + Object binary = d.getProperties().getHeaders().get("binary"); + Object expected; + if (binary instanceof LongString) { + // 3.13.5+ + expected = LongStringHelper.asLongString("hello"); + } else { + expected = "hello".getBytes(UTF8); + } + assertThat(d.getProperties().getHeaders()) + .containsEntry("binary", expected); + })); client.declarePublisher(b(1), null, s); IntStream.range(0, messageCount) From 741ec921f91309a38d2fc7815031c9a7d920c355 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Jul 2024 16:27:48 +0000 Subject: [PATCH 141/449] Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.15.0 Bumps org.apache.commons:commons-lang3 from 3.14.0 to 3.15.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-lang3 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1d1bf1f037..e3af92e7d0 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 3.26.3 5.12.0 5.21.0 - 3.14.0 + 3.15.0 1.17.1 2.11.0 0.10.4 From 96fdcc0c1637858df4ee76903170220b22e04132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 22 Jul 2024 16:49:36 +0200 Subject: [PATCH 142/449] Bump year in copyright --- src/main/java/com/rabbitmq/stream/impl/ClientProperties.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java b/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java index 5985596645..89af455b0d 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java +++ b/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java @@ -45,7 +45,7 @@ public final class ClientProperties { put("product", "RabbitMQ Stream"); put("version", ClientProperties.VERSION); put("platform", "Java"); - put("copyright", "Copyright (c) 2020-2023 Broadcom Inc. and/or its subsidiaries."); + put("copyright", "Copyright (c) 2020-2024 Broadcom Inc. and/or its subsidiaries."); put("information", "Licensed under the MPL 2.0. See https://www.rabbitmq.com/"); } }); From 58f864bf4b640361ffabd476951b94409c0bc2bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:23:49 +0000 Subject: [PATCH 143/449] Bump netty.version from 4.1.111.Final to 4.1.112.Final Bumps `netty.version` from 4.1.111.Final to 4.1.112.Final. Updates `io.netty:netty-transport` from 4.1.111.Final to 4.1.112.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.111.Final...netty-4.1.112.Final) Updates `io.netty:netty-codec` from 4.1.111.Final to 4.1.112.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.111.Final...netty-4.1.112.Final) Updates `io.netty:netty-handler` from 4.1.111.Final to 4.1.112.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.111.Final...netty-4.1.112.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.111.Final to 4.1.112.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.111.Final...netty-4.1.112.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e3af92e7d0..45773a14ca 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.111.Final + 4.1.112.Final 0.34.1 4.2.26 1.13.2 From 9a72fc9f0ed3ce265bf1049c44b4a05c3daeca2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:23:54 +0000 Subject: [PATCH 144/449] Bump com.github.luben:zstd-jni from 1.5.6-3 to 1.5.6-4 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.6-3 to 1.5.6-4. - [Commits](https://github.com/luben/zstd-jni/compare/v1.5.6-3...v1.5.6-4) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e3af92e7d0..53cd53d57e 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 12.2.2 4.7.5 1.26.2 - 1.5.6-3 + 1.5.6-4 1.8.0 1.1.10.5 5.10.3 From 488ddaadf8f888f754c3e722dcf559c4e9c52f25 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 16:24:02 +0000 Subject: [PATCH 145/449] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.7.0 to 3.8.0 Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.7.0 to 3.8.0. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.7.0...maven-javadoc-plugin-3.8.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e3af92e7d0..70f2fc149e 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 3.2.0 3.3.1 3.3.1 - 3.7.0 + 3.8.0 3.4.2 3.4.0 3.0.0 From d25e2df7384f256020e8b4b650d13ec4e43a611e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 26 Jul 2024 08:34:57 +0200 Subject: [PATCH 146/449] Expect AMQP 091 LongString from AMQP 1.0 binary References rabbitmq/rabbitmq-server#11715 --- .../rabbitmq/stream/impl/AmqpInteroperabilityTest.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java index a28e7abec8..f1ca13ea60 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java @@ -577,15 +577,7 @@ void publishToStreamConsumeFromStreamQueue(Codec codec, TestInfo info) { mb.applicationProperties() .entry("binary", "hello".getBytes(UTF8)), d -> { - // TODO leave only LongString expectation once 3.13.5 is out - Object binary = d.getProperties().getHeaders().get("binary"); - Object expected; - if (binary instanceof LongString) { - // 3.13.5+ - expected = LongStringHelper.asLongString("hello"); - } else { - expected = "hello".getBytes(UTF8); - } + LongString expected = LongStringHelper.asLongString("hello"); assertThat(d.getProperties().getHeaders()) .containsEntry("binary", expected); })); From 424b30d492251dfaf91bd14f1ec33114e728866f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Jul 2024 07:01:59 +0000 Subject: [PATCH 147/449] Bump com.google.googlejavaformat:google-java-format Bumps [com.google.googlejavaformat:google-java-format](https://github.com/google/google-java-format) from 1.22.0 to 1.23.0. - [Release notes](https://github.com/google/google-java-format/releases) - [Commits](https://github.com/google/google-java-format/compare/v1.22.0...v1.23.0) --- updated-dependencies: - dependency-name: com.google.googlejavaformat:google-java-format dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e762eeaea9..89278522f5 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ 3.2.0 1.37 2.43.0 - 1.22.0 + 1.23.0 0.8.12 4.8.6.2 4.8.6 From 31f647837c228d48127b7e28fda0bc1e58b0e5d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:53:06 +0000 Subject: [PATCH 148/449] Bump org.apache.commons:commons-lang3 from 3.15.0 to 3.16.0 Bumps org.apache.commons:commons-lang3 from 3.15.0 to 3.16.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-lang3 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 89278522f5..005a1d7b33 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 3.26.3 5.12.0 5.21.0 - 3.15.0 + 3.16.0 1.17.1 2.11.0 0.10.4 From 5c22be9b82732a6f35162c005e7a67ff9711f8b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:53:14 +0000 Subject: [PATCH 149/449] Bump org.xerial.snappy:snappy-java from 1.1.10.5 to 1.1.10.6 Bumps [org.xerial.snappy:snappy-java](https://github.com/xerial/snappy-java) from 1.1.10.5 to 1.1.10.6. - [Release notes](https://github.com/xerial/snappy-java/releases) - [Commits](https://github.com/xerial/snappy-java/compare/v1.1.10.5...v1.1.10.6) --- updated-dependencies: - dependency-name: org.xerial.snappy:snappy-java dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 89278522f5..35098bd9d6 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 1.26.2 1.5.6-4 1.8.0 - 1.1.10.5 + 1.1.10.6 5.10.3 3.26.3 5.12.0 From 409906a419f0ddee36a6e570d9698879e3601d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 8 Aug 2024 15:15:55 +0200 Subject: [PATCH 150/449] Release buffer from outstanding connection tasks A connection can accumulate delivery frames in its dedicated executor service. The executor service is shut down when the connection closes and it can contain tasks that have not commenced execution. These tasks will never get executed, so their respective buffer must be released to avoid a memory leak. The leak can occur with consumer churn combined witht one-consumer connections. Fixes #585 --- .../java/com/rabbitmq/stream/impl/Client.java | 53 +++++++++++++++++-- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 31ceb08a78..496254c5c3 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -352,9 +352,17 @@ public void initChannel(SocketChannel ch) { this.executorServiceClosing = Utils.makeIdempotent( () -> { - this.dispatchingExecutorService.shutdownNow(); if (dispatchingExecutorServiceFactory == null) { - this.dispatchingExecutorService.shutdownNow(); + List outstandingTasks = this.dispatchingExecutorService.shutdownNow(); + for (Runnable outstandingTask : outstandingTasks) { + try { + outstandingTask.run(); + } catch (Exception e) { + LOGGER.info( + "Error while releasing buffer in outstanding connection tasks: {}", + e.getMessage()); + } + } } else { dispatchingExecutorServiceFactory.clientClosed(this.dispatchingExecutorService); } @@ -2770,7 +2778,8 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { } } else { FrameHandler frameHandler = ServerFrameHandler.lookup(commandId, version, m); - task = () -> frameHandler.handle(Client.this, frameSize, ctx, m); + // task = () -> frameHandler.handle(Client.this, frameSize, ctx, m); + task = new FrameHandlerTask(frameHandler, Client.this, frameSize, ctx, m, closing); } if (task != null) { @@ -2839,6 +2848,44 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { } } + private static class FrameHandlerTask implements Runnable { + + private final FrameHandler frameHandler; + private final Client client; + private final int frameSize; + private final ChannelHandlerContext ctx; + private final ByteBuf message; + private final AtomicBoolean closing; + + private FrameHandlerTask( + FrameHandler frameHandler, + Client client, + int frameSize, + ChannelHandlerContext ctx, + ByteBuf message, + AtomicBoolean closing) { + this.frameHandler = frameHandler; + this.client = client; + this.frameSize = frameSize; + this.ctx = ctx; + this.message = message; + this.closing = closing; + } + + @Override + public void run() { + if (this.closing.get()) { + try { + this.message.release(); + } catch (Exception e) { + e.printStackTrace(); + } + } else { + this.frameHandler.handle(this.client, this.frameSize, this.ctx, this.message); + } + } + } + private OutstandingRequest outstandingRequest() { return new OutstandingRequest<>(this.rpcTimeout, this.host + ":" + this.port); } From 2a4ef80a7c0d297ae83c2474a0859eb1dcbb2f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 8 Aug 2024 15:24:04 +0200 Subject: [PATCH 151/449] Delete commented line --- src/main/java/com/rabbitmq/stream/impl/Client.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 496254c5c3..bb52b9172e 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -2778,7 +2778,6 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { } } else { FrameHandler frameHandler = ServerFrameHandler.lookup(commandId, version, m); - // task = () -> frameHandler.handle(Client.this, frameSize, ctx, m); task = new FrameHandlerTask(frameHandler, Client.this, frameSize, ctx, m, closing); } From 0017b36cc524838675d0103ca93b3e24695558cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 8 Aug 2024 15:55:34 +0200 Subject: [PATCH 152/449] Change test expectation Garbage in the SASL frame can also trigger a timeout because the broker closes the connection before the client can throw the SASL error. --- src/main/java/com/rabbitmq/stream/impl/Client.java | 2 +- .../java/com/rabbitmq/stream/impl/AuthenticationTest.java | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index bb52b9172e..4e3cf4c264 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -2877,7 +2877,7 @@ public void run() { try { this.message.release(); } catch (Exception e) { - e.printStackTrace(); + LOGGER.info("Error while releasing buffer after connection closing: {}", e.getMessage()); } } else { this.frameHandler.handle(this.client, this.frameSize, this.ctx, this.message); diff --git a/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java b/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java index 91040c5523..a783bd9a46 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java @@ -23,6 +23,7 @@ import com.rabbitmq.stream.StreamException; import com.rabbitmq.stream.sasl.*; import java.nio.charset.StandardCharsets; +import java.time.Duration; import java.util.UUID; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -87,6 +88,7 @@ void authenticateShouldFailWhenSendingGarbageToSaslChallenge() { try { cf.get( new Client.ClientParameters() + .rpcTimeout(Duration.ofSeconds(1)) .saslConfiguration( mechanisms -> new SaslMechanism() { @@ -102,7 +104,10 @@ public byte[] handleChallenge( } })); } catch (StreamException e) { - assertThat(e.getMessage()).contains(String.valueOf(Constants.RESPONSE_CODE_SASL_ERROR)); + // there can be a timeout because the connection gets closed before returning the error + assertThat(e.getMessage()) + .containsAnyOf( + String.valueOf(Constants.RESPONSE_CODE_SASL_ERROR), "Could not get response in"); } } From 4f844305acdb3e2258a8d8bce2c76205aec8c1ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 8 Aug 2024 16:19:18 +0200 Subject: [PATCH 153/449] Use dedicated flag to dispatch frame on connection closing References #585 --- src/main/java/com/rabbitmq/stream/impl/Client.java | 14 +++++++++----- .../rabbitmq/stream/impl/AuthenticationTest.java | 4 +--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 4e3cf4c264..37c3967fa9 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -158,6 +158,7 @@ public class Client implements AutoCloseable { final ExecutorService dispatchingExecutorService; final TuneState tuneState; final AtomicBoolean closing = new AtomicBoolean(false); + final AtomicBoolean shuttingDownDispatching = new AtomicBoolean(false); final ChunkChecksum chunkChecksum; final MetricsCollector metricsCollector; final CompressionCodecFactory compressionCodecFactory; @@ -354,6 +355,7 @@ public void initChannel(SocketChannel ch) { () -> { if (dispatchingExecutorServiceFactory == null) { List outstandingTasks = this.dispatchingExecutorService.shutdownNow(); + this.shuttingDownDispatching.set(true); for (Runnable outstandingTask : outstandingTasks) { try { outstandingTask.run(); @@ -2778,7 +2780,9 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) { } } else { FrameHandler frameHandler = ServerFrameHandler.lookup(commandId, version, m); - task = new FrameHandlerTask(frameHandler, Client.this, frameSize, ctx, m, closing); + task = + new FrameHandlerTask( + frameHandler, Client.this, frameSize, ctx, m, shuttingDownDispatching); } if (task != null) { @@ -2854,7 +2858,7 @@ private static class FrameHandlerTask implements Runnable { private final int frameSize; private final ChannelHandlerContext ctx; private final ByteBuf message; - private final AtomicBoolean closing; + private final AtomicBoolean shouldRelease; private FrameHandlerTask( FrameHandler frameHandler, @@ -2862,18 +2866,18 @@ private FrameHandlerTask( int frameSize, ChannelHandlerContext ctx, ByteBuf message, - AtomicBoolean closing) { + AtomicBoolean shouldRelease) { this.frameHandler = frameHandler; this.client = client; this.frameSize = frameSize; this.ctx = ctx; this.message = message; - this.closing = closing; + this.shouldRelease = shouldRelease; } @Override public void run() { - if (this.closing.get()) { + if (this.shouldRelease.get()) { try { this.message.release(); } catch (Exception e) { diff --git a/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java b/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java index a783bd9a46..e4fc94f495 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java @@ -105,9 +105,7 @@ public byte[] handleChallenge( })); } catch (StreamException e) { // there can be a timeout because the connection gets closed before returning the error - assertThat(e.getMessage()) - .containsAnyOf( - String.valueOf(Constants.RESPONSE_CODE_SASL_ERROR), "Could not get response in"); + assertThat(e).hasMessageContaining(String.valueOf(Constants.RESPONSE_CODE_SASL_ERROR)); } } From 860d7f9dbe4e375f4de89b2a58097ea6ffdf4fa3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:11:49 +0000 Subject: [PATCH 154/449] Bump org.apache.commons:commons-compress from 1.26.2 to 1.27.0 Bumps org.apache.commons:commons-compress from 1.26.2 to 1.27.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-compress dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ace60ca129..3693f8ccd2 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.13.2 12.2.2 4.7.5 - 1.26.2 + 1.27.0 1.5.6-4 1.8.0 1.1.10.6 From 9423800bb0c0390647fedffb13d626bbbbdc5287 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 17:00:13 +0000 Subject: [PATCH 155/449] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.4 to 3.2.5 Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.4 to 3.2.5. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.4...maven-gpg-plugin-3.2.5) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3693f8ccd2..41990d1fdc 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 3.13.0 3.3.1 1.11 - 3.2.4 + 3.2.5 3.2.0 3.3.1 3.3.1 From a906b6fa63dc357b3e24b3cc4208518d7f6f0508 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:27:04 +0000 Subject: [PATCH 156/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.3.2 to 1.3.3. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.3.2...v1.3.3) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 41990d1fdc..946280c9ac 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.11.0 0.10.4 1.2.5 - 1.3.2 + 1.3.3 1.0.3 3.13.0 3.3.1 From 82fe83b2f2ead488a1754e5ff216159ad9562901 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:27:09 +0000 Subject: [PATCH 157/449] Bump io.micrometer:micrometer-core from 1.13.2 to 1.13.3 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.13.2 to 1.13.3. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.13.2...v1.13.3) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 41990d1fdc..534186c424 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.112.Final 0.34.1 4.2.26 - 1.13.2 + 1.13.3 12.2.2 4.7.5 1.27.0 From f62d8b986ed6aabe31514ad2258cf5d4f69ccc81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Aug 2024 13:22:34 +0000 Subject: [PATCH 158/449] Bump org.junit:junit-bom from 5.10.3 to 5.11.0 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.10.3 to 5.11.0. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.10.3...r5.11.0) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cef674aed9..a246a687af 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.5.6-4 1.8.0 1.1.10.6 - 5.10.3 + 5.11.0 3.26.3 5.12.0 5.21.0 From 977789b1462589e4c65945b2072d652a4c22aa70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 14 Aug 2024 15:34:44 +0200 Subject: [PATCH 159/449] Set release version to 0.17.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index 665892d35a..fea2df6ed9 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,5 +1,5 @@ -RELEASE_VERSION="0.17.0.RC1" -DEVELOPMENT_VERSION="0.17.0-SNAPSHOT" +RELEASE_VERSION="0.17.0" +DEVELOPMENT_VERSION="0.18.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 35a0726f8134c04f3e2742827c83253e6e59eb89 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Wed, 14 Aug 2024 13:41:53 +0000 Subject: [PATCH 160/449] [maven-release-plugin] prepare release v0.17.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a246a687af..477e970d55 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.17.0-SNAPSHOT + 0.17.0 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.17.0 From 83ead210a7c4dbb9e1edc5172f8e680781287642 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Wed, 14 Aug 2024 13:41:54 +0000 Subject: [PATCH 161/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 477e970d55..b0d8e14a5e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.17.0 + 0.18.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.17.0 + HEAD From 1641e9d1d456ba4db4d76dca4f6d04f2be7dffae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 14 Aug 2024 15:58:57 +0200 Subject: [PATCH 162/449] Set release version to 0.18.0.RC1 --- README.adoc | 2 +- release-versions.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.adoc b/README.adoc index bc0ad962b0..27f4b7df4f 100644 --- a/README.adoc +++ b/README.adoc @@ -115,7 +115,7 @@ Please launch the `./mvnw spotless:apply` command to format your changes before == Copyright and License -(c) 2020-2023, 2023 Broadcom. All Rights Reserved. +(c) 2020-2024, 2024 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. Double licensed under the MPL2.0 and ASL2. See link:LICENSE[LICENSE] for details. diff --git a/release-versions.txt b/release-versions.txt index fea2df6ed9..bec61b7554 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,5 +1,5 @@ -RELEASE_VERSION="0.17.0" -DEVELOPMENT_VERSION="0.18.0-SNAPSHOT" +RELEASE_VERSION="0.18.0.RC1" +DEVELOPMENT_VERSION="0.19.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 593df8fc004bd05b46ce22751720f7111a9885d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:52:46 +0000 Subject: [PATCH 163/449] Bump io.dropwizard.metrics:metrics-core from 4.2.26 to 4.2.27 Bumps [io.dropwizard.metrics:metrics-core](https://github.com/dropwizard/metrics) from 4.2.26 to 4.2.27. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.26...v4.2.27) --- updated-dependencies: - dependency-name: io.dropwizard.metrics:metrics-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b0d8e14a5e..4b9664055a 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 1.2.13 4.1.112.Final 0.34.1 - 4.2.26 + 4.2.27 1.13.3 12.2.2 4.7.5 From d7f57af9c2a19a176e64bdabf5a1198a7b42240d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 16:52:50 +0000 Subject: [PATCH 164/449] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.3.1 to 3.4.0 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.3.1 to 3.4.0. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.3.1...surefire-3.4.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b0d8e14a5e..3477b24fea 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ 1.3.3 1.0.3 3.13.0 - 3.3.1 + 3.4.0 1.11 3.2.5 3.2.0 From c0055732937981b151b58bc32b10258a21bb9328 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 16:35:28 +0000 Subject: [PATCH 165/449] Bump org.apache.commons:commons-compress from 1.27.0 to 1.27.1 Bumps org.apache.commons:commons-compress from 1.27.0 to 1.27.1. --- updated-dependencies: - dependency-name: org.apache.commons:commons-compress dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 80a6940c22..fc5a2054d4 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.13.3 12.2.2 4.7.5 - 1.27.0 + 1.27.1 1.5.6-4 1.8.0 1.1.10.6 From ffb591c42c7d9a1706638e4046a9228ecb73653f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:05:45 +0000 Subject: [PATCH 166/449] Bump org.asciidoctor:asciidoctorj from 2.5.13 to 3.0.0 Bumps [org.asciidoctor:asciidoctorj](https://github.com/asciidoctor/asciidoctorj) from 2.5.13 to 3.0.0. - [Release notes](https://github.com/asciidoctor/asciidoctorj/releases) - [Changelog](https://github.com/asciidoctor/asciidoctorj/blob/main/CHANGELOG.adoc) - [Commits](https://github.com/asciidoctor/asciidoctorj/compare/v2.5.13...v3.0.0) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj 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 fc5a2054d4..ed7d679602 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.4.2 3.4.0 3.0.0 - 2.5.13 + 3.0.0 2.3.1 3.2.0 1.37 From 3f668b6d5ac9fbb4ad38e1598c62b68cbfc8a4c2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:35:27 +0000 Subject: [PATCH 167/449] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.4.0 to 3.5.0 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.4.0 to 3.5.0. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.4.0...surefire-3.5.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fc5a2054d4..6f79c1123f 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ 1.3.3 1.0.3 3.13.0 - 3.4.0 + 3.5.0 1.11 3.2.5 3.2.0 From e5274a76670b219eeca4dbd2ad9184d57cbfcb0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 16:35:30 +0000 Subject: [PATCH 168/449] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.8.0 to 3.10.0 Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.8.0 to 3.10.0. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.8.0...maven-javadoc-plugin-3.10.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fc5a2054d4..1bef9aabf2 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 3.2.0 3.3.1 3.3.1 - 3.8.0 + 3.10.0 3.4.2 3.4.0 3.0.0 From 583f4da56509e87e564be49e97ea6999bb675a2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:38:42 +0000 Subject: [PATCH 169/449] Bump org.mockito:mockito-core from 5.12.0 to 5.13.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.12.0 to 5.13.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.12.0...v5.13.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fc5a2054d4..11bfcf9bea 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.1.10.6 5.11.0 3.26.3 - 5.12.0 + 5.13.0 5.21.0 3.16.0 1.17.1 From bd6f15a2aac173c519fed4f97610c8f65941cee6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:25:20 +0000 Subject: [PATCH 170/449] Bump com.github.luben:zstd-jni from 1.5.6-4 to 1.5.6-5 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.6-4 to 1.5.6-5. - [Commits](https://github.com/luben/zstd-jni/compare/v1.5.6-4...v1.5.6-5) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 11bfcf9bea..c0266b6850 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 12.2.2 4.7.5 1.27.1 - 1.5.6-4 + 1.5.6-5 1.8.0 1.1.10.6 5.11.0 From 9519744438fdf8cb24d17e3eb68cbec9f14baaf7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:14:08 +0000 Subject: [PATCH 171/449] Bump org.apache.commons:commons-lang3 from 3.16.0 to 3.17.0 Bumps org.apache.commons:commons-lang3 from 3.16.0 to 3.17.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-lang3 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c0266b6850..081a24bd7a 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 3.26.3 5.13.0 5.21.0 - 3.16.0 + 3.17.0 1.17.1 2.11.0 0.10.4 From 8ea96c4d561dbc8a26e5f1ef5aa1914f45047177 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Sep 2024 16:38:08 +0000 Subject: [PATCH 172/449] Bump org.codehaus.mojo:buildnumber-maven-plugin from 3.2.0 to 3.2.1 Bumps [org.codehaus.mojo:buildnumber-maven-plugin](https://github.com/mojohaus/buildnumber-maven-plugin) from 3.2.0 to 3.2.1. - [Release notes](https://github.com/mojohaus/buildnumber-maven-plugin/releases) - [Commits](https://github.com/mojohaus/buildnumber-maven-plugin/compare/3.2.0...3.2.1) --- updated-dependencies: - dependency-name: org.codehaus.mojo:buildnumber-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f0fa9c69d3..de9820dd1f 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ 3.5.0 1.11 3.2.5 - 3.2.0 + 3.2.1 3.3.1 3.3.1 3.10.0 From 1a350b112b5cd7048b3c290350600ed18acdc9c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:13:21 +0000 Subject: [PATCH 173/449] Bump netty.version from 4.1.112.Final to 4.1.113.Final Bumps `netty.version` from 4.1.112.Final to 4.1.113.Final. Updates `io.netty:netty-transport` from 4.1.112.Final to 4.1.113.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.112.Final...netty-4.1.113.Final) Updates `io.netty:netty-codec` from 4.1.112.Final to 4.1.113.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.112.Final...netty-4.1.113.Final) Updates `io.netty:netty-handler` from 4.1.112.Final to 4.1.113.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.112.Final...netty-4.1.113.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.112.Final to 4.1.113.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.112.Final...netty-4.1.113.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index de9820dd1f..e7e66cd45f 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.112.Final + 4.1.113.Final 0.34.1 4.2.27 1.13.3 From 5b6a69700686b606c06484398e04f84b4623cc97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:13:25 +0000 Subject: [PATCH 174/449] Bump org.codehaus.mojo:buildnumber-maven-plugin from 3.2.0 to 3.2.1 Bumps [org.codehaus.mojo:buildnumber-maven-plugin](https://github.com/mojohaus/buildnumber-maven-plugin) from 3.2.0 to 3.2.1. - [Release notes](https://github.com/mojohaus/buildnumber-maven-plugin/releases) - [Commits](https://github.com/mojohaus/buildnumber-maven-plugin/compare/3.2.0...3.2.1) --- updated-dependencies: - dependency-name: org.codehaus.mojo:buildnumber-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index de9820dd1f..3c48b3f1ed 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.0.0 3.0.0 2.3.1 - 3.2.0 + 3.2.1 1.37 2.43.0 1.23.0 From 1f87b706739c914759b5c0d879909a811560a499 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:40:50 +0000 Subject: [PATCH 175/449] Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.6.2 to 4.8.6.3 Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.8.6.2 to 4.8.6.3. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.8.6.2...spotbugs-maven-plugin-4.8.6.3) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 355917b254..de884ad0ac 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ 2.43.0 1.23.0 0.8.12 - 4.8.6.2 + 4.8.6.3 4.8.6 3.13 From 0ed56bb341e2350429decc6e95dda9278a636295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 9 Sep 2024 11:18:39 +0200 Subject: [PATCH 176/449] Make package-protected class final --- src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java b/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java index 0d154a9c3a..21bd43c06a 100644 --- a/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java +++ b/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java @@ -72,7 +72,7 @@ static BackOffDelayPolicy fixedWithInitialDelay( */ Duration delay(int recoveryAttempt); - class FixedWithInitialDelayBackOffPolicy implements BackOffDelayPolicy { + final class FixedWithInitialDelayBackOffPolicy implements BackOffDelayPolicy { private final Duration initialDelay; private final Duration delay; From fc388d25c51e0e05aded0528905185e873f8e90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 9 Sep 2024 11:19:10 +0200 Subject: [PATCH 177/449] Interrupt thread instead of checking status --- src/main/java/com/rabbitmq/stream/impl/Utils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index 4a861cbba3..43cddc1f1e 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -255,7 +255,7 @@ static T callAndMaybeRetry( try { Thread.sleep(delay.toMillis()); } catch (InterruptedException ex) { - Thread.interrupted(); + Thread.currentThread().interrupt(); lastException = ex; keepTrying = false; } From cefe3346b991085e590c36b1b6f81f3bbd66084a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 9 Sep 2024 11:31:02 +0200 Subject: [PATCH 178/449] Add anonymous SASL mechanism --- .../stream/sasl/AnonymousSaslMechanism.java | 33 +++++++++++++++++++ .../stream/sasl/DefaultSaslConfiguration.java | 3 ++ .../stream/impl/AuthenticationTest.java | 8 +++++ .../com/rabbitmq/stream/impl/TestUtils.java | 3 +- 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/rabbitmq/stream/sasl/AnonymousSaslMechanism.java diff --git a/src/main/java/com/rabbitmq/stream/sasl/AnonymousSaslMechanism.java b/src/main/java/com/rabbitmq/stream/sasl/AnonymousSaslMechanism.java new file mode 100644 index 0000000000..a3ca7f82f1 --- /dev/null +++ b/src/main/java/com/rabbitmq/stream/sasl/AnonymousSaslMechanism.java @@ -0,0 +1,33 @@ +// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.sasl; + +import java.nio.charset.StandardCharsets; + +/** The ANONYMOUS {@link SaslMechanism}. */ +public final class AnonymousSaslMechanism implements SaslMechanism { + + public static final SaslMechanism INSTANCE = new AnonymousSaslMechanism(); + + @Override + public String getName() { + return "ANONYMOUS"; + } + + @Override + public byte[] handleChallenge(byte[] challenge, CredentialsProvider credentialsProvider) { + return "".getBytes(StandardCharsets.UTF_8); + } +} diff --git a/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java b/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java index bdc38317a2..81b8793a31 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java +++ b/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java @@ -28,6 +28,8 @@ public final class DefaultSaslConfiguration implements SaslConfiguration { new DefaultSaslConfiguration(PlainSaslMechanism.INSTANCE.getName()); public static final SaslConfiguration EXTERNAL = new DefaultSaslConfiguration(ExternalSaslMechanism.INSTANCE.getName()); + public static final SaslConfiguration ANONYMOUS = + new DefaultSaslConfiguration(AnonymousSaslMechanism.INSTANCE.getName()); private final Map mechanisms = Collections.unmodifiableMap( @@ -35,6 +37,7 @@ public final class DefaultSaslConfiguration implements SaslConfiguration { { put(PlainSaslMechanism.INSTANCE.getName(), PlainSaslMechanism.INSTANCE); put(ExternalSaslMechanism.INSTANCE.getName(), ExternalSaslMechanism.INSTANCE); + put(AnonymousSaslMechanism.INSTANCE.getName(), AnonymousSaslMechanism.INSTANCE); } }); private final String mechanism; diff --git a/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java b/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java index e4fc94f495..a5950b2919 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java @@ -147,6 +147,14 @@ void updateSecret() throws Exception { } } + @Test + @TestUtils.BrokerVersionAtLeast(TestUtils.BrokerVersion.RABBITMQ_4_0_0) + void anonymousAuthenticationShouldWork() { + try (Client ignored = + cf.get( + new Client.ClientParameters().saslConfiguration(DefaultSaslConfiguration.ANONYMOUS))) {} + } + private static CredentialsProvider credentialsProvider(String username, String password) { return new DefaultUsernamePasswordCredentialsProvider(username, password); } diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index 205222f5ff..56e862d7ec 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -1034,7 +1034,8 @@ public enum BrokerVersion { RABBITMQ_3_11_9("3.11.9"), RABBITMQ_3_11_11("3.11.11"), RABBITMQ_3_11_14("3.11.14"), - RABBITMQ_3_13_0("3.13.0"); + RABBITMQ_3_13_0("3.13.0"), + RABBITMQ_4_0_0("4.0.0"); final String value; From 44bda712179b46137a30a4dd36b21a869ff7ac74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 9 Sep 2024 11:55:15 +0200 Subject: [PATCH 179/449] Fix SASL test --- .../com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java b/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java index 49acf86d90..8a93928420 100644 --- a/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java +++ b/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java @@ -58,6 +58,6 @@ void getSaslMechanismShouldThrowExceptionIfNoMechanismSpecifiedAndNoMatch() { assertThatThrownBy(() -> configuration.getSaslMechanism(asList("FOO", "BAR"))) .isInstanceOf(IllegalStateException.class) .hasMessage( - "Unable to agree on a SASL mechanism. Client: PLAIN, EXTERNAL / server FOO, BAR."); + "Unable to agree on a SASL mechanism. Client: PLAIN, ANONYMOUS, EXTERNAL / server FOO, BAR."); } } From 89bbeceda6b36ece7a44659cff42ac30f6ba022d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 9 Sep 2024 12:19:43 +0200 Subject: [PATCH 180/449] Add anonymous SASL mechanism to broker configuration It is supposed to be activated. --- ci/start-broker.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/start-broker.sh b/ci/start-broker.sh index e41d0db43a..58ea78c1e0 100755 --- a/ci/start-broker.sh +++ b/ci/start-broker.sh @@ -33,7 +33,8 @@ ssl_options.fail_if_no_peer_cert = false ssl_options.depth = 1 auth_mechanisms.1 = PLAIN -auth_mechanisms.2 = EXTERNAL +auth_mechanisms.2 = ANONYMOUS +auth_mechanisms.3 = EXTERNAL stream.listeners.ssl.1 = 5551" >> rabbitmq-configuration/rabbitmq.conf From 2d92e84eb87094277af40a5e4aedc7b33af1b0fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:23:50 +0000 Subject: [PATCH 181/449] Bump io.micrometer:micrometer-docs-generator from 1.0.3 to 1.0.4 Bumps [io.micrometer:micrometer-docs-generator](https://github.com/micrometer-metrics/micrometer-docs-generator) from 1.0.3 to 1.0.4. - [Release notes](https://github.com/micrometer-metrics/micrometer-docs-generator/releases) - [Commits](https://github.com/micrometer-metrics/micrometer-docs-generator/compare/v1.0.3...v1.0.4) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-docs-generator dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index de884ad0ac..7edfd59e7e 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 0.10.4 1.2.5 1.3.3 - 1.0.3 + 1.0.4 3.13.0 3.5.0 1.11 From 3f2be93462ddd36961efa38f85ecdc8cab63cc1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:23:57 +0000 Subject: [PATCH 182/449] Bump io.micrometer:micrometer-core from 1.13.3 to 1.13.4 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.13.3 to 1.13.4. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.13.3...v1.13.4) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index de884ad0ac..882c489c1b 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.113.Final 0.34.1 4.2.27 - 1.13.3 + 1.13.4 12.2.2 4.7.5 1.27.1 From 742f4d3639131214f42376bbd776f2599e276a45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 16:30:09 +0000 Subject: [PATCH 183/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.3.3 to 1.3.4. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.3.3...v1.3.4) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d3005e29fd..25573c4531 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.11.0 0.10.4 1.2.5 - 1.3.3 + 1.3.4 1.0.4 3.13.0 3.5.0 From a9d39bdedd833e203370b16419b1caa60f8d37af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:14:59 +0000 Subject: [PATCH 184/449] Bump org.xerial.snappy:snappy-java from 1.1.10.6 to 1.1.10.7 Bumps [org.xerial.snappy:snappy-java](https://github.com/xerial/snappy-java) from 1.1.10.6 to 1.1.10.7. - [Release notes](https://github.com/xerial/snappy-java/releases) - [Commits](https://github.com/xerial/snappy-java/compare/v1.1.10.6...v1.1.10.7) --- updated-dependencies: - dependency-name: org.xerial.snappy:snappy-java dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 25573c4531..4f3be64c9b 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 1.27.1 1.5.6-5 1.8.0 - 1.1.10.6 + 1.1.10.7 5.11.0 3.26.3 5.13.0 From aeb16eca2666903b4eae3dde78e998913281ab8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 12 Sep 2024 16:05:30 +0200 Subject: [PATCH 185/449] Fix Javadoc output directory --- ci/publish-documentation-to-github-pages.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/publish-documentation-to-github-pages.sh b/ci/publish-documentation-to-github-pages.sh index 2afdfbed03..6f2e0a1aa5 100755 --- a/ci/publish-documentation-to-github-pages.sh +++ b/ci/publish-documentation-to-github-pages.sh @@ -24,7 +24,7 @@ git checkout gh-pages mkdir -p $RELEASE_VERSION/htmlsingle cp target/generated-docs/index.html $RELEASE_VERSION/htmlsingle mkdir -p $RELEASE_VERSION/api -cp -r target/site/apidocs/* $RELEASE_VERSION/api/ +cp -r target/reports/apidocs/* $RELEASE_VERSION/api/ git add $RELEASE_VERSION/ if [[ $LATEST == "true" ]] @@ -42,11 +42,11 @@ if [[ $LATEST == "true" ]] mkdir -p $DOC_DIR/htmlsingle cp target/generated-docs/index.html $DOC_DIR/htmlsingle mkdir -p $DOC_DIR/api - cp -r target/site/apidocs/* $DOC_DIR/api/ + cp -r target/reports/apidocs/* $DOC_DIR/api/ git add $DOC_DIR/ fi git commit -m "$MESSAGE" git push origin gh-pages -git checkout main \ No newline at end of file +git checkout main From 6357dd8ff165ae9f09b639ffa19089b491cbcae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 12 Sep 2024 16:05:36 +0200 Subject: [PATCH 186/449] Add Javadoc for method --- src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java index d8feb03670..57fe269ea5 100644 --- a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java @@ -240,6 +240,12 @@ public interface EnvironmentBuilder { */ EnvironmentBuilder metricsCollector(MetricsCollector metricsCollector); + /** + * Set up an {@link ObservationCollector}. + * + * @param observationCollector + * @return this builder instance + */ EnvironmentBuilder observationCollector(ObservationCollector observationCollector); /** From ae85fd272c92da6243b134fae42012430080d69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 16 Sep 2024 17:29:37 +0200 Subject: [PATCH 187/449] Bump Maven to 3.9.9 --- .mvn/wrapper/maven-wrapper.properties | 2 +- src/main/java/com/rabbitmq/stream/Producer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 346d645fd0..1a60da7935 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -14,5 +14,5 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar diff --git a/src/main/java/com/rabbitmq/stream/Producer.java b/src/main/java/com/rabbitmq/stream/Producer.java index 525181473d..11f45853b2 100644 --- a/src/main/java/com/rabbitmq/stream/Producer.java +++ b/src/main/java/com/rabbitmq/stream/Producer.java @@ -15,7 +15,7 @@ package com.rabbitmq.stream; /** - * API to send message to a RabbitMQ Stream. + * API to send messages to a RabbitMQ Stream. * *

Instances are created and configured with a {@link ProducerBuilder}. * From 7c01776366fe4c2dfb70e36016f1f8f4e60088a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:39:26 +0000 Subject: [PATCH 188/449] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.5 to 3.2.6 Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.5 to 3.2.6. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.5...maven-gpg-plugin-3.2.6) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4f3be64c9b..fd3aeb857f 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 3.13.0 3.5.0 1.11 - 3.2.5 + 3.2.6 3.2.1 3.3.1 3.3.1 From e493d15a49bbed93abda1e719cc6977dc30aecea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:39:30 +0000 Subject: [PATCH 189/449] Bump com.rabbitmq:amqp-client from 5.21.0 to 5.22.0 Bumps [com.rabbitmq:amqp-client](https://github.com/rabbitmq/rabbitmq-java-client) from 5.21.0 to 5.22.0. - [Release notes](https://github.com/rabbitmq/rabbitmq-java-client/releases) - [Commits](https://github.com/rabbitmq/rabbitmq-java-client/compare/v5.21.0...v5.22.0) --- updated-dependencies: - dependency-name: com.rabbitmq:amqp-client dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4f3be64c9b..78f40e48f3 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 5.11.0 3.26.3 5.13.0 - 5.21.0 + 5.22.0 3.17.0 1.17.1 2.11.0 From fad1631a1a060f1884ac248851c0185e51d6ae4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 18 Sep 2024 16:01:14 +0200 Subject: [PATCH 190/449] Reword documentation sections --- src/docs/asciidoc/overview.adoc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/docs/asciidoc/overview.adoc b/src/docs/asciidoc/overview.adoc index 22cea6b4e3..3077bda287 100644 --- a/src/docs/asciidoc/overview.adoc +++ b/src/docs/asciidoc/overview.adoc @@ -91,12 +91,19 @@ The next section provides more details about the evolution of programming interf [[stability-of-programming-interfaces]] == Stability of Programming Interfaces -The RabbitMQ Stream Java Client is in active development but its programming interfaces will remain as stable as possible. There is no guarantee though that they will remain completely stable, at least until it reaches version 1.0.0. +The RabbitMQ Stream Java Client is in active development but its programming interfaces will remain as stable as possible. +There is no guarantee though that they will remain completely stable, at least until it reaches version 1.0.0. The client contains 2 sets of programming interfaces whose stability are of interest for application developers: -* Application Programming Interfaces (API): those are the ones used to write application logic. They include the interfaces and classes in the `com.rabbitmq.stream` package (e.g. `Producer`, `Consumer`, `Message`). These API constitute the main programming model of the client and will be kept as stable as possible. -* Service Provider Interfaces (SPI): those are interfaces to implement mainly technical behavior in the client. They are not meant to be used to implement application logic. Application developers may have to refer to them in the configuration phase and if they want to custom some internal behavior in the client. SPI include interfaces and classes in the `com.rabbitmq.stream.codec`, `com.rabbitmq.stream.compression`, `com.rabbitmq.stream.metrics` packages, among others. _These SPI are susceptible to change, but this should not impact the majority of applications_, as the changes would typically stay intern to the client. +* Application Programming Interfaces (API): those are the ones used to write application logic. +They include the interfaces and classes in the `com.rabbitmq.stream` package (e.g. `Producer`, `Consumer`, `Message`). +These API constitute the main programming model of the client and will be kept as stable as possible. +* Service Provider Interfaces (SPI): those are interfaces to implement mainly technical behavior in the client. +They are not meant to be used to implement application logic. +Application developers may have to refer to them in the configuration phase and if they want to customize some internal behavior of the client. +SPI include interfaces and classes in the `com.rabbitmq.stream.codec`, `com.rabbitmq.stream.compression`, `com.rabbitmq.stream.metrics` packages, among others. +_These SPI are susceptible to change, but this should have no impact on most applications_, as the changes are likely to be limited to the client internals. == Pre-requisites From 3203173bf395ce81658d32348b3298b3c9d4286c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 19 Sep 2024 10:17:25 +0200 Subject: [PATCH 191/449] Test against latest broker alphas (4.0 and main) --- .github/workflows/test-rabbitmq-alphas.yml | 2 +- ci/start-broker.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index aa841842bc..b9f6ed2d37 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v3.13.x', 'pivotalrabbitmq/rabbitmq:v4.0.x' ] + rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v4.0.x', 'pivotalrabbitmq/rabbitmq:main' ] name: Test against ${{ matrix.rabbitmq-image }} steps: - uses: actions/checkout@v4 diff --git a/ci/start-broker.sh b/ci/start-broker.sh index 58ea78c1e0..d2887c4f81 100755 --- a/ci/start-broker.sh +++ b/ci/start-broker.sh @@ -2,7 +2,7 @@ LOCAL_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:3.13} +RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:4.0} wait_for_message() { while ! docker logs "$1" | grep -q "$2"; From 9a2350bf9b8db86bd39d00fce0eefd2dfd363533 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 19 Sep 2024 10:18:27 +0200 Subject: [PATCH 192/449] Use Ubuntu 24.04 in GHA --- .github/workflows/publish-documentation.yml | 2 +- .github/workflows/publish-snapshot.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/sanity-check.yml | 2 +- .github/workflows/test-native-image.yml | 2 +- .github/workflows/test-pr.yml | 2 +- .github/workflows/test-rabbitmq-alphas.yml | 2 +- .github/workflows/test-supported-java-versions.yml | 2 +- .github/workflows/test.yml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-documentation.yml b/.github/workflows/publish-documentation.yml index abdd6b93fe..be6deef8de 100644 --- a/.github/workflows/publish-documentation.yml +++ b/.github/workflows/publish-documentation.yml @@ -4,7 +4,7 @@ on: workflow_dispatch jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index b864cc19bb..d5bb53d130 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -4,7 +4,7 @@ on: workflow_dispatch jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bdb5643a22..0056e9487b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 8b7a82c205..3e56579e7b 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -11,7 +11,7 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-native-image.yml b/.github/workflows/test-native-image.yml index cb813266af..0b5dcc9dc8 100644 --- a/.github/workflows/test-native-image.yml +++ b/.github/workflows/test-native-image.yml @@ -7,7 +7,7 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 4c6ae773f5..9db8818e21 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -7,7 +7,7 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index b9f6ed2d37..4409947e27 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -10,7 +10,7 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v4.0.x', 'pivotalrabbitmq/rabbitmq:main' ] diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index a9649e2b29..d3a8fc3e45 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -7,7 +7,7 @@ on: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: matrix: distribution: [ 'temurin' ] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40cd261878..be49d52ae3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,7 +11,7 @@ env: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 From 9413d654654ae5d110833a23262982f40134a640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 19 Sep 2024 10:35:56 +0200 Subject: [PATCH 193/449] Change workflow title --- .github/workflows/test-pr.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 9db8818e21..0af64477fa 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -1,4 +1,4 @@ -name: Test against RabbitMQ 3.13 stable (PR) +name: Test against RabbitMQ stable (PR) on: pull_request: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index be49d52ae3..7081a78ee5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test against RabbitMQ 3.13 stable +name: Test against RabbitMQ stable on: push: From 5de0911bea196e1f59769636b09e8a8d49fc9840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 19 Sep 2024 11:34:39 +0200 Subject: [PATCH 194/449] Test against Java 23 --- .github/workflows/test-supported-java-versions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index d3a8fc3e45..b18b185caa 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: distribution: [ 'temurin' ] - version: [ '8', '11', '17', '21', '22', '23-ea' ] + version: [ '8', '11', '17', '21', '22', '23' ] include: - distribution: 'semeru' version: '17' From d9d071dd4e1bfbc37e8753e99eb9bb749ef25de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 19 Sep 2024 11:34:52 +0200 Subject: [PATCH 195/449] Use RabbitMQ 4.0 in documentation --- README.adoc | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 27f4b7df4f..8f9daef7d6 100644 --- a/README.adoc +++ b/README.adoc @@ -81,7 +81,7 @@ Launch the broker: ---- docker run -it --rm --name rabbitmq -p 5552:5552 -p 5672:5672 \ -e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS='-rabbitmq_stream advertised_host localhost' \ - rabbitmq:3.13 + rabbitmq:4.0 ---- Enable the stream plugin: diff --git a/pom.xml b/pom.xml index 5dffc2821b..087d105de0 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ 4.8.6.3 4.8.6 - 3.13 + 4.0 6026DFCA yyyy-MM-dd'T'HH:mm:ss'Z' From bd3cec61e0da48367c89d234475ad48066605db0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 19 Sep 2024 15:46:09 +0200 Subject: [PATCH 196/449] Test against Java 24 ea --- .github/workflows/test-supported-java-versions.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index b18b185caa..e15d141b81 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: distribution: [ 'temurin' ] - version: [ '8', '11', '17', '21', '22', '23' ] + version: [ '8', '11', '17', '21', '22', '23', '24-ea' ] include: - distribution: 'semeru' version: '17' @@ -39,6 +39,6 @@ jobs: -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem \ - -Dnet.bytebuddy.experimental=true -Djacoco.skip=true + -Dnet.bytebuddy.experimental=true -Djacoco.skip=true -Dspotbugs.skip=true - name: Stop broker run: docker stop rabbitmq && docker rm rabbitmq From 16ffff663c4f71d83565c543dce2007e9b6bcb52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 23 Sep 2024 17:19:50 +0200 Subject: [PATCH 197/449] Notify SAC when it is no longer active A single active consumer may not always receive a notification from the broker when it gets inactive. An obvious reason is the consumer connection goes down. It is still possible to call the consumer update listener from the library, which can help applications take an appropriate action when a consumer goes from active to inactive. This commit implements the call to the listener under such circumstances (connection closed, stream unavailable because restarted, normal consumer closing). --- .../java/com/rabbitmq/stream/impl/Client.java | 11 +- .../rabbitmq/stream/impl/StreamConsumer.java | 23 ++++ .../stream/impl/SuperStreamConsumer.java | 4 + src/test/java/com/rabbitmq/stream/Host.java | 77 ++++++++---- .../com/rabbitmq/stream/impl/Assertions.java | 62 ++++++++++ .../stream/impl/SacStreamConsumerTest.java | 80 ++++++++++++- .../impl/SacSuperStreamConsumerTest.java | 111 ++++++++++++++++-- .../com/rabbitmq/stream/impl/TestUtils.java | 58 ++++++++- 8 files changed, 374 insertions(+), 52 deletions(-) create mode 100644 src/test/java/com/rabbitmq/stream/impl/Assertions.java diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 37c3967fa9..bb8b5bc635 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -303,12 +303,7 @@ public void initChannel(SocketChannel ch) { }); ChannelFuture f; - String clientConnectionName = - parameters.clientProperties == null - ? "" - : (parameters.clientProperties.containsKey("connection_name") - ? parameters.clientProperties.get("connection_name") - : ""); + String clientConnectionName = parameters.clientProperties.getOrDefault("connection_name", ""); try { LOGGER.debug( "Trying to create stream connection to {}:{}, with client connection name '{}'", @@ -1505,6 +1500,10 @@ String connectionName() { return builder.append(serverAddress()).toString(); } + String clientConnectionName() { + return this.clientConnectionName; + } + private String serverAddress() { SocketAddress remoteAddress = remoteAddress(); if (remoteAddress instanceof InetSocketAddress) { diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java index d252c777a5..b62dad93d6 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java @@ -481,6 +481,7 @@ public void close() { } void closeFromEnvironment() { + this.maybeNotifyActiveToInactiveSac(); LOGGER.debug("Calling consumer {} closing callback (stream {})", this.id, this.stream); this.closingCallback.run(); closed.set(true); @@ -490,6 +491,7 @@ void closeFromEnvironment() { void closeAfterStreamDeletion() { if (closed.compareAndSet(false, true)) { + this.maybeNotifyActiveToInactiveSac(); this.environment.removeConsumer(this); this.status = Status.CLOSED; } @@ -506,11 +508,23 @@ void setTrackingClient(Client client) { void setSubscriptionClient(Client client) { this.subscriptionClient = client; if (client == null && this.isSac()) { + maybeNotifyActiveToInactiveSac(); // we lost the connection this.sacActive = false; } } + private void maybeNotifyActiveToInactiveSac() { + if (this.isSac() && this.sacActive) { + LOGGER.debug( + "Single active consumer {} from stream {} with name {} is unavailable, calling consumer update listener", + this.id, + this.stream, + this.name); + this.consumerUpdate(false); + } + } + synchronized void unavailable() { this.status = Status.NOT_AVAILABLE; this.trackingClient = null; @@ -623,4 +637,13 @@ private void checkNotClosed() { long id() { return this.id; } + + String subscriptionConnectionName() { + Client client = this.subscriptionClient; + if (client == null) { + return ""; + } else { + return client.clientConnectionName(); + } + } } diff --git a/src/main/java/com/rabbitmq/stream/impl/SuperStreamConsumer.java b/src/main/java/com/rabbitmq/stream/impl/SuperStreamConsumer.java index ce417b6b91..dac6a2e9eb 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SuperStreamConsumer.java +++ b/src/main/java/com/rabbitmq/stream/impl/SuperStreamConsumer.java @@ -187,6 +187,10 @@ public void store(long offset) { "Consumer#store(long) does not work for super streams, use MessageHandler.Context#storeOffset() instead"); } + Consumer consumer(String partition) { + return this.consumers.get(partition); + } + @Override public long storedOffset() { throw new UnsupportedOperationException( diff --git a/src/test/java/com/rabbitmq/stream/Host.java b/src/test/java/com/rabbitmq/stream/Host.java index 28b63de828..f1267075ed 100644 --- a/src/test/java/com/rabbitmq/stream/Host.java +++ b/src/test/java/com/rabbitmq/stream/Host.java @@ -47,30 +47,34 @@ public static String capture(InputStream is) throws IOException { return buff.toString(); } - private static Process executeCommand(String command) throws IOException { + private static Process executeCommand(String command) { return executeCommand(command, false); } - private static Process executeCommand(String command, boolean ignoreError) throws IOException { - Process pr = executeCommandProcess(command); - - int ev = waitForExitValue(pr); - if (ev != 0 && !ignoreError) { - String stdout = capture(pr.getInputStream()); - String stderr = capture(pr.getErrorStream()); - throw new IOException( - "unexpected command exit value: " - + ev - + "\ncommand: " - + command - + "\n" - + "\nstdout:\n" - + stdout - + "\nstderr:\n" - + stderr - + "\n"); + private static Process executeCommand(String command, boolean ignoreError) { + try { + Process pr = executeCommandProcess(command); + + int ev = waitForExitValue(pr); + if (ev != 0 && !ignoreError) { + String stdout = capture(pr.getInputStream()); + String stderr = capture(pr.getErrorStream()); + throw new IOException( + "unexpected command exit value: " + + ev + + "\ncommand: " + + command + + "\n" + + "\nstdout:\n" + + stdout + + "\nstderr:\n" + + stderr + + "\n"); + } + return pr; + } catch (IOException e) { + throw new RuntimeException(e); } - return pr; } public static String hostname() throws IOException { @@ -110,6 +114,10 @@ public static Process rabbitmqctl(String command) throws IOException { return executeCommand(rabbitmqctlCommand() + " " + command); } + static Process rabbitmqStreams(String command) { + return executeCommand(rabbitmqStreamsCommand() + " " + command); + } + public static Process rabbitmqctlIgnoreError(String command) throws IOException { return executeCommand(rabbitmqctlCommand() + " " + command, true); } @@ -189,11 +197,19 @@ static List toConnectionInfoList(String json) { return GSON.fromJson(json, new TypeToken>() {}.getType()); } - public static Process killStreamLeaderProcess(String stream) throws IOException { - return rabbitmqctl( - "eval 'case rabbit_stream_manager:lookup_leader(<<\"/\">>, <<\"" - + stream - + "\">>) of {ok, Pid} -> exit(Pid, kill); Pid -> exit(Pid, kill) end.'"); + public static void restartStream(String stream) { + rabbitmqStreams(" restart_stream " + stream); + } + + public static Process killStreamLeaderProcess(String stream) { + try { + return rabbitmqctl( + "eval 'case rabbit_stream_manager:lookup_leader(<<\"/\">>, <<\"" + + stream + + "\">>) of {ok, Pid} -> exit(Pid, kill); Pid -> exit(Pid, kill) end.'"); + } catch (IOException e) { + throw new RuntimeException(e); + } } public static void addUser(String username, String password) throws IOException { @@ -243,7 +259,7 @@ public static void setEnv(String parameter, String value) throws IOException { public static String rabbitmqctlCommand() { String rabbitmqCtl = System.getProperty("rabbitmqctl.bin"); if (rabbitmqCtl == null) { - throw new IllegalStateException("Please define the rabbitmqctl.bin system property"); + rabbitmqCtl = DOCKER_PREFIX + "rabbitmq"; } if (rabbitmqCtl.startsWith(DOCKER_PREFIX)) { String containerId = rabbitmqCtl.split(":")[1]; @@ -253,6 +269,15 @@ public static String rabbitmqctlCommand() { } } + private static String rabbitmqStreamsCommand() { + String rabbitmqctl = rabbitmqctlCommand(); + int lastIndex = rabbitmqctl.lastIndexOf("rabbitmqctl"); + if (lastIndex == -1) { + throw new IllegalArgumentException("Not a valid rabbitqmctl command: " + rabbitmqctl); + } + return rabbitmqctl.substring(0, lastIndex) + "rabbitmq-streams"; + } + public static AutoCloseable diskAlarm() throws Exception { return new CallableAutoCloseable( () -> { diff --git a/src/test/java/com/rabbitmq/stream/impl/Assertions.java b/src/test/java/com/rabbitmq/stream/impl/Assertions.java new file mode 100644 index 0000000000..b6f884d622 --- /dev/null +++ b/src/test/java/com/rabbitmq/stream/impl/Assertions.java @@ -0,0 +1,62 @@ +// Copyright (c) 2024 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.impl; + +import static org.assertj.core.api.Assertions.fail; + +import java.time.Duration; +import org.assertj.core.api.AbstractObjectAssert; + +final class Assertions { + + private Assertions() {} + + static SyncAssert assertThat(TestUtils.Sync sync) { + return new SyncAssert(sync); + } + + static class SyncAssert extends AbstractObjectAssert { + + private SyncAssert(TestUtils.Sync sync) { + super(sync, SyncAssert.class); + } + + SyncAssert completes() { + return this.completes(TestUtils.DEFAULT_CONDITION_TIMEOUT); + } + + SyncAssert completes(Duration timeout) { + boolean completed = actual.await(timeout); + if (!completed) { + fail("Sync timed out after %d ms", timeout.toMillis()); + } + return this; + } + + SyncAssert hasCompleted() { + if (!this.actual.hasCompleted()) { + fail("Sync should have completed but has not"); + } + return this; + } + + SyncAssert hasNotCompleted() { + if (this.actual.hasCompleted()) { + fail("Sync should have not completed"); + } + return this; + } + } +} diff --git a/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java index af108a9659..698cbc5ede 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java @@ -14,24 +14,24 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; -import static com.rabbitmq.stream.impl.TestUtils.publishAndWaitForConfirms; -import static com.rabbitmq.stream.impl.TestUtils.waitAtMost; +import static com.rabbitmq.stream.impl.Assertions.assertThat; +import static com.rabbitmq.stream.impl.TestUtils.*; import static org.assertj.core.api.Assertions.assertThat; -import com.rabbitmq.stream.Consumer; -import com.rabbitmq.stream.Environment; -import com.rabbitmq.stream.EnvironmentBuilder; -import com.rabbitmq.stream.OffsetSpecification; +import com.rabbitmq.stream.*; import com.rabbitmq.stream.impl.TestUtils.BrokerVersionAtLeast311Condition; import io.netty.channel.EventLoopGroup; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; +import java.util.stream.Stream; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; @ExtendWith({ TestUtils.StreamTestInfrastructureExtension.class, @@ -237,4 +237,72 @@ void externalTrackingSecondConsumerShouldTakeOverWhereTheFirstOneLeftOff() throw // nothing stored on the server side assertThat(cf.get().queryOffset(consumerName, stream).getOffset()).isZero(); } + + public static Stream> + activeConsumerShouldGetUpdateNotificationAfterDisruption() { + return Stream.of( + namedConsumer(consumer -> Host.killConnection(connectionName(consumer)), "kill connection"), + namedConsumer(consumer -> Host.restartStream(stream(consumer)), "restart stream"), + namedConsumer(Consumer::close, "close consumer")); + } + + @ParameterizedTest + @MethodSource + @TestUtils.DisabledIfRabbitMqCtlNotSet + void activeConsumerShouldGetUpdateNotificationAfterDisruption( + java.util.function.Consumer disruption) { + String consumerName = "foo"; + Sync consumer1Active = sync(); + Sync consumer1Inactive = sync(); + Consumer consumer1 = + environment.consumerBuilder().stream(stream) + .name(consumerName) + .noTrackingStrategy() + .singleActiveConsumer() + .consumerUpdateListener( + context -> { + if (context.isActive()) { + consumer1Active.down(); + } else { + consumer1Inactive.down(); + } + return OffsetSpecification.next(); + }) + .messageHandler((context, message) -> {}) + .build(); + + Sync consumer2Active = sync(); + Sync consumer2Inactive = sync(); + environment.consumerBuilder().stream(stream) + .name(consumerName) + .noTrackingStrategy() + .singleActiveConsumer() + .consumerUpdateListener( + context -> { + if (!context.isActive()) { + consumer2Inactive.down(); + } + return OffsetSpecification.next(); + }) + .messageHandler((context, message) -> {}) + .build(); + + assertThat(consumer1Active).completes(); + assertThat(consumer2Inactive).hasNotCompleted(); + assertThat(consumer1Inactive).hasNotCompleted(); + assertThat(consumer2Active).hasNotCompleted(); + + disruption.accept(consumer1); + + assertThat(consumer2Inactive).hasNotCompleted(); + assertThat(consumer1Inactive).completes(); + } + + private static String connectionName(Consumer consumer) { + return ((StreamConsumer) consumer).subscriptionConnectionName(); + } + + private static String stream(Consumer consumer) { + return ((StreamConsumer) consumer).stream(); + } } diff --git a/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java index afb8e86131..3180bbbea6 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java @@ -14,18 +14,12 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; -import static com.rabbitmq.stream.impl.TestUtils.declareSuperStreamTopology; -import static com.rabbitmq.stream.impl.TestUtils.deleteSuperStreamTopology; -import static com.rabbitmq.stream.impl.TestUtils.waitAtMost; +import static com.rabbitmq.stream.impl.Assertions.assertThat; +import static com.rabbitmq.stream.impl.TestUtils.*; import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; -import com.rabbitmq.stream.Consumer; -import com.rabbitmq.stream.ConsumerUpdateListener; -import com.rabbitmq.stream.Environment; -import com.rabbitmq.stream.EnvironmentBuilder; -import com.rabbitmq.stream.NoOffsetException; -import com.rabbitmq.stream.OffsetSpecification; +import com.rabbitmq.stream.*; import com.rabbitmq.stream.impl.TestUtils.BrokerVersionAtLeast311Condition; import com.rabbitmq.stream.impl.TestUtils.CallableBooleanSupplier; import com.rabbitmq.stream.impl.TestUtils.SingleActiveConsumer; @@ -39,11 +33,14 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.IntStream; +import java.util.stream.Stream; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; @ExtendWith({ TestUtils.StreamTestInfrastructureExtension.class, @@ -287,7 +284,8 @@ void sacAutoOffsetTrackingShouldStoreOnRelanbancing() throws Exception { && consumerStates.get("1" + partitions.get(2))); assertThat(consumerStates) - .containsEntry("0" + partitions.get(0), true) // not changed after closing + .containsEntry( + "0" + partitions.get(0), false) // client library notifies the listener on closing .containsEntry("0" + partitions.get(1), false) // not changed after closing .containsEntry("0" + partitions.get(2), false) // not changed after closing .containsEntry("1" + partitions.get(0), true) // now active @@ -314,12 +312,15 @@ void sacAutoOffsetTrackingShouldStoreOnRelanbancing() throws Exception { && consumerStates.get("2" + partitions.get(2))); assertThat(consumerStates) - .containsEntry("0" + partitions.get(0), true) // not changed after closing + .containsEntry( + "0" + partitions.get(0), false) // client library notifies the listener on closing .containsEntry("0" + partitions.get(1), false) // not changed after closing .containsEntry("0" + partitions.get(2), false) // not changed after closing - .containsEntry("1" + partitions.get(0), true) // not changed after closing + .containsEntry( + "1" + partitions.get(0), false) // client library notifies the listener on closing .containsEntry("1" + partitions.get(1), false) // not changed after closing - .containsEntry("1" + partitions.get(2), true) // not changed after closing + .containsEntry( + "1" + partitions.get(2), false) // client library notifies the listener on closing .containsEntry("2" + partitions.get(0), true) // now active .containsEntry("2" + partitions.get(1), true) // now active .containsEntry("2" + partitions.get(2), true); // now active @@ -809,6 +810,85 @@ void consumerGroupsOnSameSuperStreamShouldBeIndependent() { }); } + public static Stream> + activeConsumerShouldGetUpdateNotificationAfterDisruption() { + return Stream.of( + namedBiConsumer((s, c) -> Host.killConnection(connectionName(s, c)), "kill connection"), + namedBiConsumer((s, c) -> Host.restartStream(s), "restart stream"), + namedBiConsumer((s, c) -> c.close(), "close consumer")); + } + + @ParameterizedTest + @MethodSource + @TestUtils.DisabledIfRabbitMqCtlNotSet + void activeConsumerShouldGetUpdateNotificationAfterDisruption( + java.util.function.BiConsumer disruption) { + declareSuperStreamTopology(configurationClient, superStream, partitionCount); + String partition = superStream + "-0"; + + String consumerName = "foo"; + Function, ConsumerUpdateListener> + filteringListener = + action -> + (ConsumerUpdateListener) + context -> { + if (partition.equals(context.stream())) { + action.accept(context); + } + return OffsetSpecification.next(); + }; + + Sync consumer1Active = sync(); + Sync consumer1Inactive = sync(); + + Consumer consumer1 = + environment + .consumerBuilder() + .singleActiveConsumer() + .superStream(superStream) + .name(consumerName) + .noTrackingStrategy() + .consumerUpdateListener( + filteringListener.apply( + context -> { + if (context.isActive()) { + consumer1Active.down(); + } else { + consumer1Inactive.down(); + } + })) + .messageHandler((context, message) -> {}) + .build(); + + Sync consumer2Active = sync(); + Sync consumer2Inactive = sync(); + environment + .consumerBuilder() + .singleActiveConsumer() + .superStream(superStream) + .name(consumerName) + .noTrackingStrategy() + .consumerUpdateListener( + filteringListener.apply( + context -> { + if (!context.isActive()) { + consumer2Inactive.down(); + } + })) + .messageHandler((context, message) -> {}) + .build(); + + assertThat(consumer1Active).completes(); + assertThat(consumer2Inactive).hasNotCompleted(); + assertThat(consumer1Inactive).hasNotCompleted(); + assertThat(consumer2Active).hasNotCompleted(); + + disruption.accept(partition, consumer1); + + assertThat(consumer2Inactive).hasNotCompleted(); + assertThat(consumer1Inactive).completes(); + } + private static void waitUntil(CallableBooleanSupplier action) { try { waitAtMost(action); @@ -816,4 +896,9 @@ private static void waitUntil(CallableBooleanSupplier action) { throw new RuntimeException(e); } } + + private static String connectionName(String partition, Consumer consumer) { + return ((StreamConsumer) ((SuperStreamConsumer) consumer).consumer(partition)) + .subscriptionConnectionName(); + } } diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index 56e862d7ec..9ab50aadf7 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -83,7 +83,7 @@ public final class TestUtils { private static final Logger LOGGER = LoggerFactory.getLogger(TestUtils.class); - private static final Duration DEFAULT_CONDITION_TIMEOUT = Duration.ofSeconds(10); + static final Duration DEFAULT_CONDITION_TIMEOUT = Duration.ofSeconds(10); private static final ConnectionFactory AMQP_CF = new ConnectionFactory(); @@ -257,6 +257,20 @@ public String toString() { }; } + static BiConsumer namedBiConsumer(BiConsumer delegate, String description) { + return new BiConsumer() { + @Override + public void accept(T t, U s) { + delegate.accept(t, s); + } + + @Override + public String toString() { + return description; + } + }; + } + static Answer answer(Runnable task) { return invocationOnMock -> { task.run(); @@ -1103,4 +1117,46 @@ static void repeatIfFailure(RunnableWithException test) throws Exception { private static Connection connection() throws IOException, TimeoutException { return AMQP_CF.newConnection(); } + + static Sync sync() { + return sync(1); + } + + static Sync sync(int count) { + return new Sync(count); + } + + static class Sync { + + private final AtomicReference latch = new AtomicReference<>(); + + private Sync(int count) { + this.latch.set(new CountDownLatch(count)); + } + + void down() { + this.latch.get().countDown(); + } + + boolean await(Duration timeout) { + try { + return this.latch.get().await(timeout.toMillis(), TimeUnit.MILLISECONDS); + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); + throw new RuntimeException(ie); + } + } + + void reset(int count) { + this.latch.set(new CountDownLatch(count)); + } + + void reset() { + this.reset(1); + } + + boolean hasCompleted() { + return this.latch.get().getCount() == 0; + } + } } From ca8319a706a6fca2a0e4c1d2257f92dbc1be16d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:26:02 +0000 Subject: [PATCH 198/449] Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.6.3 to 4.8.6.4 Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.8.6.3 to 4.8.6.4. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.8.6.3...spotbugs-maven-plugin-4.8.6.4) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 087d105de0..c0555d8b08 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ 2.43.0 1.23.0 0.8.12 - 4.8.6.3 + 4.8.6.4 4.8.6 4.0 From 3e25a274345a0fb5c069987a9263bd37bf4da225 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:26:12 +0000 Subject: [PATCH 199/449] Bump com.github.luben:zstd-jni from 1.5.6-5 to 1.5.6-6 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.6-5 to 1.5.6-6. - [Commits](https://github.com/luben/zstd-jni/compare/v1.5.6-5...v1.5.6-6) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 087d105de0..67e958e1eb 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 12.2.2 4.7.5 1.27.1 - 1.5.6-5 + 1.5.6-6 1.8.0 1.1.10.7 5.11.0 From 2dd026caa8b7976e1a7ad24d0a41b4a46e0b7246 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 16:43:45 +0000 Subject: [PATCH 200/449] Bump org.junit:junit-bom from 5.11.0 to 5.11.1 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.11.0 to 5.11.1. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.11.0...r5.11.1) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ddd6c0bc03..7f1abf9629 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.5.6-6 1.8.0 1.1.10.7 - 5.11.0 + 5.11.1 3.26.3 5.13.0 5.22.0 From cfb76bb86794f7940937721bd76c1e02eb939d17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:31:50 +0000 Subject: [PATCH 201/449] Bump org.mockito:mockito-core from 5.13.0 to 5.14.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.13.0 to 5.14.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.13.0...v5.14.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7f1abf9629..9c35cf5003 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.1.10.7 5.11.1 3.26.3 - 5.13.0 + 5.14.0 5.22.0 3.17.0 1.17.1 From 78415ceea8990570760498276df386e11e8f106b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 16:31:57 +0000 Subject: [PATCH 202/449] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.6 to 3.2.7 Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.6 to 3.2.7. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.6...maven-gpg-plugin-3.2.7) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7f1abf9629..3e2eeda986 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 3.13.0 3.5.0 1.11 - 3.2.6 + 3.2.7 3.2.1 3.3.1 3.3.1 From 476c60b5016c65e41d82beed809757d38fea3879 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Sep 2024 16:57:16 +0000 Subject: [PATCH 203/449] Bump org.mockito:mockito-core from 5.14.0 to 5.14.1 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.14.0 to 5.14.1. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.14.0...v5.14.1) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3d3047cd47..4e66f3f5cb 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.1.10.7 5.11.1 3.26.3 - 5.14.0 + 5.14.1 5.22.0 3.17.0 1.17.1 From 38f9fa3182576e73db381611fd30218582d7058e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:11:49 +0000 Subject: [PATCH 204/449] Bump netty.version from 4.1.113.Final to 4.1.114.Final Bumps `netty.version` from 4.1.113.Final to 4.1.114.Final. Updates `io.netty:netty-transport` from 4.1.113.Final to 4.1.114.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.113.Final...netty-4.1.114.Final) Updates `io.netty:netty-codec` from 4.1.113.Final to 4.1.114.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.113.Final...netty-4.1.114.Final) Updates `io.netty:netty-handler` from 4.1.113.Final to 4.1.114.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.113.Final...netty-4.1.114.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.113.Final to 4.1.114.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.113.Final...netty-4.1.114.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4e66f3f5cb..62ca25be6a 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.113.Final + 4.1.114.Final 0.34.1 4.2.27 1.13.4 From ee66a44402cf300ce65c8b4d5e0c0b5485666e7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:11:56 +0000 Subject: [PATCH 205/449] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.10.0 to 3.10.1 Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.10.0 to 3.10.1. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.10.0...maven-javadoc-plugin-3.10.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4e66f3f5cb..2db6c7d3d3 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 3.2.1 3.3.1 3.3.1 - 3.10.0 + 3.10.1 3.4.2 3.4.0 3.0.0 From b541a112b89fcba86aae8811835e633fb11fcc2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 2 Oct 2024 16:05:13 +0200 Subject: [PATCH 206/449] Fix Javadoc --- src/main/java/com/rabbitmq/stream/SubscriptionListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/SubscriptionListener.java b/src/main/java/com/rabbitmq/stream/SubscriptionListener.java index 30d2f1ab15..e2a7ee8e26 100644 --- a/src/main/java/com/rabbitmq/stream/SubscriptionListener.java +++ b/src/main/java/com/rabbitmq/stream/SubscriptionListener.java @@ -29,7 +29,7 @@ public interface SubscriptionListener { * *

The method is called when a {@link Consumer} is created and it registers to the broker, and * also when the subscription must be re-created (after a disconnection or when the subscription - * must moved because the stream member it was connected to becomes unavailable). + * must move because the stream member it was connected to becomes unavailable). * *

Application code can set the {@link OffsetSpecification} that will be used with the {@link * SubscriptionContext#offsetSpecification(OffsetSpecification)} method. From 8b50c9850f140718c27e550b8c81c331e57d761f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 2 Oct 2024 16:06:11 +0200 Subject: [PATCH 207/449] Add Mockito as agent for Java 21+ --- pom.xml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b02a0be5ae..ebbb2a3623 100644 --- a/pom.xml +++ b/pom.xml @@ -73,6 +73,7 @@ 1.0.4 3.13.0 3.5.0 + 3.8.0 1.11 3.2.7 3.2.1 @@ -356,6 +357,19 @@ + + org.apache.maven.plugins + maven-dependency-plugin + ${maven-dependency-plugin.version} + + + + properties + + + + + maven-surefire-plugin ${maven-surefire-plugin.version} @@ -689,7 +703,7 @@ [21,) - -Xshare:off -XX:+EnableDynamicAgentLoading + -Xshare:off -javaagent:${org.mockito:mockito-core:jar} From b4d22f8fd8a1f67cd624cabb04e01fcc71abe151 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 2 Oct 2024 16:50:53 +0000 Subject: [PATCH 208/449] Bump io.micrometer:micrometer-core from 1.13.4 to 1.13.5 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.13.4 to 1.13.5. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.13.4...v1.13.5) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ebbb2a3623..12d719689e 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.114.Final 0.34.1 4.2.27 - 1.13.4 + 1.13.5 12.2.2 4.7.5 1.27.1 From 1521d51404a7252f224f6e52c59674d8ae888032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 3 Oct 2024 10:45:58 +0200 Subject: [PATCH 209/449] Remove Java 22 from test versions No longer supported. --- .github/workflows/test-supported-java-versions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index e15d141b81..05983059c4 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: distribution: [ 'temurin' ] - version: [ '8', '11', '17', '21', '22', '23', '24-ea' ] + version: [ '8', '11', '17', '21', '23', '24-ea' ] include: - distribution: 'semeru' version: '17' From cf581b1a7b73ecba33a83275f9ab540c19c42fd3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:05:13 +0000 Subject: [PATCH 210/449] Bump io.dropwizard.metrics:metrics-core from 4.2.27 to 4.2.28 Bumps [io.dropwizard.metrics:metrics-core](https://github.com/dropwizard/metrics) from 4.2.27 to 4.2.28. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.27...v4.2.28) --- updated-dependencies: - dependency-name: io.dropwizard.metrics:metrics-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 12d719689e..7a2a56c689 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 1.2.13 4.1.114.Final 0.34.1 - 4.2.27 + 4.2.28 1.13.5 12.2.2 4.7.5 From e2ef410072b393b903b203012a3b69d53f85cfdd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:05:22 +0000 Subject: [PATCH 211/449] Bump org.junit:junit-bom from 5.11.1 to 5.11.2 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.11.1 to 5.11.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.11.1...r5.11.2) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 12d719689e..257ae42be6 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.5.6-6 1.8.0 1.1.10.7 - 5.11.1 + 5.11.2 3.26.3 5.14.1 5.22.0 From 1e278f45387d4fb6d1b654447a2495e294a01d00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:06:35 +0000 Subject: [PATCH 212/449] Bump com.google.googlejavaformat:google-java-format Bumps [com.google.googlejavaformat:google-java-format](https://github.com/google/google-java-format) from 1.23.0 to 1.24.0. - [Release notes](https://github.com/google/google-java-format/releases) - [Commits](https://github.com/google/google-java-format/compare/v1.23.0...v1.24.0) --- updated-dependencies: - dependency-name: com.google.googlejavaformat:google-java-format dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 754f63e8ad..24cad8ca67 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 3.2.1 1.37 2.43.0 - 1.23.0 + 1.24.0 0.8.12 4.8.6.4 4.8.6 From a18cb3897f426e6305f9c2da4c459d79d0dc0138 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 16:06:41 +0000 Subject: [PATCH 213/449] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.5.0 to 3.5.1 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.0 to 3.5.1. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.0...surefire-3.5.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 754f63e8ad..4be031cfcb 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ 1.3.4 1.0.4 3.13.0 - 3.5.0 + 3.5.1 3.8.0 1.11 3.2.7 From 5ecc709e49b4aa1200b590f9b2c77b1d52d38059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 9 Oct 2024 14:58:12 +0200 Subject: [PATCH 214/449] Check producer name is less than 256-byte long And not less than or equal to 256. --- src/main/java/com/rabbitmq/stream/impl/Client.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index bb8b5bc635..525731935e 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -892,7 +892,7 @@ public Response declarePublisher(byte publisherId, String publisherReference, St (publisherReference == null || publisherReference.isEmpty() ? 0 : publisherReference.length()); - if (publisherReferenceSize > 256) { + if (publisherReferenceSize >= 256) { throw new IllegalArgumentException( "If specified, publisher reference must less than 256 characters"); } From b12262746fd2ed8708b18def342877426f294866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 10 Oct 2024 15:45:23 +0200 Subject: [PATCH 215/449] Check producer name is less than 256-byte long --- .../java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java index 7e2a428b9d..99762986e5 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java @@ -82,9 +82,9 @@ MessageHandler messageHandler() { @Override public ConsumerBuilder name(String name) { - if (name == null || name.length() > NAME_MAX_SIZE) { + if (name == null || name.length() >= NAME_MAX_SIZE) { throw new IllegalArgumentException( - "The consumer name must be non-null and under 256 characters"); + "The consumer name must be non-null and less than 256 characters"); } this.name = name; return this; From 195e9cc77782bb2416a9276a1e0dd7e8aef05e96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 11 Oct 2024 14:28:03 +0200 Subject: [PATCH 216/449] Check store offset reference is less than 256-byte long --- src/main/java/com/rabbitmq/stream/impl/Client.java | 5 +++-- .../java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 525731935e..1c9d53c123 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -128,6 +128,7 @@ public class Client implements AutoCloseable { private static final Charset CHARSET = StandardCharsets.UTF_8; public static final int DEFAULT_PORT = 5552; public static final int DEFAULT_TLS_PORT = 5551; + static final int MAX_REFERENCE_SIZE = 256; static final OutboundEntityWriteCallback OUTBOUND_MESSAGE_WRITE_CALLBACK = new OutboundMessageWriteCallback(); static final OutboundEntityWriteCallback OUTBOUND_MESSAGE_BATCH_WRITE_CALLBACK = @@ -892,7 +893,7 @@ public Response declarePublisher(byte publisherId, String publisherReference, St (publisherReference == null || publisherReference.isEmpty() ? 0 : publisherReference.length()); - if (publisherReferenceSize >= 256) { + if (publisherReferenceSize >= MAX_REFERENCE_SIZE) { throw new IllegalArgumentException( "If specified, publisher reference must less than 256 characters"); } @@ -1290,7 +1291,7 @@ public Response subscribe( } public void storeOffset(String reference, String stream, long offset) { - if (reference == null || reference.isEmpty() || reference.length() > 256) { + if (reference == null || reference.isEmpty() || reference.length() >= MAX_REFERENCE_SIZE) { throw new IllegalArgumentException( "Reference must a non-empty string of less than 256 characters"); } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java index 99762986e5..c6364d1aa3 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java @@ -30,7 +30,7 @@ class StreamConsumerBuilder implements ConsumerBuilder { - private static final int NAME_MAX_SIZE = 256; // server-side limitation + private static final int NAME_MAX_SIZE = Client.MAX_REFERENCE_SIZE; // server-side limitation private static final TrackingConfiguration DISABLED_TRACKING_CONFIGURATION = new TrackingConfiguration(false, false, -1, Duration.ZERO, Duration.ZERO); private final StreamEnvironment environment; From 42e7dbb991ae7e790ded6712506f84923baf1135 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 16:34:17 +0000 Subject: [PATCH 217/449] Bump io.vavr:vavr from 0.10.4 to 0.10.5 Bumps [io.vavr:vavr](https://github.com/vavr-io/vavr) from 0.10.4 to 0.10.5. - [Release notes](https://github.com/vavr-io/vavr/releases) - [Changelog](https://github.com/vavr-io/vavr/blob/master/RELEASE.md) - [Commits](https://github.com/vavr-io/vavr/compare/v0.10.4...v0.10.5) --- updated-dependencies: - dependency-name: io.vavr:vavr dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bf6c913cc7..de104bfa80 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 3.17.0 1.17.1 2.11.0 - 0.10.4 + 0.10.5 1.2.5 1.3.4 1.0.4 From 40346d143bf07602c5af352d4818b52f34028d93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:39:50 +0000 Subject: [PATCH 218/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.3.4 to 1.3.5. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.3.4...v1.3.5) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index de104bfa80..95e21671a7 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.11.0 0.10.5 1.2.5 - 1.3.4 + 1.3.5 1.0.4 3.13.0 3.5.1 From e8d84aaa79ece1379cfb7f2ebb1c8c5a0477500a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:39:57 +0000 Subject: [PATCH 219/449] Bump io.micrometer:micrometer-core from 1.13.5 to 1.13.6 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.13.5 to 1.13.6. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.13.5...v1.13.6) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index de104bfa80..f6e9c98892 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.114.Final 0.34.1 4.2.28 - 1.13.5 + 1.13.6 12.2.2 4.7.5 1.27.1 From 3840ddf7227aff17b45712db6f91c715fd1e6f7e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:40:06 +0000 Subject: [PATCH 220/449] Bump org.mockito:mockito-core from 5.14.1 to 5.14.2 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.14.1 to 5.14.2. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.14.1...v5.14.2) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index de104bfa80..dad7d783ff 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.1.10.7 5.11.2 3.26.3 - 5.14.1 + 5.14.2 5.22.0 3.17.0 1.17.1 From 6fe6d785410fd7106e5c075b44582f0aefcec22f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 16 Oct 2024 08:46:43 +0200 Subject: [PATCH 221/449] Set release version to 0.18.0 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index bec61b7554..e3b9a55f39 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,4 +1,4 @@ -RELEASE_VERSION="0.18.0.RC1" +RELEASE_VERSION="0.18.0" DEVELOPMENT_VERSION="0.19.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 4276865e3cba717b47b5947523327b037d891b20 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Wed, 16 Oct 2024 06:48:29 +0000 Subject: [PATCH 222/449] [maven-release-plugin] prepare release v0.18.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 975f11f828..3ce6e4ceda 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.18.0-SNAPSHOT + 0.18.0 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.18.0 From 29dbd7196382f040b33cdf3e3acf483a80fbb4b6 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Wed, 16 Oct 2024 06:48:30 +0000 Subject: [PATCH 223/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3ce6e4ceda..271937b6d5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.18.0 + 0.19.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.18.0 + HEAD From 7c9f6458d57e06385ae6f554d2158c2fac256e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 16 Oct 2024 08:56:30 +0200 Subject: [PATCH 224/449] Set release version to 0.19.0.RC1 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index e3b9a55f39..b4e121bad0 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,4 +1,4 @@ -RELEASE_VERSION="0.18.0" +RELEASE_VERSION="0.19.0.RC1" DEVELOPMENT_VERSION="0.19.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 3cc98f94b67a2fb39e1d1356277892fbd0036b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 18 Oct 2024 09:12:53 +0200 Subject: [PATCH 225/449] Add initial member count to stream creator --- .../java/com/rabbitmq/stream/StreamCreator.java | 10 ++++++++++ src/main/java/com/rabbitmq/stream/impl/Client.java | 8 ++++++++ .../rabbitmq/stream/impl/StreamStreamCreator.java | 6 ++++++ .../rabbitmq/stream/impl/StreamEnvironmentTest.java | 13 +++++++++++++ 4 files changed, 37 insertions(+) diff --git a/src/main/java/com/rabbitmq/stream/StreamCreator.java b/src/main/java/com/rabbitmq/stream/StreamCreator.java index 73f1360592..b16de24b0a 100644 --- a/src/main/java/com/rabbitmq/stream/StreamCreator.java +++ b/src/main/java/com/rabbitmq/stream/StreamCreator.java @@ -92,6 +92,16 @@ public interface StreamCreator { */ StreamCreator filterSize(int size); + /** + * Set the number of initial members the stream should have. + * + * @param initialMemberCount initial number of nodes + * @return this creator instance + * @see Initial Replication + * Factor + */ + StreamCreator initialMemberCount(int initialMemberCount); + /** * Configure the super stream to create. * diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 1c9d53c123..aa27f430fa 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -2744,6 +2744,14 @@ public StreamParametersBuilder filterSize(int size) { return this; } + public StreamParametersBuilder initialMemberCount(int initialMemberCount) { + if (initialMemberCount <= 0) { + throw new IllegalArgumentException("The initial member count must be greater than 0"); + } + this.parameters.put("initial-cluster-size", String.valueOf(initialMemberCount)); + return this; + } + public StreamParametersBuilder put(String key, String value) { parameters.put(key, value); return this; diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java b/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java index f0928487ec..e639240cde 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java @@ -86,6 +86,12 @@ public StreamCreator filterSize(int size) { return this; } + @Override + public StreamCreator initialMemberCount(int initialMemberCount) { + streamParametersBuilder.initialMemberCount(initialMemberCount); + return this; + } + @Override public SuperStreamConfiguration superStream() { if (this.superStreamConfiguration == null) { diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java index 064f8f2e2c..6ef7e563cd 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java @@ -813,4 +813,17 @@ void enforceEntityPerConnectionLimits() { executor.shutdownNow(); } } + + @Test + void brokerShouldAcceptInitialMemberCountArgument(TestInfo info) { + String s = streamName(info); + Environment env = environmentBuilder.build(); + try { + env.streamCreator().name(s).initialMemberCount(1).create(); + assertThat(env.streamExists(s)).isTrue(); + } finally { + env.deleteStream(s); + env.close(); + } + } } From 4467453d2635afcf1ed1a4af012f4e33f703dea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 18 Oct 2024 09:41:26 +0200 Subject: [PATCH 226/449] Support arbitrary key-value argument in stream creator --- src/main/java/com/rabbitmq/stream/StreamCreator.java | 9 +++++++++ src/main/java/com/rabbitmq/stream/impl/Client.java | 6 +++++- .../com/rabbitmq/stream/impl/StreamStreamCreator.java | 6 ++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/StreamCreator.java b/src/main/java/com/rabbitmq/stream/StreamCreator.java index b16de24b0a..8693180a5b 100644 --- a/src/main/java/com/rabbitmq/stream/StreamCreator.java +++ b/src/main/java/com/rabbitmq/stream/StreamCreator.java @@ -102,6 +102,15 @@ public interface StreamCreator { */ StreamCreator initialMemberCount(int initialMemberCount); + /** + * Set an argument for the stream creation. + * + * @param key argument key + * @param value argument value + * @return this creator instance + */ + StreamCreator argument(String key, String value); + /** * Configure the super stream to create. * diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index aa27f430fa..a86a6881a1 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -2753,7 +2753,11 @@ public StreamParametersBuilder initialMemberCount(int initialMemberCount) { } public StreamParametersBuilder put(String key, String value) { - parameters.put(key, value); + if (value == null) { + parameters.remove(key); + } else { + parameters.put(key, value); + } return this; } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java b/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java index e639240cde..1a71831418 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java @@ -92,6 +92,12 @@ public StreamCreator initialMemberCount(int initialMemberCount) { return this; } + @Override + public StreamCreator argument(String key, String value) { + streamParametersBuilder.put(key, value); + return this; + } + @Override public SuperStreamConfiguration superStream() { if (this.superStreamConfiguration == null) { From 64f5859eb3544295092cece1157708d8ede2a760 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 16:30:53 +0000 Subject: [PATCH 227/449] Bump org.junit:junit-bom from 5.11.2 to 5.11.3 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.11.2 to 5.11.3. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.11.2...r5.11.3) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 271937b6d5..f108b107fb 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.5.6-6 1.8.0 1.1.10.7 - 5.11.2 + 5.11.3 3.26.3 5.14.2 5.22.0 From e8fac530e5d96668997fad0777200dac8bd8c0e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 16:07:19 +0000 Subject: [PATCH 228/449] Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.6.4 to 4.8.6.5 Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.8.6.4 to 4.8.6.5. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.8.6.4...spotbugs-maven-plugin-4.8.6.5) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f108b107fb..38c8226a5a 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,7 @@ 2.43.0 1.24.0 0.8.12 - 4.8.6.4 + 4.8.6.5 4.8.6 4.0 From e3950ba9e0772a1a04d7dcaea22935673408c570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 23 Oct 2024 11:04:46 +0200 Subject: [PATCH 229/449] Recover producer and consumer on timeout Fixes #630 --- .../java/com/rabbitmq/stream/impl/Utils.java | 27 +++++----- .../stream/impl/ConsumersCoordinatorTest.java | 53 +++++++++++++++++++ .../stream/impl/ProducersCoordinatorTest.java | 36 +++++++++++++ 3 files changed, 103 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index 43cddc1f1e..745c7778a1 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -145,6 +145,12 @@ static short encodeResponseCode(Short code) { } static ClientFactory coordinatorClientFactory(StreamEnvironment environment) { + String messageFormat = + "%s. %s. " + + "This may be due to the usage of a load balancer that makes topology discovery fail. " + + "Use a custom AddressResolver or the --load-balancer flag if using StreamPerfTest. " + + "See https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmlsingle/#understanding-connection-logic " + + "and https://blog.rabbitmq.com/posts/2021/07/connecting-to-streams/#with-a-load-balancer."; return context -> { ClientParameters parametersCopy = context.parameters().duplicate(); Address address = new Address(parametersCopy.host(), parametersCopy.port()); @@ -159,20 +165,15 @@ static ClientFactory coordinatorClientFactory(StreamEnvironment environment) { return Utils.connectToAdvertisedNodeClientFactory( context.key(), context1 -> new Client(context1.parameters())) .client(Utils.ClientFactoryContext.fromParameters(parametersCopy).key(context.key())); + } catch (TimeoutStreamException e) { + throw new TimeoutStreamException( + format(messageFormat, e.getMessage(), e.getCause().getMessage(), e.getCause())); } catch (StreamException e) { if (e.getCause() != null && (e.getCause() instanceof UnknownHostException || e.getCause() instanceof ConnectTimeoutException)) { - String message = - e.getMessage() - + ". " - + e.getCause().getMessage() - + ". " - + "This may be due to the usage of a load balancer that makes topology discovery fail. " - + "Use a custom AddressResolver or the --load-balancer flag if using StreamPerfTest. " - + "See https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmlsingle/#understanding-connection-logic " - + "and https://blog.rabbitmq.com/posts/2021/07/connecting-to-streams/#with-a-load-balancer."; - throw new StreamException(message, e.getCause()); + throw new StreamException( + format(messageFormat, e.getMessage(), e.getCause().getMessage()), e.getCause()); } else { throw e; } @@ -204,11 +205,11 @@ static ClientFactory connectToAdvertisedNodeClientFactory( } static Runnable namedRunnable(Runnable task, String format, Object... args) { - return new NamedRunnable(String.format(format, args), task); + return new NamedRunnable(format(format, args), task); } static Function namedFunction(Function task, String format, Object... args) { - return new NamedFunction<>(String.format(format, args), task); + return new NamedFunction<>(format(format, args), task); } static T callAndMaybeRetry( @@ -325,7 +326,7 @@ public Client client(ClientFactoryContext context) { try { Thread.sleep(this.retryInterval.toMillis()); } catch (InterruptedException e) { - Thread.interrupted(); + Thread.currentThread().interrupt(); return null; } } diff --git a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java index 110e5b946b..6b655e9141 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java @@ -41,6 +41,7 @@ import com.rabbitmq.stream.impl.Client.Response; import com.rabbitmq.stream.impl.MonitoringTestUtils.ConsumerCoordinatorInfo; import com.rabbitmq.stream.impl.Utils.ClientFactory; +import io.netty.channel.ConnectTimeoutException; import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; @@ -1711,6 +1712,58 @@ void shouldRetryAssignmentOnRecoveryCandidateLookupFailure() throws Exception { verify(locator, times(4)).metadata("stream"); } + @Test + @SuppressWarnings("unchecked") + void shouldRetryAssignmentOnRecoveryConnectionTimeout() throws Exception { + scheduledExecutorService = createScheduledExecutorService(2); + when(environment.scheduledExecutorService()).thenReturn(scheduledExecutorService); + Duration retryDelay = Duration.ofMillis(100); + when(environment.recoveryBackOffDelayPolicy()).thenReturn(BackOffDelayPolicy.fixed(retryDelay)); + when(environment.topologyUpdateBackOffDelayPolicy()) + .thenReturn(BackOffDelayPolicy.fixed(retryDelay)); + when(consumer.isOpen()).thenReturn(true); + when(locator.metadata("stream")).thenReturn(metadata("stream", null, replicas())); + + when(clientFactory.client(any())) + .thenReturn(client) + .thenThrow(new TimeoutStreamException("", new ConnectTimeoutException())) + .thenReturn(client); + + AtomicInteger subscriptionCount = new AtomicInteger(0); + when(client.subscribe( + subscriptionIdCaptor.capture(), + anyString(), + any(OffsetSpecification.class), + anyInt(), + anyMap())) + .thenAnswer( + invocation -> { + subscriptionCount.incrementAndGet(); + return responseOk(); + }); + + coordinator.subscribe( + consumer, + "stream", + null, + null, + NO_OP_SUBSCRIPTION_LISTENER, + NO_OP_TRACKING_CLOSING_CALLBACK, + (offset, message) -> {}, + Collections.emptyMap(), + flowStrategy()); + verify(clientFactory, times(1)).client(any()); + verify(client, times(1)) + .subscribe(anyByte(), anyString(), any(OffsetSpecification.class), anyInt(), anyMap()); + + this.shutdownListener.handle( + new Client.ShutdownContext(Client.ShutdownContext.ShutdownReason.UNKNOWN)); + + waitAtMost(() -> subscriptionCount.get() == 1 + 1); + + verify(locator, times(3)).metadata("stream"); + } + @Test void subscribeUnsubscribeInDifferentThreadsShouldNotDeadlock() { when(locator.metadata("stream")).thenReturn(metadata(null, replicas())); diff --git a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java index 34817e6752..ca8c550b26 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java @@ -46,6 +46,8 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.IntStream; + +import io.netty.channel.ConnectTimeoutException; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -301,6 +303,40 @@ void shouldRedistributeProducerAndTrackingConsumerIfConnectionIsLost() throws Ex assertThat(coordinator.clientCount()).isEqualTo(1); } + @Test + void shouldRecoverOnConnectionTimeout() throws Exception { + scheduledExecutorService = createScheduledExecutorService(); + when(environment.scheduledExecutorService()).thenReturn(scheduledExecutorService); + Duration retryDelay = Duration.ofMillis(50); + when(environment.recoveryBackOffDelayPolicy()).thenReturn(BackOffDelayPolicy.fixed(retryDelay)); + when(locator.metadata("stream")) + .thenReturn(metadata(leader(), replicas())); + + when(clientFactory.client(any())) + .thenReturn(client) + .thenThrow(new TimeoutStreamException("", new ConnectTimeoutException())) + .thenReturn(client); + + when(producer.isOpen()).thenReturn(true); + + StreamProducer producer = mock(StreamProducer.class); + when(producer.isOpen()).thenReturn(true); + + CountDownLatch runningLatch = new CountDownLatch(1); + doAnswer(answer(runningLatch::countDown)).when(this.producer).running(); + + coordinator.registerProducer(this.producer, null, "stream"); + + verify(this.producer, times(1)).setClient(client); + + shutdownListener.handle( + new Client.ShutdownContext(Client.ShutdownContext.ShutdownReason.UNKNOWN)); + + assertThat(runningLatch.await(5, TimeUnit.SECONDS)).isTrue(); + verify(this.producer, times(1)).unavailable(); + verify(this.producer, times(2)).setClient(client); + } + @Test void shouldDisposeProducerAndNotTrackingConsumerIfRecoveryTimesOut() throws Exception { scheduledExecutorService = createScheduledExecutorService(); From c1545f6b38927a98ed4bd6d7263887046483c1e2 Mon Sep 17 00:00:00 2001 From: laststem Date: Thu, 24 Oct 2024 11:14:53 +0900 Subject: [PATCH 230/449] optional retry on recovery --- src/docs/asciidoc/api.adoc | 7 +- .../com/rabbitmq/stream/ProducerBuilder.java | 12 +++ .../rabbitmq/stream/impl/StreamProducer.java | 82 +++++++++++-------- .../stream/impl/StreamProducerBuilder.java | 9 ++ .../stream/impl/StreamProducerTest.java | 2 +- .../stream/impl/StreamProducerUnitTest.java | 3 + 6 files changed, 81 insertions(+), 34 deletions(-) diff --git a/src/docs/asciidoc/api.adoc b/src/docs/asciidoc/api.adoc index 66f678c0d3..951c0b0cfd 100644 --- a/src/docs/asciidoc/api.adoc +++ b/src/docs/asciidoc/api.adoc @@ -464,7 +464,12 @@ outstanding unconfirmed messages timed out. |Time before enqueueing of a message fail when the maximum number of unconfirmed is reached. The callback of the message will be called with a negative status. Set the value to `Duration.ZERO` if there should be no timeout. -|10 seconds. +|10 seconds + +|`retryOnRecovery` +|Re-publish unconfirmed messages when restoring a connection. +Set to false if do not want to re-publish unconfirmed messages when restoring a connection. +|true |=== ==== Sending Messages diff --git a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java index 1d340090b5..9c8b6c145d 100644 --- a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java @@ -133,6 +133,18 @@ public interface ProducerBuilder { */ ProducerBuilder enqueueTimeout(Duration timeout); + /** + * Re-publish unconfirmed messages when restoring a connection. + * + *

Default is true.

+ * + *

Set to false if do not want to re-publish unconfirmed messages when restoring a connection.

+ * + * @param retryOnRecovery + * @return this builder instance + */ + ProducerBuilder retryOnRecovery(boolean retryOnRecovery); + /** * Logic to extract a filter value from a message. * diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index 7553e2c838..2d84a45a8d 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -78,6 +78,7 @@ class StreamProducer implements Producer { entity -> ((AccumulatedEntity) entity).publishingId(); private final long enqueueTimeoutMs; private final boolean blockOnMaxUnconfirmed; + private final boolean retryOnRecovery; private volatile Client client; private volatile byte publisherId; private volatile Status status; @@ -95,6 +96,7 @@ class StreamProducer implements Producer { int maxUnconfirmedMessages, Duration confirmTimeout, Duration enqueueTimeout, + boolean retryOnRecovery, Function filterValueExtractor, StreamEnvironment environment) { if (filterValueExtractor != null && !environment.filteringSupported()) { @@ -107,6 +109,7 @@ class StreamProducer implements Producer { this.name = name; this.stream = stream; this.enqueueTimeoutMs = enqueueTimeout.toMillis(); + this.retryOnRecovery = retryOnRecovery; this.blockOnMaxUnconfirmed = enqueueTimeout.isZero(); this.closingCallback = environment.registerProducer(this, name, this.stream); final Client.OutboundEntityWriteCallback delegateWriteCallback; @@ -504,43 +507,58 @@ void unavailable() { void running() { synchronized (this) { - LOGGER.debug( - "Re-publishing {} unconfirmed message(s) and {} accumulated message(s)", - this.unconfirmedMessages.size(), - this.accumulator.size()); - if (!this.unconfirmedMessages.isEmpty()) { - Map messagesToResend = new TreeMap<>(this.unconfirmedMessages); + if (!this.retryOnRecovery) { + LOGGER.debug( + "Skip to republish {} unconfirmed message(s) and re-publishing {} accumulated message(s)", + this.unconfirmedMessages.size(), + this.accumulator.size()); + this.unconfirmedMessages.clear(); - Iterator> resendIterator = + int toRelease = maxUnconfirmedMessages - unconfirmedMessagesSemaphore.availablePermits(); + if (toRelease > 0) { + unconfirmedMessagesSemaphore.release(toRelease); + } + + publishBatch(false); + } else { + LOGGER.debug( + "Re-publishing {} unconfirmed message(s) and {} accumulated message(s)", + this.unconfirmedMessages.size(), + this.accumulator.size()); + if (!this.unconfirmedMessages.isEmpty()) { + Map messagesToResend = new TreeMap<>(this.unconfirmedMessages); + this.unconfirmedMessages.clear(); + Iterator> resendIterator = messagesToResend.entrySet().iterator(); - while (resendIterator.hasNext()) { - List messages = new ArrayList<>(this.batchSize); - int batchCount = 0; - while (batchCount != this.batchSize) { - Object accMessage = resendIterator.hasNext() ? resendIterator.next().getValue() : null; - if (accMessage == null) { - break; + while (resendIterator.hasNext()) { + List messages = new ArrayList<>(this.batchSize); + int batchCount = 0; + while (batchCount != this.batchSize) { + Object accMessage = resendIterator.hasNext() ? resendIterator.next().getValue() : null; + if (accMessage == null) { + break; + } + messages.add(accMessage); + batchCount++; } - messages.add(accMessage); - batchCount++; + client.publishInternal( + this.publishVersion, + this.publisherId, + messages, + this.writeCallback, + this.publishSequenceFunction); } - client.publishInternal( - this.publishVersion, - this.publisherId, - messages, - this.writeCallback, - this.publishSequenceFunction); } - } - publishBatch(false); - - int toRelease = maxUnconfirmedMessages - unconfirmedMessagesSemaphore.availablePermits(); - if (toRelease > 0) { - unconfirmedMessagesSemaphore.release(toRelease); - if (!unconfirmedMessagesSemaphore.tryAcquire(this.unconfirmedMessages.size())) { - LOGGER.debug( - "Could not acquire {} permit(s) for message republishing", - this.unconfirmedMessages.size()); + publishBatch(false); + + int toRelease = maxUnconfirmedMessages - unconfirmedMessagesSemaphore.availablePermits(); + if (toRelease > 0) { + unconfirmedMessagesSemaphore.release(toRelease); + if (!unconfirmedMessagesSemaphore.tryAcquire(this.unconfirmedMessages.size())) { + LOGGER.debug( + "Could not acquire {} permit(s) for message republishing", + this.unconfirmedMessages.size()); + } } } } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java index 0497c53e64..493426c67f 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java @@ -47,6 +47,8 @@ class StreamProducerBuilder implements ProducerBuilder { private Duration enqueueTimeout = Duration.ofSeconds(10); + private boolean retryOnRecovery = true; + private DefaultRoutingConfiguration routingConfiguration; private Function filterValueExtractor; @@ -131,6 +133,12 @@ public ProducerBuilder enqueueTimeout(Duration timeout) { return this; } + @Override + public ProducerBuilder retryOnRecovery(boolean retryOnRecovery) { + this.retryOnRecovery = retryOnRecovery; + return this; + } + @Override public ProducerBuilder filterValue(Function filterValueExtractor) { this.filterValueExtractor = filterValueExtractor; @@ -195,6 +203,7 @@ public Producer build() { maxUnconfirmedMessages, confirmTimeout, enqueueTimeout, + retryOnRecovery, filterValueExtractor, environment); this.environment.addProducer((StreamProducer) producer); diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java index 6cf06356d0..07a3132eca 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java @@ -243,7 +243,7 @@ void sendToNonExistingStreamShouldReturnUnconfirmedStatus() throws Exception { @TestUtils.DisabledIfRabbitMqCtlNotSet void shouldRecoverAfterConnectionIsKilled(int subEntrySize) throws Exception { Producer producer = - environment.producerBuilder().subEntrySize(subEntrySize).stream(stream).build(); + environment.producerBuilder().subEntrySize(subEntrySize).retryOnRecovery(true).stream(stream).build(); AtomicInteger published = new AtomicInteger(0); AtomicInteger confirmed = new AtomicInteger(0); diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java index 92fa41d124..28c87bfbc2 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java @@ -177,6 +177,7 @@ void confirmTimeoutTaskShouldFailMessagesAfterTimeout( messageCount * 10, confirmTimeout, Duration.ofSeconds(10), + true, null, env); @@ -219,6 +220,7 @@ void enqueueTimeoutMessageShouldBeFailedWhenEnqueueTimeoutIsReached(int subEntry 2, Duration.ofMinutes(1), enqueueTimeout, + true, null, env); @@ -258,6 +260,7 @@ void enqueueTimeoutSendingShouldBlockWhenEnqueueTimeoutIsZero(int subEntrySize) 2, Duration.ofMinutes(1), enqueueTimeout, + true, null, env); From ce5b04b391c4b5f0cd6ffbab28a140e21ce22a93 Mon Sep 17 00:00:00 2001 From: laststem Date: Thu, 24 Oct 2024 12:01:18 +0900 Subject: [PATCH 231/449] fix description --- src/docs/asciidoc/api.adoc | 4 ++-- src/main/java/com/rabbitmq/stream/ProducerBuilder.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/docs/asciidoc/api.adoc b/src/docs/asciidoc/api.adoc index 951c0b0cfd..cef10e7bf6 100644 --- a/src/docs/asciidoc/api.adoc +++ b/src/docs/asciidoc/api.adoc @@ -467,8 +467,8 @@ Set the value to `Duration.ZERO` if there should be no timeout. |10 seconds |`retryOnRecovery` -|Re-publish unconfirmed messages when restoring a connection. -Set to false if do not want to re-publish unconfirmed messages when restoring a connection. +|Re-publish unconfirmed messages after recovering a connection. +Set to false if do not want to re-publish unconfirmed messages after recovering a connection. |true |=== diff --git a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java index 9c8b6c145d..853d01ddc5 100644 --- a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java @@ -134,11 +134,11 @@ public interface ProducerBuilder { ProducerBuilder enqueueTimeout(Duration timeout); /** - * Re-publish unconfirmed messages when restoring a connection. + * Re-publish unconfirmed messages after recovering a connection. * *

Default is true.

* - *

Set to false if do not want to re-publish unconfirmed messages when restoring a connection.

+ *

Set to false if do not want to re-publish unconfirmed messages after recovering a connection.

* * @param retryOnRecovery * @return this builder instance From 6df1e05c502c67d21c35f12cde38ec1fafca1d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 24 Oct 2024 16:04:28 +0200 Subject: [PATCH 232/449] Refine producer retryOnRecovery support References #642 --- src/docs/asciidoc/api.adoc | 4 +- .../com/rabbitmq/stream/ProducerBuilder.java | 12 ++-- .../rabbitmq/stream/impl/StreamProducer.java | 63 ++++++++++--------- .../stream/impl/ProducersCoordinatorTest.java | 6 +- .../stream/impl/StreamProducerTest.java | 2 +- 5 files changed, 47 insertions(+), 40 deletions(-) diff --git a/src/docs/asciidoc/api.adoc b/src/docs/asciidoc/api.adoc index cef10e7bf6..28eb063bc6 100644 --- a/src/docs/asciidoc/api.adoc +++ b/src/docs/asciidoc/api.adoc @@ -467,8 +467,8 @@ Set the value to `Duration.ZERO` if there should be no timeout. |10 seconds |`retryOnRecovery` -|Re-publish unconfirmed messages after recovering a connection. -Set to false if do not want to re-publish unconfirmed messages after recovering a connection. +|Whether to republish unconfirmed messages after recovery. +Set to `false` to not republish unconfirmed messages and get a negative `ConfirmationStatus` for unconfirmed messages. |true |=== diff --git a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java index 853d01ddc5..00d17475ec 100644 --- a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java @@ -134,13 +134,17 @@ public interface ProducerBuilder { ProducerBuilder enqueueTimeout(Duration timeout); /** - * Re-publish unconfirmed messages after recovering a connection. + * Whether to republish unconfirmed messages after recovery. * - *

Default is true.

+ *

Default is true (unconfirmed messages are republished after recovery). * - *

Set to false if do not want to re-publish unconfirmed messages after recovering a connection.

+ *

Set to false to not republish unconfirmed messages and get a negative {@link + * ConfirmationStatus} for unconfirmed messages. * - * @param retryOnRecovery + *

Note setting this flag to false translates to at-most-once semantics, that is + * published messages may be lost, unless the publishing application retries publishing them. + * + * @param retryOnRecovery retry flag * @return this builder instance */ ProducerBuilder retryOnRecovery(boolean retryOnRecovery); diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index 2d84a45a8d..4050fd0af7 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -507,34 +507,23 @@ void unavailable() { void running() { synchronized (this) { - if (!this.retryOnRecovery) { - LOGGER.debug( - "Skip to republish {} unconfirmed message(s) and re-publishing {} accumulated message(s)", - this.unconfirmedMessages.size(), - this.accumulator.size()); - - this.unconfirmedMessages.clear(); - int toRelease = maxUnconfirmedMessages - unconfirmedMessagesSemaphore.availablePermits(); - if (toRelease > 0) { - unconfirmedMessagesSemaphore.release(toRelease); - } - - publishBatch(false); - } else { - LOGGER.debug( - "Re-publishing {} unconfirmed message(s) and {} accumulated message(s)", - this.unconfirmedMessages.size(), - this.accumulator.size()); + LOGGER.debug( + "Recovering producer with {} unconfirmed message(s) and {} accumulated message(s)", + this.unconfirmedMessages.size(), + this.accumulator.size()); + if (this.retryOnRecovery) { + LOGGER.debug("Re-publishing {} unconfirmed message(s)", this.unconfirmedMessages.size()); if (!this.unconfirmedMessages.isEmpty()) { Map messagesToResend = new TreeMap<>(this.unconfirmedMessages); this.unconfirmedMessages.clear(); Iterator> resendIterator = - messagesToResend.entrySet().iterator(); + messagesToResend.entrySet().iterator(); while (resendIterator.hasNext()) { List messages = new ArrayList<>(this.batchSize); int batchCount = 0; while (batchCount != this.batchSize) { - Object accMessage = resendIterator.hasNext() ? resendIterator.next().getValue() : null; + Object accMessage = + resendIterator.hasNext() ? resendIterator.next().getValue() : null; if (accMessage == null) { break; } @@ -549,18 +538,34 @@ void running() { this.publishSequenceFunction); } } - publishBatch(false); - - int toRelease = maxUnconfirmedMessages - unconfirmedMessagesSemaphore.availablePermits(); - if (toRelease > 0) { - unconfirmedMessagesSemaphore.release(toRelease); - if (!unconfirmedMessagesSemaphore.tryAcquire(this.unconfirmedMessages.size())) { - LOGGER.debug( - "Could not acquire {} permit(s) for message republishing", - this.unconfirmedMessages.size()); + } else { + LOGGER.debug( + "Skipping republishing of {} unconfirmed messages", this.unconfirmedMessages.size()); + Map messagesToFail = new TreeMap<>(this.unconfirmedMessages); + this.unconfirmedMessages.clear(); + for (AccumulatedEntity accumulatedEntity : messagesToFail.values()) { + try { + int permits = + accumulatedEntity + .confirmationCallback() + .handle(false, CODE_PUBLISH_CONFIRM_TIMEOUT); + this.unconfirmedMessagesSemaphore.release(permits); + } catch (Exception e) { + LOGGER.debug("Error while nack-ing outbound message: {}", e.getMessage()); + this.unconfirmedMessagesSemaphore.release(1); } } } + publishBatch(false); + int toRelease = maxUnconfirmedMessages - unconfirmedMessagesSemaphore.availablePermits(); + if (toRelease > 0) { + unconfirmedMessagesSemaphore.release(toRelease); + if (!unconfirmedMessagesSemaphore.tryAcquire(this.unconfirmedMessages.size())) { + LOGGER.debug( + "Could not acquire {} permit(s) for message republishing", + this.unconfirmedMessages.size()); + } + } } this.status = Status.RUNNING; } diff --git a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java index ca8c550b26..238c645053 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java @@ -37,6 +37,7 @@ import com.rabbitmq.stream.StreamDoesNotExistException; import com.rabbitmq.stream.impl.Client.Response; import com.rabbitmq.stream.impl.Utils.ClientFactory; +import io.netty.channel.ConnectTimeoutException; import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; @@ -46,8 +47,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.IntStream; - -import io.netty.channel.ConnectTimeoutException; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -309,8 +308,7 @@ void shouldRecoverOnConnectionTimeout() throws Exception { when(environment.scheduledExecutorService()).thenReturn(scheduledExecutorService); Duration retryDelay = Duration.ofMillis(50); when(environment.recoveryBackOffDelayPolicy()).thenReturn(BackOffDelayPolicy.fixed(retryDelay)); - when(locator.metadata("stream")) - .thenReturn(metadata(leader(), replicas())); + when(locator.metadata("stream")).thenReturn(metadata(leader(), replicas())); when(clientFactory.client(any())) .thenReturn(client) diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java index 07a3132eca..6cf06356d0 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java @@ -243,7 +243,7 @@ void sendToNonExistingStreamShouldReturnUnconfirmedStatus() throws Exception { @TestUtils.DisabledIfRabbitMqCtlNotSet void shouldRecoverAfterConnectionIsKilled(int subEntrySize) throws Exception { Producer producer = - environment.producerBuilder().subEntrySize(subEntrySize).retryOnRecovery(true).stream(stream).build(); + environment.producerBuilder().subEntrySize(subEntrySize).stream(stream).build(); AtomicInteger published = new AtomicInteger(0); AtomicInteger confirmed = new AtomicInteger(0); From 457a563a40d218ffbd35fc6fa46bfb58f9724365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 25 Oct 2024 11:01:02 +0200 Subject: [PATCH 233/449] Complete Javadoc --- src/main/java/com/rabbitmq/stream/ProducerBuilder.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java index 00d17475ec..5686a370cf 100644 --- a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java @@ -146,6 +146,7 @@ public interface ProducerBuilder { * * @param retryOnRecovery retry flag * @return this builder instance + * @since 0.19.0 */ ProducerBuilder retryOnRecovery(boolean retryOnRecovery); From c81acd85e303fab3c3daac708a053bdf1b3fa563 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 16:07:07 +0000 Subject: [PATCH 234/449] Bump org.apache.maven.plugins:maven-dependency-plugin Bumps [org.apache.maven.plugins:maven-dependency-plugin](https://github.com/apache/maven-dependency-plugin) from 3.8.0 to 3.8.1. - [Release notes](https://github.com/apache/maven-dependency-plugin/releases) - [Commits](https://github.com/apache/maven-dependency-plugin/compare/maven-dependency-plugin-3.8.0...maven-dependency-plugin-3.8.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-dependency-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 38c8226a5a..6e3e7361b4 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ 1.0.4 3.13.0 3.5.1 - 3.8.0 + 3.8.1 1.11 3.2.7 3.2.1 From e9745e43ebf22c5ea78373a3da2efd21f6f74382 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 16:03:23 +0000 Subject: [PATCH 235/449] Bump com.github.luben:zstd-jni from 1.5.6-6 to 1.5.6-7 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.6-6 to 1.5.6-7. - [Commits](https://github.com/luben/zstd-jni/commits) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6e3e7361b4..792394c19f 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 12.2.2 4.7.5 1.27.1 - 1.5.6-6 + 1.5.6-7 1.8.0 1.1.10.7 5.11.3 From d4e2c4fa880f9c40b44ead3119fed5c831710411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 30 Oct 2024 10:20:17 +0100 Subject: [PATCH 236/449] Set release version to 0.19.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index b4e121bad0..b73bbb95f1 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,5 +1,5 @@ -RELEASE_VERSION="0.19.0.RC1" -DEVELOPMENT_VERSION="0.19.0-SNAPSHOT" +RELEASE_VERSION="0.19.0" +DEVELOPMENT_VERSION="0.20.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From a73a5bc970a7dde378fdd128df28c1f7eb2d48e5 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Wed, 30 Oct 2024 09:34:08 +0000 Subject: [PATCH 237/449] [maven-release-plugin] prepare release v0.19.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 792394c19f..f4d5f41deb 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.19.0-SNAPSHOT + 0.19.0 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.19.0 From dcfb72934e530407e0db665cbf02d42e7e475c3b Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Wed, 30 Oct 2024 09:35:05 +0000 Subject: [PATCH 238/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f4d5f41deb..86b060da35 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.19.0 + 0.20.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.19.0 + HEAD From 6869d4db3d05067b419c8e51e261bb42aaec53c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 30 Oct 2024 10:48:36 +0100 Subject: [PATCH 239/449] Set release version to 0.20.0.RC1 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index b73bbb95f1..39bfdfacd9 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,4 +1,4 @@ -RELEASE_VERSION="0.19.0" +RELEASE_VERSION="0.20.0.RC1" DEVELOPMENT_VERSION="0.20.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From d7bf15e81008a0a7ae38e99e3c5c076b2ebe928d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:33:22 +0000 Subject: [PATCH 240/449] Bump org.asciidoctor:asciidoctor-maven-plugin from 3.0.0 to 3.1.0 Bumps [org.asciidoctor:asciidoctor-maven-plugin](https://github.com/asciidoctor/asciidoctor-maven-plugin) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/asciidoctor/asciidoctor-maven-plugin/releases) - [Changelog](https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/main/CHANGELOG.adoc) - [Commits](https://github.com/asciidoctor/asciidoctor-maven-plugin/compare/asciidoctor-maven-tools-3.0.0...asciidoctor-maven-tools-3.1.0) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctor-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 86b060da35..5c73079855 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.10.1 3.4.2 3.4.0 - 3.0.0 + 3.1.0 3.0.0 2.3.1 3.2.1 From 033a066029e81eae157991eef433e13e1d0e5d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 4 Nov 2024 15:41:10 +0100 Subject: [PATCH 241/449] Log warning in case of unexpected use of dev mode The dev mode is activated when no address resolver is set, the host is localhost, and the user is guest. The dev mode sets a resolver that always uses localhost, this avoids problems when e.g. the metadata frame returns the hostname of a local container that the client application cannot reach. This commit adds a warn-level log message if the client detects a local cluster setup (because there are several addresses passed in to the address resolver). References #420 --- .../rabbitmq/stream/impl/StreamEnvironment.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index 4dc869af19..ed951c38b7 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -42,10 +42,7 @@ import java.net.URLDecoder; import java.time.Duration; import java.time.LocalDateTime; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; @@ -159,7 +156,16 @@ class StreamEnvironment implements Environment { String username = ((UsernamePasswordCredentialsProvider) credentialsProvider).getUsername(); if (DEFAULT_USERNAME.equals(username)) { Address address = new Address("localhost", clientParametersPrototype.port()); - addressResolverToUse = ignored -> address; + Set
passedInAddresses = ConcurrentHashMap.newKeySet(); + addressResolverToUse = + addr -> { + passedInAddresses.add(addr); + if (passedInAddresses.size() > 1) { + LOGGER.warn("Assumed development environment but it seems incorrect."); + passedInAddresses.clear(); + } + return address; + }; LOGGER.info( "Connecting to localhost with {} user, assuming development environment", DEFAULT_USERNAME); From de085795e382aeef1ad62434866a60424fb282fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:50:55 +0000 Subject: [PATCH 242/449] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.5.1 to 3.5.2 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.1 to 3.5.2. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.1...surefire-3.5.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5c73079855..b8d09966fc 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ 1.3.5 1.0.4 3.13.0 - 3.5.1 + 3.5.2 3.8.1 1.11 3.2.7 From 926f408b16306104ba2d1e12291e31f8a5269b88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 16:51:02 +0000 Subject: [PATCH 243/449] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.10.1 to 3.11.1 Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.10.1 to 3.11.1. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.10.1...maven-javadoc-plugin-3.11.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5c73079855..4be7c6d3a4 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 3.2.1 3.3.1 3.3.1 - 3.10.1 + 3.11.1 3.4.2 3.4.0 3.1.0 From 16396dfab333f2e0ec7db8bec5ee401bd73e3a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 5 Nov 2024 10:08:34 +0100 Subject: [PATCH 244/449] Experiment with dynamic-batch approach for publishing --- .../rabbitmq/stream/impl/DynamicBatch.java | 97 ++++++++ .../stream/impl/SimpleMessageAccumulator.java | 9 +- .../rabbitmq/stream/impl/StreamProducer.java | 217 ++++++++++++++---- .../impl/SubEntryMessageAccumulator.java | 15 +- .../stream/impl/DynamicBatchTest.java | 69 ++++++ .../stream/impl/StreamProducerTest.java | 32 +-- .../com/rabbitmq/stream/impl/TestUtils.java | 4 + 7 files changed, 370 insertions(+), 73 deletions(-) create mode 100644 src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java create mode 100644 src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java new file mode 100644 index 0000000000..070f1702e1 --- /dev/null +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java @@ -0,0 +1,97 @@ +// Copyright (c) 2024 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.impl; + +import static java.lang.Math.max; +import static java.lang.Math.min; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicLong; +import java.util.function.Consumer; + +class DynamicBatch { + + private static final int MIN_BATCH_SIZE = 32; + private static final int MAX_BATCH_SIZE = 8192; + + final BlockingQueue requests = new LinkedBlockingQueue<>(); + final Consumer> consumer; + final int configuredBatchSize; + private final AtomicLong count = new AtomicLong(0); + + DynamicBatch(Consumer> consumer, int batchSize) { + this.consumer = consumer; + this.configuredBatchSize = min(max(batchSize, MIN_BATCH_SIZE), MAX_BATCH_SIZE); + new Thread(this::loop).start(); + } + + void add(T item) { + try { + requests.put(item); + this.count.incrementAndGet(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + + private void loop() { + int batchSize = this.configuredBatchSize; + List batch = new ArrayList<>(batchSize); + Thread currentThread = Thread.currentThread(); + T item; + while (!currentThread.isInterrupted()) { + try { + item = this.requests.poll(100, TimeUnit.MILLISECONDS); + } catch (InterruptedException e) { + currentThread.interrupt(); + return; + } + if (item != null) { + batch.add(item); + if (batch.size() >= batchSize) { + this.completeBatch(batch); + batchSize = min(batchSize * 2, MAX_BATCH_SIZE); + batch = new ArrayList<>(batchSize); + } else { + item = this.requests.poll(); + if (item == null) { + this.completeBatch(batch); + batchSize = max(batchSize / 2, MIN_BATCH_SIZE); + batch = new ArrayList<>(batchSize); + } else { + batch.add(item); + if (batch.size() >= batchSize) { + this.completeBatch(batch); + batchSize = min(batchSize * 2, MAX_BATCH_SIZE); + batch = new ArrayList<>(batchSize); + } + } + } + } else { + this.completeBatch(batch); + batchSize = min(batchSize * 2, MAX_BATCH_SIZE); + batch = new ArrayList<>(batchSize); + } + } + } + + private void completeBatch(List items) { + this.consumer.accept(items); + } +} diff --git a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java index 718f253da7..72b0323ae7 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java @@ -103,7 +103,7 @@ public int size() { return messages.size(); } - private static final class SimpleAccumulatedEntity implements AccumulatedEntity { + static final class SimpleAccumulatedEntity implements AccumulatedEntity { private final long time; private final long publishingId; @@ -112,7 +112,7 @@ private static final class SimpleAccumulatedEntity implements AccumulatedEntity private final StreamProducer.ConfirmationCallback confirmationCallback; private final Object observationContext; - private SimpleAccumulatedEntity( + SimpleAccumulatedEntity( long time, long publishingId, String filterValue, @@ -158,13 +158,12 @@ public Object observationContext() { } } - private static final class SimpleConfirmationCallback - implements StreamProducer.ConfirmationCallback { + static final class SimpleConfirmationCallback implements StreamProducer.ConfirmationCallback { private final Message message; private final ConfirmationHandler confirmationHandler; - private SimpleConfirmationCallback(Message message, ConfirmationHandler confirmationHandler) { + SimpleConfirmationCallback(Message message, ConfirmationHandler confirmationHandler) { this.message = message; this.confirmationHandler = confirmationHandler; } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index 4050fd0af7..e648b94dac 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -18,15 +18,9 @@ import static com.rabbitmq.stream.impl.Utils.formatConstant; import static com.rabbitmq.stream.impl.Utils.namedRunnable; -import com.rabbitmq.stream.Codec; -import com.rabbitmq.stream.ConfirmationHandler; -import com.rabbitmq.stream.ConfirmationStatus; -import com.rabbitmq.stream.Constants; -import com.rabbitmq.stream.Message; -import com.rabbitmq.stream.MessageBuilder; -import com.rabbitmq.stream.Producer; -import com.rabbitmq.stream.StreamException; +import com.rabbitmq.stream.*; import com.rabbitmq.stream.compression.Compression; +import com.rabbitmq.stream.compression.CompressionCodec; import com.rabbitmq.stream.impl.Client.Response; import com.rabbitmq.stream.impl.MessageAccumulator.AccumulatedEntity; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -61,7 +55,10 @@ class StreamProducer implements Producer { private static final Logger LOGGER = LoggerFactory.getLogger(StreamProducer.class); private static final ConfirmationHandler NO_OP_CONFIRMATION_HANDLER = confirmationStatus -> {}; private final long id; - private final MessageAccumulator accumulator; + // private final MessageAccumulator accumulator; + private final DynamicBatch dynamicBatch; + private final Clock clock; + private final ToLongFunction accumulatorPublishSequenceFunction; // FIXME investigate a more optimized data structure to handle pending messages private final ConcurrentMap unconfirmedMessages; private final int batchSize; @@ -76,6 +73,8 @@ class StreamProducer implements Producer { private final Codec codec; private final ToLongFunction publishSequenceFunction = entity -> ((AccumulatedEntity) entity).publishingId(); + private final Function filterValueExtractor; + private final ObservationCollector observationCollector; private final long enqueueTimeoutMs; private final boolean blockOnMaxUnconfirmed; private final boolean retryOnRecovery; @@ -114,7 +113,7 @@ class StreamProducer implements Producer { this.closingCallback = environment.registerProducer(this, name, this.stream); final Client.OutboundEntityWriteCallback delegateWriteCallback; AtomicLong publishingSequence = new AtomicLong(computeFirstValueOfPublishingSequence()); - ToLongFunction accumulatorPublishSequenceFunction = + this.accumulatorPublishSequenceFunction = msg -> { if (msg.hasPublishingId()) { return msg.getPublishingId(); @@ -122,37 +121,42 @@ class StreamProducer implements Producer { return publishingSequence.getAndIncrement(); } }; + this.filterValueExtractor = filterValueExtractor == null ? m -> null : filterValueExtractor; + this.clock = environment.clock(); + this.observationCollector = + (ObservationCollector) this.environment.observationCollector(); + if (subEntrySize <= 1) { - this.accumulator = - new SimpleMessageAccumulator( - batchSize, - environment.codec(), - client.maxFrameSize(), - accumulatorPublishSequenceFunction, - filterValueExtractor, - this.environment.clock(), - stream, - this.environment.observationCollector()); + // this.accumulator = + // new SimpleMessageAccumulator( + // batchSize, + // environment.codec(), + // client.maxFrameSize(), + // accumulatorPublishSequenceFunction, + // filterValueExtractor, + // this.environment.clock(), + // stream, + // this.environment.observationCollector()); if (filterValueExtractor == null) { delegateWriteCallback = Client.OUTBOUND_MESSAGE_WRITE_CALLBACK; } else { delegateWriteCallback = OUTBOUND_MSG_FILTER_VALUE_WRITE_CALLBACK; } } else { - this.accumulator = - new SubEntryMessageAccumulator( - subEntrySize, - batchSize, - compression == Compression.NONE - ? null - : environment.compressionCodecFactory().get(compression), - environment.codec(), - this.environment.byteBufAllocator(), - client.maxFrameSize(), - accumulatorPublishSequenceFunction, - this.environment.clock(), - stream, - environment.observationCollector()); + // this.accumulator = + // new SubEntryMessageAccumulator( + // subEntrySize, + // batchSize, + // compression == Compression.NONE + // ? null + // : environment.compressionCodecFactory().get(compression), + // environment.codec(), + // this.environment.byteBufAllocator(), + // client.maxFrameSize(), + // accumulatorPublishSequenceFunction, + // this.environment.clock(), + // stream, + // environment.observationCollector()); delegateWriteCallback = Client.OUTBOUND_MESSAGE_BATCH_WRITE_CALLBACK; } @@ -198,14 +202,122 @@ public int fragmentLength(Object entity) { }; } + if (subEntrySize <= 1) { + this.dynamicBatch = + new DynamicBatch<>( + items -> { + client.publishInternal( + this.publishVersion, + this.publisherId, + items, + this.writeCallback, + this.publishSequenceFunction); + }, + batchSize); + } else { + CompressionCodec compressionCodec = + compression == Compression.NONE + ? null + : environment.compressionCodecFactory().get(compression); + byte compressionCode = + compressionCodec == null ? Compression.NONE.code() : compressionCodec.code(); + this.dynamicBatch = + new DynamicBatch<>( + items -> { + List subBatches = new ArrayList<>(); + int count = 0; + SubEntryMessageAccumulator.Batch batch = + new SubEntryMessageAccumulator.Batch( + Client.EncodedMessageBatch.create( + this.environment.byteBufAllocator(), + compressionCode, + compressionCodec, + subEntrySize), + new SubEntryMessageAccumulator.CompositeConfirmationCallback( + new ArrayList<>(subEntrySize))); + AccumulatedEntity lastMessageInBatch = null; + for (Object msg : items) { + AccumulatedEntity message = (AccumulatedEntity) msg; + this.observationCollector.published( + message.observationContext(), message.confirmationCallback().message()); + lastMessageInBatch = message; + batch.add( + (Codec.EncodedMessage) message.encodedEntity(), + message.confirmationCallback()); + count++; + if (count == subEntrySize) { + batch.time = lastMessageInBatch.time(); + batch.publishingId = lastMessageInBatch.publishingId(); + batch.encodedMessageBatch.close(); + subBatches.add(batch); + lastMessageInBatch = null; + batch = + new SubEntryMessageAccumulator.Batch( + Client.EncodedMessageBatch.create( + this.environment.byteBufAllocator(), + compressionCode, + compressionCodec, + subEntrySize), + new SubEntryMessageAccumulator.CompositeConfirmationCallback( + new ArrayList<>(subEntrySize))); + count = 0; + } + } + + if (!batch.isEmpty() && count < subEntrySize) { + batch.time = lastMessageInBatch.time(); + batch.publishingId = lastMessageInBatch.publishingId(); + batch.encodedMessageBatch.close(); + subBatches.add(batch); + } + + client.publishInternal( + this.publishVersion, + this.publisherId, + subBatches, + this.writeCallback, + this.publishSequenceFunction); + + /* + while (count != subEntrySize) { + AccumulatedEntity message = items.poll(); + if (message == null) { + break; + } + this.observationCollector.published( + message.observationContext(), message.confirmationCallback().message()); + lastMessageInBatch = message; + batch.add((Codec.EncodedMessage) message.encodedEntity(), message.confirmationCallback()); + count++; + } + if (batch.isEmpty()) { + return null; + } else { + batch.time = lastMessageInBatch.time(); + batch.publishingId = lastMessageInBatch.publishingId(); + batch.encodedMessageBatch.close(); + return batch; + } + client.publishInternal( + this.publishVersion, + this.publisherId, + subBatches, + this.writeCallback, + this.publishSequenceFunction); + + */ + }, + batchSize * subEntrySize); + } + if (!batchPublishingDelay.isNegative() && !batchPublishingDelay.isZero()) { AtomicReference taskReference = new AtomicReference<>(); Runnable task = () -> { if (canSend()) { - synchronized (StreamProducer.this) { - publishBatch(true); - } + // synchronized (StreamProducer.this) { + // publishBatch(true); + // } } if (status != Status.CLOSED) { environment @@ -397,11 +509,22 @@ public void send(Message message, ConfirmationHandler confirmationHandler) { private void doSend(Message message, ConfirmationHandler confirmationHandler) { if (canSend()) { - if (accumulator.add(message, confirmationHandler)) { - synchronized (this) { - publishBatch(true); - } - } + long publishingId = this.accumulatorPublishSequenceFunction.applyAsLong(message); + Object observationContext = this.observationCollector.prePublish(this.stream, message); + this.dynamicBatch.add( + new SimpleMessageAccumulator.SimpleAccumulatedEntity( + this.clock.time(), + publishingId, + this.filterValueExtractor.apply(message), + this.codec.encode(message), + new SimpleMessageAccumulator.SimpleConfirmationCallback(message, confirmationHandler), + observationContext)); + + // if (accumulator.add(message, confirmationHandler)) { + // synchronized (this) { + // publishBatch(true); + // } + // } } else { failPublishing(message, confirmationHandler); } @@ -476,12 +599,13 @@ private void cancelConfirmTimeoutTask() { } } + /* private void publishBatch(boolean stateCheck) { if ((!stateCheck || canSend()) && !accumulator.isEmpty()) { List messages = new ArrayList<>(this.batchSize); int batchCount = 0; while (batchCount != this.batchSize) { - Object accMessage = accumulator.get(); + AccumulatedEntity accMessage = accumulator.get(); if (accMessage == null) { break; } @@ -497,6 +621,8 @@ private void publishBatch(boolean stateCheck) { } } + */ + boolean isOpen() { return !this.closed.get(); } @@ -510,7 +636,8 @@ void running() { LOGGER.debug( "Recovering producer with {} unconfirmed message(s) and {} accumulated message(s)", this.unconfirmedMessages.size(), - this.accumulator.size()); + 0); + // this.accumulator.size()); if (this.retryOnRecovery) { LOGGER.debug("Re-publishing {} unconfirmed message(s)", this.unconfirmedMessages.size()); if (!this.unconfirmedMessages.isEmpty()) { @@ -556,7 +683,7 @@ void running() { } } } - publishBatch(false); + // publishBatch(false); int toRelease = maxUnconfirmedMessages - unconfirmedMessagesSemaphore.availablePermits(); if (toRelease > 0) { unconfirmedMessagesSemaphore.release(toRelease); diff --git a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java index 9693aea50c..d2043310b9 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java @@ -95,14 +95,14 @@ public AccumulatedEntity get() { } } - private static class Batch implements AccumulatedEntity { + static class Batch implements AccumulatedEntity { - private final EncodedMessageBatch encodedMessageBatch; + final EncodedMessageBatch encodedMessageBatch; private final CompositeConfirmationCallback confirmationCallback; - private volatile long publishingId; - private volatile long time; + volatile long publishingId; + volatile long time; - private Batch( + Batch( EncodedMessageBatch encodedMessageBatch, CompositeConfirmationCallback confirmationCallback) { this.encodedMessageBatch = encodedMessageBatch; @@ -152,12 +152,11 @@ public Object observationContext() { } } - private static class CompositeConfirmationCallback - implements StreamProducer.ConfirmationCallback { + static class CompositeConfirmationCallback implements StreamProducer.ConfirmationCallback { private final List callbacks; - private CompositeConfirmationCallback(List callbacks) { + CompositeConfirmationCallback(List callbacks) { this.callbacks = callbacks; } diff --git a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java new file mode 100644 index 0000000000..9680845842 --- /dev/null +++ b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java @@ -0,0 +1,69 @@ +// Copyright (c) 2024 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.impl; + +import com.codahale.metrics.ConsoleReporter; +import com.codahale.metrics.Histogram; +import com.codahale.metrics.MetricRegistry; +import com.google.common.util.concurrent.RateLimiter; +import java.time.Duration; +import java.util.Random; +import java.util.concurrent.TimeUnit; +import java.util.stream.IntStream; +import org.junit.jupiter.api.Test; + +public class DynamicBatchTest { + + @Test + void test() { + MetricRegistry metrics = new MetricRegistry(); + Histogram batchSizeMetrics = metrics.histogram("batch-size"); + ConsoleReporter reporter = + ConsoleReporter.forRegistry(metrics) + .convertRatesTo(TimeUnit.SECONDS) + .convertDurationsTo(TimeUnit.MILLISECONDS) + .build(); + + int itemCount = 3000; + TestUtils.Sync sync = TestUtils.sync(itemCount); + Random random = new Random(); + DynamicBatch batch = + new DynamicBatch<>( + items -> { + // System.out.println(System.currentTimeMillis()); + // System.out.println(items.size()); + batchSizeMetrics.update(items.size()); + sync.down(items.size()); + try { + Thread.sleep(random.nextInt(10) + 1); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + }, + 100); + RateLimiter rateLimiter = RateLimiter.create(3000); + long start = System.nanoTime(); + IntStream.range(0, itemCount) + .forEach( + i -> { + rateLimiter.acquire(); + batch.add(String.valueOf(i)); + }); + Assertions.assertThat(sync).completes(); + long end = System.nanoTime(); + System.out.println("Done in " + Duration.ofNanos(end - start)); + reporter.report(); + } +} diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java index 6cf06356d0..9c08a29332 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java @@ -14,10 +14,8 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; -import static com.rabbitmq.stream.impl.TestUtils.latchAssert; -import static com.rabbitmq.stream.impl.TestUtils.localhost; -import static com.rabbitmq.stream.impl.TestUtils.streamName; -import static com.rabbitmq.stream.impl.TestUtils.waitAtMost; +import static com.rabbitmq.stream.impl.Assertions.assertThat; +import static com.rabbitmq.stream.impl.TestUtils.*; import static java.lang.String.format; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; @@ -27,6 +25,7 @@ import com.rabbitmq.stream.compression.Compression; import com.rabbitmq.stream.impl.MonitoringTestUtils.ProducerInfo; import com.rabbitmq.stream.impl.StreamProducer.Status; +import com.rabbitmq.stream.impl.TestUtils.Sync; import io.netty.channel.ChannelOption; import io.netty.channel.ConnectTimeoutException; import io.netty.channel.EventLoopGroup; @@ -94,7 +93,7 @@ void tearDown() { void send() throws Exception { int batchSize = 10; int messageCount = 10 * batchSize + 1; // don't want a multiple of batch size - CountDownLatch publishLatch = new CountDownLatch(messageCount); + Sync confirmSync = sync(messageCount); Producer producer = environment.producerBuilder().stream(stream).batchSize(batchSize).build(); AtomicLong count = new AtomicLong(0); AtomicLong sequence = new AtomicLong(0); @@ -117,13 +116,12 @@ void send() throws Exception { idsConfirmed.add( confirmationStatus.getMessage().getProperties().getMessageIdAsLong()); count.incrementAndGet(); - publishLatch.countDown(); + confirmSync.down(); }); }); - boolean completed = publishLatch.await(10, TimeUnit.SECONDS); + assertThat(confirmSync).completes(); assertThat(idsSent).hasSameSizeAs(idsConfirmed); idsSent.forEach(idSent -> assertThat(idsConfirmed).contains(idSent)); - assertThat(completed).isTrue(); ProducerInfo info = MonitoringTestUtils.extract(producer); assertThat(info.getId()).isGreaterThanOrEqualTo(0); @@ -455,12 +453,16 @@ void messagesShouldBeDeDuplicatedWhenUsingNameAndPublishingId(int subEntrySize) .build(); assertThat(consumeLatch.await(10, TimeUnit.SECONDS)).isTrue(); Thread.sleep(1000); - // if we are using sub-entries, we cannot avoid duplicates. - // here, a sub-entry in the second wave, right at the end of the re-submitted - // values will contain those duplicates, because its publishing ID will be - // the one of its last message, so the server will accept the whole sub-entry, - // including the duplicates. - assertThat(consumed.get()).isEqualTo(lineCount + backwardCount % subEntrySize); + if (subEntrySize == 1) { + assertThat(consumed.get()).isEqualTo(lineCount); + } else { + // if we are using sub-entries, we cannot avoid duplicates. + // here, a sub-entry in the second wave, right at the end of the re-submitted + // values will contain those duplicates, because its publishing ID will be + // the one of its last message, so the server will accept the whole sub-entry, + // including the duplicates. + assertThat(consumed.get()).isBetween(lineCount, lineCount + subEntrySize); + } } @ParameterizedTest @@ -636,7 +638,7 @@ void subEntryBatchesSentCompressedShouldBeConsumedProperly() { } @Test - void methodsShouldThrowExceptionWhenProducerIsClosed() throws InterruptedException { + void methodsShouldThrowExceptionWhenProducerIsClosed() { Producer producer = environment.producerBuilder().stream(stream).build(); producer.close(); assertThatThrownBy(() -> producer.getLastPublishingId()) diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index 9ab50aadf7..8700987f0f 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -1138,6 +1138,10 @@ void down() { this.latch.get().countDown(); } + void down(int count) { + IntStream.range(0, count).forEach(ignored -> this.latch.get().countDown()); + } + boolean await(Duration timeout) { try { return this.latch.get().await(timeout.toMillis(), TimeUnit.MILLISECONDS); From 36c264da4440ba8d3933a0a4f2a5dcb70230a2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 5 Nov 2024 16:43:31 +0100 Subject: [PATCH 245/449] Refactor message accumulator abstraction for dynamic batching --- .../stream/impl/MessageAccumulator.java | 21 +- .../rabbitmq/stream/impl/ProducerUtils.java | 207 ++++++++++++++++++ .../stream/impl/SimpleMessageAccumulator.java | 125 ++++------- .../rabbitmq/stream/impl/StreamProducer.java | 160 ++++++-------- .../impl/SubEntryMessageAccumulator.java | 107 +-------- .../stream/impl/StreamProducerTest.java | 21 +- 6 files changed, 335 insertions(+), 306 deletions(-) create mode 100644 src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java diff --git a/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java index c35271f29f..ff0c592317 100644 --- a/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java @@ -19,26 +19,9 @@ interface MessageAccumulator { - boolean add(Message message, ConfirmationHandler confirmationHandler); - - AccumulatedEntity get(); - - boolean isEmpty(); + void add(Message message, ConfirmationHandler confirmationHandler); int size(); - interface AccumulatedEntity { - - long time(); - - long publishingId(); - - String filterValue(); - - Object encodedEntity(); - - StreamProducer.ConfirmationCallback confirmationCallback(); - - Object observationContext(); - } + void flush(boolean force); } diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java b/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java new file mode 100644 index 0000000000..4933932755 --- /dev/null +++ b/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java @@ -0,0 +1,207 @@ +// Copyright (c) 2024 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.impl; + +import com.rabbitmq.stream.Codec; +import com.rabbitmq.stream.ConfirmationHandler; +import com.rabbitmq.stream.ConfirmationStatus; +import com.rabbitmq.stream.Message; +import java.util.List; + +final class ProducerUtils { + + private ProducerUtils() {} + + interface ConfirmationCallback { + + int handle(boolean confirmed, short code); + + Message message(); + } + + interface AccumulatedEntity { + + long time(); + + long publishingId(); + + String filterValue(); + + Object encodedEntity(); + + ConfirmationCallback confirmationCallback(); + + Object observationContext(); + } + + static final class SimpleConfirmationCallback implements ConfirmationCallback { + + private final Message message; + private final ConfirmationHandler confirmationHandler; + + SimpleConfirmationCallback(Message message, ConfirmationHandler confirmationHandler) { + this.message = message; + this.confirmationHandler = confirmationHandler; + } + + @Override + public int handle(boolean confirmed, short code) { + confirmationHandler.handle(new ConfirmationStatus(message, confirmed, code)); + return 1; + } + + @Override + public Message message() { + return this.message; + } + } + + static final class SimpleAccumulatedEntity implements AccumulatedEntity { + + private final long time; + private final long publishingId; + private final String filterValue; + private final Codec.EncodedMessage encodedMessage; + private final ConfirmationCallback confirmationCallback; + private final Object observationContext; + + SimpleAccumulatedEntity( + long time, + long publishingId, + String filterValue, + Codec.EncodedMessage encodedMessage, + ConfirmationCallback confirmationCallback, + Object observationContext) { + this.time = time; + this.publishingId = publishingId; + this.encodedMessage = encodedMessage; + this.filterValue = filterValue; + this.confirmationCallback = confirmationCallback; + this.observationContext = observationContext; + } + + @Override + public long publishingId() { + return publishingId; + } + + @Override + public String filterValue() { + return filterValue; + } + + @Override + public Object encodedEntity() { + return encodedMessage; + } + + @Override + public long time() { + return time; + } + + @Override + public ConfirmationCallback confirmationCallback() { + return confirmationCallback; + } + + @Override + public Object observationContext() { + return this.observationContext; + } + } + + static final class CompositeConfirmationCallback implements ConfirmationCallback { + + private final List callbacks; + + CompositeConfirmationCallback(List callbacks) { + this.callbacks = callbacks; + } + + private void add(ConfirmationCallback confirmationCallback) { + this.callbacks.add(confirmationCallback); + } + + @Override + public int handle(boolean confirmed, short code) { + for (ConfirmationCallback callback : callbacks) { + callback.handle(confirmed, code); + } + return callbacks.size(); + } + + @Override + public Message message() { + throw new UnsupportedOperationException( + "composite confirmation callback does not contain just one message"); + } + } + + static final class Batch implements AccumulatedEntity { + + final Client.EncodedMessageBatch encodedMessageBatch; + private final CompositeConfirmationCallback confirmationCallback; + volatile long publishingId; + volatile long time; + + Batch( + Client.EncodedMessageBatch encodedMessageBatch, + CompositeConfirmationCallback confirmationCallback) { + this.encodedMessageBatch = encodedMessageBatch; + this.confirmationCallback = confirmationCallback; + } + + void add(Codec.EncodedMessage encodedMessage, ConfirmationCallback confirmationCallback) { + this.encodedMessageBatch.add(encodedMessage); + this.confirmationCallback.add(confirmationCallback); + } + + boolean isEmpty() { + return this.confirmationCallback.callbacks.isEmpty(); + } + + @Override + public long publishingId() { + return publishingId; + } + + @Override + public String filterValue() { + return null; + } + + @Override + public Object encodedEntity() { + return encodedMessageBatch; + } + + @Override + public long time() { + return time; + } + + @Override + public ConfirmationCallback confirmationCallback() { + return confirmationCallback; + } + + @Override + public Object observationContext() { + throw new UnsupportedOperationException( + "batch entity does not contain only one observation context"); + } + } +} diff --git a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java index 72b0323ae7..90a70e43a3 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java @@ -15,9 +15,12 @@ package com.rabbitmq.stream.impl; import com.rabbitmq.stream.*; +import java.util.ArrayList; +import java.util.List; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.function.ToLongFunction; @@ -25,7 +28,7 @@ class SimpleMessageAccumulator implements MessageAccumulator { private static final Function NULL_FILTER_VALUE_EXTRACTOR = m -> null; - protected final BlockingQueue messages; + protected final BlockingQueue messages; protected final Clock clock; private final int capacity; protected final Codec codec; @@ -34,6 +37,7 @@ class SimpleMessageAccumulator implements MessageAccumulator { private final Function filterValueExtractor; final String stream; final ObservationCollector observationCollector; + private final StreamProducer producer; @SuppressWarnings("unchecked") SimpleMessageAccumulator( @@ -44,7 +48,8 @@ class SimpleMessageAccumulator implements MessageAccumulator { Function filterValueExtractor, Clock clock, String stream, - ObservationCollector observationCollector) { + ObservationCollector observationCollector, + StreamProducer producer) { this.capacity = capacity; this.messages = new LinkedBlockingQueue<>(capacity); this.codec = codec; @@ -55,9 +60,10 @@ class SimpleMessageAccumulator implements MessageAccumulator { this.clock = clock; this.stream = stream; this.observationCollector = (ObservationCollector) observationCollector; + this.producer = producer; } - public boolean add(Message message, ConfirmationHandler confirmationHandler) { + public void add(Message message, ConfirmationHandler confirmationHandler) { Object observationContext = this.observationCollector.prePublish(this.stream, message); Codec.EncodedMessage encodedMessage = this.codec.encode(message); Client.checkMessageFitsInFrame(this.maxFrameSize, encodedMessage); @@ -65,12 +71,12 @@ public boolean add(Message message, ConfirmationHandler confirmationHandler) { try { boolean offered = messages.offer( - new SimpleAccumulatedEntity( + new ProducerUtils.SimpleAccumulatedEntity( clock.time(), publishingId, this.filterValueExtractor.apply(message), encodedMessage, - new SimpleConfirmationCallback(message, confirmationHandler), + new ProducerUtils.SimpleConfirmationCallback(message, confirmationHandler), observationContext), 60, TimeUnit.SECONDS); @@ -80,12 +86,15 @@ public boolean add(Message message, ConfirmationHandler confirmationHandler) { } catch (InterruptedException e) { throw new StreamException("Error while accumulating outbound message", e); } - return this.messages.size() == this.capacity; + if (this.messages.size() == this.capacity) { + synchronized (this.producer) { + publishBatch(true); + } + } } - @Override - public AccumulatedEntity get() { - AccumulatedEntity entity = this.messages.poll(); + ProducerUtils.AccumulatedEntity get() { + ProducerUtils.AccumulatedEntity entity = this.messages.poll(); if (entity != null) { this.observationCollector.published( entity.observationContext(), entity.confirmationCallback().message()); @@ -93,90 +102,36 @@ public AccumulatedEntity get() { return entity; } - @Override - public boolean isEmpty() { - return messages.isEmpty(); - } - @Override public int size() { return messages.size(); } - static final class SimpleAccumulatedEntity implements AccumulatedEntity { - - private final long time; - private final long publishingId; - private final String filterValue; - private final Codec.EncodedMessage encodedMessage; - private final StreamProducer.ConfirmationCallback confirmationCallback; - private final Object observationContext; - - SimpleAccumulatedEntity( - long time, - long publishingId, - String filterValue, - Codec.EncodedMessage encodedMessage, - StreamProducer.ConfirmationCallback confirmationCallback, - Object observationContext) { - this.time = time; - this.publishingId = publishingId; - this.encodedMessage = encodedMessage; - this.filterValue = filterValue; - this.confirmationCallback = confirmationCallback; - this.observationContext = observationContext; - } - - @Override - public long publishingId() { - return publishingId; - } - - @Override - public String filterValue() { - return filterValue; - } - - @Override - public Object encodedEntity() { - return encodedMessage; - } - - @Override - public long time() { - return time; - } - - @Override - public StreamProducer.ConfirmationCallback confirmationCallback() { - return confirmationCallback; - } - - @Override - public Object observationContext() { - return this.observationContext; + @Override + public void flush(boolean force) { + boolean stateCheck = !force; + synchronized (this.producer) { + publishBatch(stateCheck); } + // System.out.println(sent.get()); } - static final class SimpleConfirmationCallback implements StreamProducer.ConfirmationCallback { - - private final Message message; - private final ConfirmationHandler confirmationHandler; - - SimpleConfirmationCallback(Message message, ConfirmationHandler confirmationHandler) { - this.message = message; - this.confirmationHandler = confirmationHandler; - } - - @Override - public int handle(boolean confirmed, short code) { - confirmationHandler.handle(new ConfirmationStatus(message, confirmed, code)); - return 1; - } - - @Override - public Message message() { - return this.message; + AtomicInteger sent = new AtomicInteger(); + + private void publishBatch(boolean stateCheck) { + if ((!stateCheck || this.producer.canSend()) && !this.messages.isEmpty()) { + List entities = new ArrayList<>(this.capacity); + int batchCount = 0; + while (batchCount != this.capacity) { + ProducerUtils.AccumulatedEntity entity = this.get(); + if (entity == null) { + break; + } + entities.add(entity); + batchCount++; + } + this.sent.addAndGet(entities.size()); + producer.publishInternal(entities); } } } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index e648b94dac..8c1de81345 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -20,9 +20,8 @@ import com.rabbitmq.stream.*; import com.rabbitmq.stream.compression.Compression; -import com.rabbitmq.stream.compression.CompressionCodec; import com.rabbitmq.stream.impl.Client.Response; -import com.rabbitmq.stream.impl.MessageAccumulator.AccumulatedEntity; +import com.rabbitmq.stream.impl.ProducerUtils.AccumulatedEntity; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.netty.buffer.ByteBuf; import java.nio.charset.StandardCharsets; @@ -55,8 +54,8 @@ class StreamProducer implements Producer { private static final Logger LOGGER = LoggerFactory.getLogger(StreamProducer.class); private static final ConfirmationHandler NO_OP_CONFIRMATION_HANDLER = confirmationStatus -> {}; private final long id; - // private final MessageAccumulator accumulator; - private final DynamicBatch dynamicBatch; + private final MessageAccumulator accumulator; + // private final DynamicBatch dynamicBatch; private final Clock clock; private final ToLongFunction accumulatorPublishSequenceFunction; // FIXME investigate a more optimized data structure to handle pending messages @@ -127,36 +126,38 @@ class StreamProducer implements Producer { (ObservationCollector) this.environment.observationCollector(); if (subEntrySize <= 1) { - // this.accumulator = - // new SimpleMessageAccumulator( - // batchSize, - // environment.codec(), - // client.maxFrameSize(), - // accumulatorPublishSequenceFunction, - // filterValueExtractor, - // this.environment.clock(), - // stream, - // this.environment.observationCollector()); + this.accumulator = + new SimpleMessageAccumulator( + batchSize, + environment.codec(), + client.maxFrameSize(), + accumulatorPublishSequenceFunction, + filterValueExtractor, + this.environment.clock(), + stream, + this.environment.observationCollector(), + this); if (filterValueExtractor == null) { delegateWriteCallback = Client.OUTBOUND_MESSAGE_WRITE_CALLBACK; } else { delegateWriteCallback = OUTBOUND_MSG_FILTER_VALUE_WRITE_CALLBACK; } } else { - // this.accumulator = - // new SubEntryMessageAccumulator( - // subEntrySize, - // batchSize, - // compression == Compression.NONE - // ? null - // : environment.compressionCodecFactory().get(compression), - // environment.codec(), - // this.environment.byteBufAllocator(), - // client.maxFrameSize(), - // accumulatorPublishSequenceFunction, - // this.environment.clock(), - // stream, - // environment.observationCollector()); + this.accumulator = + new SubEntryMessageAccumulator( + subEntrySize, + batchSize, + compression == Compression.NONE + ? null + : environment.compressionCodecFactory().get(compression), + environment.codec(), + this.environment.byteBufAllocator(), + client.maxFrameSize(), + accumulatorPublishSequenceFunction, + this.environment.clock(), + stream, + environment.observationCollector(), + this); delegateWriteCallback = Client.OUTBOUND_MESSAGE_BATCH_WRITE_CALLBACK; } @@ -170,8 +171,7 @@ class StreamProducer implements Producer { new Client.OutboundEntityWriteCallback() { @Override public int write(ByteBuf bb, Object entity, long publishingId) { - MessageAccumulator.AccumulatedEntity accumulatedEntity = - (MessageAccumulator.AccumulatedEntity) entity; + AccumulatedEntity accumulatedEntity = (AccumulatedEntity) entity; unconfirmedMessages.put(publishingId, accumulatedEntity); return delegateWriteCallback.write( bb, accumulatedEntity.encodedEntity(), publishingId); @@ -180,7 +180,7 @@ public int write(ByteBuf bb, Object entity, long publishingId) { @Override public int fragmentLength(Object entity) { return delegateWriteCallback.fragmentLength( - ((MessageAccumulator.AccumulatedEntity) entity).encodedEntity()); + ((AccumulatedEntity) entity).encodedEntity()); } }; } else { @@ -189,8 +189,7 @@ public int fragmentLength(Object entity) { new Client.OutboundEntityWriteCallback() { @Override public int write(ByteBuf bb, Object entity, long publishingId) { - MessageAccumulator.AccumulatedEntity accumulatedEntity = - (MessageAccumulator.AccumulatedEntity) entity; + AccumulatedEntity accumulatedEntity = (AccumulatedEntity) entity; unconfirmedMessages.put(publishingId, accumulatedEntity); return delegateWriteCallback.write(bb, accumulatedEntity, publishingId); } @@ -202,6 +201,7 @@ public int fragmentLength(Object entity) { }; } + /* if (subEntrySize <= 1) { this.dynamicBatch = new DynamicBatch<>( @@ -226,14 +226,14 @@ public int fragmentLength(Object entity) { items -> { List subBatches = new ArrayList<>(); int count = 0; - SubEntryMessageAccumulator.Batch batch = - new SubEntryMessageAccumulator.Batch( + ProducerUtils.Batch batch = + new ProducerUtils.Batch( Client.EncodedMessageBatch.create( this.environment.byteBufAllocator(), compressionCode, compressionCodec, subEntrySize), - new SubEntryMessageAccumulator.CompositeConfirmationCallback( + new ProducerUtils.CompositeConfirmationCallback( new ArrayList<>(subEntrySize))); AccumulatedEntity lastMessageInBatch = null; for (Object msg : items) { @@ -252,13 +252,13 @@ public int fragmentLength(Object entity) { subBatches.add(batch); lastMessageInBatch = null; batch = - new SubEntryMessageAccumulator.Batch( + new ProducerUtils.Batch( Client.EncodedMessageBatch.create( this.environment.byteBufAllocator(), compressionCode, compressionCodec, subEntrySize), - new SubEntryMessageAccumulator.CompositeConfirmationCallback( + new ProducerUtils.CompositeConfirmationCallback( new ArrayList<>(subEntrySize))); count = 0; } @@ -278,46 +278,17 @@ public int fragmentLength(Object entity) { this.writeCallback, this.publishSequenceFunction); - /* - while (count != subEntrySize) { - AccumulatedEntity message = items.poll(); - if (message == null) { - break; - } - this.observationCollector.published( - message.observationContext(), message.confirmationCallback().message()); - lastMessageInBatch = message; - batch.add((Codec.EncodedMessage) message.encodedEntity(), message.confirmationCallback()); - count++; - } - if (batch.isEmpty()) { - return null; - } else { - batch.time = lastMessageInBatch.time(); - batch.publishingId = lastMessageInBatch.publishingId(); - batch.encodedMessageBatch.close(); - return batch; - } - client.publishInternal( - this.publishVersion, - this.publisherId, - subBatches, - this.writeCallback, - this.publishSequenceFunction); - - */ }, batchSize * subEntrySize); } + */ if (!batchPublishingDelay.isNegative() && !batchPublishingDelay.isZero()) { AtomicReference taskReference = new AtomicReference<>(); Runnable task = () -> { if (canSend()) { - // synchronized (StreamProducer.this) { - // publishBatch(true); - // } + this.accumulator.flush(false); } if (status != Status.CLOSED) { environment @@ -509,22 +480,18 @@ public void send(Message message, ConfirmationHandler confirmationHandler) { private void doSend(Message message, ConfirmationHandler confirmationHandler) { if (canSend()) { - long publishingId = this.accumulatorPublishSequenceFunction.applyAsLong(message); - Object observationContext = this.observationCollector.prePublish(this.stream, message); - this.dynamicBatch.add( - new SimpleMessageAccumulator.SimpleAccumulatedEntity( - this.clock.time(), - publishingId, - this.filterValueExtractor.apply(message), - this.codec.encode(message), - new SimpleMessageAccumulator.SimpleConfirmationCallback(message, confirmationHandler), - observationContext)); - - // if (accumulator.add(message, confirmationHandler)) { - // synchronized (this) { - // publishBatch(true); - // } - // } + // long publishingId = this.accumulatorPublishSequenceFunction.applyAsLong(message); + // Object observationContext = this.observationCollector.prePublish(this.stream, + // message); + // this.dynamicBatch.add( + // new ProducerUtils.SimpleAccumulatedEntity( + // this.clock.time(), + // publishingId, + // this.filterValueExtractor.apply(message), + // this.codec.encode(message), + // new ProducerUtils.SimpleConfirmationCallback(message, confirmationHandler), + // observationContext)); + this.accumulator.add(message, confirmationHandler); } else { failPublishing(message, confirmationHandler); } @@ -542,7 +509,7 @@ private void failPublishing(Message message, ConfirmationHandler confirmationHan } } - private boolean canSend() { + boolean canSend() { return this.status == Status.RUNNING; } @@ -623,6 +590,15 @@ private void publishBatch(boolean stateCheck) { */ + void publishInternal(List messages) { + client.publishInternal( + this.publishVersion, + this.publisherId, + messages, + this.writeCallback, + this.publishSequenceFunction); + } + boolean isOpen() { return !this.closed.get(); } @@ -636,8 +612,7 @@ void running() { LOGGER.debug( "Recovering producer with {} unconfirmed message(s) and {} accumulated message(s)", this.unconfirmedMessages.size(), - 0); - // this.accumulator.size()); + this.accumulator.size()); if (this.retryOnRecovery) { LOGGER.debug("Re-publishing {} unconfirmed message(s)", this.unconfirmedMessages.size()); if (!this.unconfirmedMessages.isEmpty()) { @@ -683,7 +658,7 @@ void running() { } } } - // publishBatch(false); + this.accumulator.flush(true); int toRelease = maxUnconfirmedMessages - unconfirmedMessagesSemaphore.availablePermits(); if (toRelease > 0) { unconfirmedMessagesSemaphore.release(toRelease); @@ -715,13 +690,6 @@ enum Status { CLOSED } - interface ConfirmationCallback { - - int handle(boolean confirmed, short code); - - Message message(); - } - @Override public boolean equals(Object o) { if (this == o) { diff --git a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java index d2043310b9..dd15601e10 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java @@ -23,10 +23,9 @@ import com.rabbitmq.stream.impl.Client.EncodedMessageBatch; import io.netty.buffer.ByteBufAllocator; import java.util.ArrayList; -import java.util.List; import java.util.function.ToLongFunction; -class SubEntryMessageAccumulator extends SimpleMessageAccumulator { +final class SubEntryMessageAccumulator extends SimpleMessageAccumulator { private final int subEntrySize; private final CompressionCodec compressionCodec; @@ -43,7 +42,8 @@ public SubEntryMessageAccumulator( ToLongFunction publishSequenceFunction, Clock clock, String stream, - ObservationCollector observationCollector) { + ObservationCollector observationCollector, + StreamProducer producer) { super( subEntrySize * batchSize, codec, @@ -52,30 +52,31 @@ public SubEntryMessageAccumulator( null, clock, stream, - observationCollector); + observationCollector, + producer); this.subEntrySize = subEntrySize; this.compressionCodec = compressionCodec; this.compression = compressionCodec == null ? Compression.NONE.code() : compressionCodec.code(); this.byteBufAllocator = byteBufAllocator; } - private Batch createBatch() { - return new Batch( + private ProducerUtils.Batch createBatch() { + return new ProducerUtils.Batch( EncodedMessageBatch.create( byteBufAllocator, compression, compressionCodec, this.subEntrySize), - new CompositeConfirmationCallback(new ArrayList<>(this.subEntrySize))); + new ProducerUtils.CompositeConfirmationCallback(new ArrayList<>(this.subEntrySize))); } @Override - public AccumulatedEntity get() { + protected ProducerUtils.AccumulatedEntity get() { if (this.messages.isEmpty()) { return null; } int count = 0; - Batch batch = createBatch(); - AccumulatedEntity lastMessageInBatch = null; + ProducerUtils.Batch batch = createBatch(); + ProducerUtils.AccumulatedEntity lastMessageInBatch = null; while (count != this.subEntrySize) { - AccumulatedEntity message = messages.poll(); + ProducerUtils.AccumulatedEntity message = messages.poll(); if (message == null) { break; } @@ -94,88 +95,4 @@ public AccumulatedEntity get() { return batch; } } - - static class Batch implements AccumulatedEntity { - - final EncodedMessageBatch encodedMessageBatch; - private final CompositeConfirmationCallback confirmationCallback; - volatile long publishingId; - volatile long time; - - Batch( - EncodedMessageBatch encodedMessageBatch, - CompositeConfirmationCallback confirmationCallback) { - this.encodedMessageBatch = encodedMessageBatch; - this.confirmationCallback = confirmationCallback; - } - - void add( - Codec.EncodedMessage encodedMessage, - StreamProducer.ConfirmationCallback confirmationCallback) { - this.encodedMessageBatch.add(encodedMessage); - this.confirmationCallback.add(confirmationCallback); - } - - boolean isEmpty() { - return this.confirmationCallback.callbacks.isEmpty(); - } - - @Override - public long publishingId() { - return publishingId; - } - - @Override - public String filterValue() { - return null; - } - - @Override - public Object encodedEntity() { - return encodedMessageBatch; - } - - @Override - public long time() { - return time; - } - - @Override - public StreamProducer.ConfirmationCallback confirmationCallback() { - return confirmationCallback; - } - - @Override - public Object observationContext() { - throw new UnsupportedOperationException( - "batch entity does not contain only one observation context"); - } - } - - static class CompositeConfirmationCallback implements StreamProducer.ConfirmationCallback { - - private final List callbacks; - - CompositeConfirmationCallback(List callbacks) { - this.callbacks = callbacks; - } - - private void add(StreamProducer.ConfirmationCallback confirmationCallback) { - this.callbacks.add(confirmationCallback); - } - - @Override - public int handle(boolean confirmed, short code) { - for (StreamProducer.ConfirmationCallback callback : callbacks) { - callback.handle(confirmed, code); - } - return callbacks.size(); - } - - @Override - public Message message() { - throw new UnsupportedOperationException( - "composite confirmation callback does not contain just one message"); - } - } } diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java index 9c08a29332..19be5ea05b 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java @@ -413,15 +413,14 @@ void messagesShouldBeDeDuplicatedWhenUsingNameAndPublishingId(int subEntrySize) int firstWaveLineCount = lineCount / 5; int backwardCount = firstWaveLineCount / 10; SortedSet document = new TreeSet<>(); - IntStream.range(0, lineCount).forEach(i -> document.add(i)); + IntStream.range(0, lineCount).forEach(document::add); Producer producer = environment.producerBuilder().name("producer-1").stream(stream) .subEntrySize(subEntrySize) .build(); - AtomicReference latch = - new AtomicReference<>(new CountDownLatch(firstWaveLineCount)); - ConfirmationHandler confirmationHandler = confirmationStatus -> latch.get().countDown(); + Sync confirmSync = sync(firstWaveLineCount); + ConfirmationHandler confirmationHandler = confirmationStatus -> confirmSync.down(); Consumer publishMessage = i -> producer.send( @@ -431,15 +430,17 @@ void messagesShouldBeDeDuplicatedWhenUsingNameAndPublishingId(int subEntrySize) .addData(String.valueOf(i).getBytes()) .build(), confirmationHandler); + // publish the first wave document.headSet(firstWaveLineCount).forEach(publishMessage); - assertThat(latch.get().await(10, TimeUnit.SECONDS)).isTrue(); + assertThat(confirmSync).completes(); - latch.set(new CountDownLatch(lineCount - firstWaveLineCount + backwardCount)); + confirmSync.reset(lineCount - firstWaveLineCount + backwardCount); + // publish the rest, but with some overlap from the first wave document.tailSet(firstWaveLineCount - backwardCount).forEach(publishMessage); - assertThat(latch.get().await(5, TimeUnit.SECONDS)).isTrue(); + assertThat(confirmSync).completes(); CountDownLatch consumeLatch = new CountDownLatch(lineCount); AtomicInteger consumed = new AtomicInteger(); @@ -451,8 +452,7 @@ void messagesShouldBeDeDuplicatedWhenUsingNameAndPublishingId(int subEntrySize) consumeLatch.countDown(); }) .build(); - assertThat(consumeLatch.await(10, TimeUnit.SECONDS)).isTrue(); - Thread.sleep(1000); + assertThat(consumeLatch.await(5, TimeUnit.SECONDS)).isTrue(); if (subEntrySize == 1) { assertThat(consumed.get()).isEqualTo(lineCount); } else { @@ -641,8 +641,7 @@ void subEntryBatchesSentCompressedShouldBeConsumedProperly() { void methodsShouldThrowExceptionWhenProducerIsClosed() { Producer producer = environment.producerBuilder().stream(stream).build(); producer.close(); - assertThatThrownBy(() -> producer.getLastPublishingId()) - .isInstanceOf(IllegalStateException.class); + assertThatThrownBy(producer::getLastPublishingId).isInstanceOf(IllegalStateException.class); } @Test From 817d57a2a2ec0e84f366ffc3b2053ec698d403e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 5 Nov 2024 18:27:05 +0100 Subject: [PATCH 246/449] Add dynamic-batch message accumulator --- .../rabbitmq/stream/impl/DynamicBatch.java | 53 +++--- .../impl/DynamicBatchMessageAccumulator.java | 162 ++++++++++++++++++ .../rabbitmq/stream/impl/ProducerUtils.java | 66 ++++++- .../stream/impl/SimpleMessageAccumulator.java | 14 +- .../rabbitmq/stream/impl/StreamProducer.java | 89 +++++----- .../impl/SubEntryMessageAccumulator.java | 2 +- .../stream/impl/DynamicBatchTest.java | 3 +- .../stream/impl/StreamProducerUnitTest.java | 3 + 8 files changed, 312 insertions(+), 80 deletions(-) create mode 100644 src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java index 070f1702e1..a2dc00acd7 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java @@ -22,20 +22,21 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicLong; -import java.util.function.Consumer; +import java.util.function.Predicate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; class DynamicBatch { + private static final Logger LOGGER = LoggerFactory.getLogger(DynamicBatch.class); private static final int MIN_BATCH_SIZE = 32; private static final int MAX_BATCH_SIZE = 8192; - final BlockingQueue requests = new LinkedBlockingQueue<>(); - final Consumer> consumer; - final int configuredBatchSize; - private final AtomicLong count = new AtomicLong(0); + private final BlockingQueue requests = new LinkedBlockingQueue<>(); + private final Predicate> consumer; + private final int configuredBatchSize; - DynamicBatch(Consumer> consumer, int batchSize) { + DynamicBatch(Predicate> consumer, int batchSize) { this.consumer = consumer; this.configuredBatchSize = min(max(batchSize, MIN_BATCH_SIZE), MAX_BATCH_SIZE); new Thread(this::loop).start(); @@ -44,7 +45,6 @@ class DynamicBatch { void add(T item) { try { requests.put(item); - this.count.incrementAndGet(); } catch (InterruptedException e) { throw new RuntimeException(e); } @@ -65,33 +65,42 @@ private void loop() { if (item != null) { batch.add(item); if (batch.size() >= batchSize) { - this.completeBatch(batch); - batchSize = min(batchSize * 2, MAX_BATCH_SIZE); - batch = new ArrayList<>(batchSize); + if (this.completeBatch(batch)) { + batchSize = min(batchSize * 2, MAX_BATCH_SIZE); + batch = new ArrayList<>(batchSize); + } } else { item = this.requests.poll(); if (item == null) { - this.completeBatch(batch); - batchSize = max(batchSize / 2, MIN_BATCH_SIZE); - batch = new ArrayList<>(batchSize); + if (this.completeBatch(batch)) { + batchSize = max(batchSize / 2, MIN_BATCH_SIZE); + batch = new ArrayList<>(batchSize); + } } else { batch.add(item); if (batch.size() >= batchSize) { - this.completeBatch(batch); - batchSize = min(batchSize * 2, MAX_BATCH_SIZE); - batch = new ArrayList<>(batchSize); + if (this.completeBatch(batch)) { + batchSize = min(batchSize * 2, MAX_BATCH_SIZE); + batch = new ArrayList<>(batchSize); + } } } } } else { - this.completeBatch(batch); - batchSize = min(batchSize * 2, MAX_BATCH_SIZE); - batch = new ArrayList<>(batchSize); + if (this.completeBatch(batch)) { + batchSize = min(batchSize * 2, MAX_BATCH_SIZE); + batch = new ArrayList<>(batchSize); + } } } } - private void completeBatch(List items) { - this.consumer.accept(items); + private boolean completeBatch(List items) { + try { + return this.consumer.test(items); + } catch (Exception e) { + LOGGER.warn("Error during dynamic batch completion: {}", e.getMessage()); + return false; + } } } diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java new file mode 100644 index 0000000000..11b1a768b0 --- /dev/null +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java @@ -0,0 +1,162 @@ +// Copyright (c) 2024 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.impl; + +import com.rabbitmq.stream.Codec; +import com.rabbitmq.stream.ConfirmationHandler; +import com.rabbitmq.stream.Message; +import com.rabbitmq.stream.ObservationCollector; +import com.rabbitmq.stream.compression.Compression; +import com.rabbitmq.stream.compression.CompressionCodec; +import com.rabbitmq.stream.impl.ProducerUtils.AccumulatedEntity; +import io.netty.buffer.ByteBufAllocator; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Function; +import java.util.function.ToLongFunction; + +final class DynamicBatchMessageAccumulator implements MessageAccumulator { + + private static final Function NULL_FILTER_VALUE_EXTRACTOR = m -> null; + + private final DynamicBatch dynamicBatch; + private final ObservationCollector observationCollector; + private final ToLongFunction publishSequenceFunction; + private final String stream; + private final StreamProducer producer; + private final Codec codec; + private final int maxFrameSize; + private final Clock clock; + private final Function filterValueExtractor; + + @SuppressWarnings("unchecked") + DynamicBatchMessageAccumulator( + int subEntrySize, + int batchSize, + Codec codec, + int maxFrameSize, + ToLongFunction publishSequenceFunction, + Function filterValueExtractor, + Clock clock, + String stream, + CompressionCodec compressionCodec, + ByteBufAllocator byteBufAllocator, + ObservationCollector observationCollector, + StreamProducer producer) { + this.producer = producer; + this.stream = stream; + this.publishSequenceFunction = publishSequenceFunction; + this.observationCollector = (ObservationCollector) observationCollector; + this.codec = codec; + this.clock = clock; + this.maxFrameSize = maxFrameSize; + this.filterValueExtractor = + filterValueExtractor == null ? NULL_FILTER_VALUE_EXTRACTOR : filterValueExtractor; + if (subEntrySize <= 1) { + this.dynamicBatch = new DynamicBatch<>(this::publish, batchSize); + } else { + byte compressionCode = + compressionCodec == null ? Compression.NONE.code() : compressionCodec.code(); + this.dynamicBatch = + new DynamicBatch<>( + items -> { + if (this.producer.canSend()) { + List subBatches = new ArrayList<>(); + int count = 0; + ProducerUtils.Batch batch = + new ProducerUtils.Batch( + Client.EncodedMessageBatch.create( + byteBufAllocator, compressionCode, compressionCodec, subEntrySize), + new ProducerUtils.CompositeConfirmationCallback( + new ArrayList<>(subEntrySize))); + AccumulatedEntity lastMessageInBatch = null; + for (Object msg : items) { + AccumulatedEntity message = (AccumulatedEntity) msg; + this.observationCollector.published( + message.observationContext(), message.confirmationCallback().message()); + lastMessageInBatch = message; + batch.add( + (Codec.EncodedMessage) message.encodedEntity(), + message.confirmationCallback()); + count++; + if (count == subEntrySize) { + batch.time = lastMessageInBatch.time(); + batch.publishingId = lastMessageInBatch.publishingId(); + batch.encodedMessageBatch.close(); + subBatches.add(batch); + lastMessageInBatch = null; + batch = + new ProducerUtils.Batch( + Client.EncodedMessageBatch.create( + byteBufAllocator, + compressionCode, + compressionCodec, + subEntrySize), + new ProducerUtils.CompositeConfirmationCallback( + new ArrayList<>(subEntrySize))); + count = 0; + } + } + + if (!batch.isEmpty() && count < subEntrySize) { + batch.time = lastMessageInBatch.time(); + batch.publishingId = lastMessageInBatch.publishingId(); + batch.encodedMessageBatch.close(); + subBatches.add(batch); + } + + return this.publish(subBatches); + } else { + return false; + } + }, + batchSize * subEntrySize); + } + } + + @Override + public void add(Message message, ConfirmationHandler confirmationHandler) { + Object observationContext = this.observationCollector.prePublish(this.stream, message); + Codec.EncodedMessage encodedMessage = this.codec.encode(message); + Client.checkMessageFitsInFrame(this.maxFrameSize, encodedMessage); + long publishingId = this.publishSequenceFunction.applyAsLong(message); + this.dynamicBatch.add( + new ProducerUtils.SimpleAccumulatedEntity( + this.clock.time(), + publishingId, + this.filterValueExtractor.apply(message), + this.codec.encode(message), + new ProducerUtils.SimpleConfirmationCallback(message, confirmationHandler), + observationContext)); + } + + @Override + public int size() { + // TODO compute dynamic batch message accumulator pending message count + return 0; + } + + @Override + public void flush(boolean force) {} + + private boolean publish(List entities) { + if (this.producer.canSend()) { + this.producer.publishInternal(entities); + return true; + } else { + return false; + } + } +} diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java b/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java index 4933932755..f4facf78da 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java @@ -14,16 +14,74 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; -import com.rabbitmq.stream.Codec; -import com.rabbitmq.stream.ConfirmationHandler; -import com.rabbitmq.stream.ConfirmationStatus; -import com.rabbitmq.stream.Message; +import com.rabbitmq.stream.*; +import com.rabbitmq.stream.compression.CompressionCodec; +import io.netty.buffer.ByteBufAllocator; import java.util.List; +import java.util.function.Function; +import java.util.function.ToLongFunction; final class ProducerUtils { private ProducerUtils() {} + static MessageAccumulator createMessageAccumulator( + boolean dynamicBatch, + int subEntrySize, + int batchSize, + CompressionCodec compressionCodec, + Codec codec, + ByteBufAllocator byteBufAllocator, + int maxFrameSize, + ToLongFunction publishSequenceFunction, + Function filterValueExtractor, + Clock clock, + String stream, + ObservationCollector observationCollector, + StreamProducer producer) { + if (dynamicBatch) { + return new DynamicBatchMessageAccumulator( + subEntrySize, + batchSize, + codec, + maxFrameSize, + publishSequenceFunction, + filterValueExtractor, + clock, + stream, + compressionCodec, + byteBufAllocator, + observationCollector, + producer); + } else { + if (subEntrySize <= 1) { + return new SimpleMessageAccumulator( + batchSize, + codec, + maxFrameSize, + publishSequenceFunction, + filterValueExtractor, + clock, + stream, + observationCollector, + producer); + } else { + return new SubEntryMessageAccumulator( + subEntrySize, + batchSize, + compressionCodec, + codec, + byteBufAllocator, + maxFrameSize, + publishSequenceFunction, + clock, + stream, + observationCollector, + producer); + } + } + } + interface ConfirmationCallback { int handle(boolean confirmed, short code); diff --git a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java index 90a70e43a3..3a14ec21d8 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java @@ -15,12 +15,12 @@ package com.rabbitmq.stream.impl; import com.rabbitmq.stream.*; +import com.rabbitmq.stream.impl.ProducerUtils.AccumulatedEntity; import java.util.ArrayList; import java.util.List; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.function.ToLongFunction; @@ -28,7 +28,7 @@ class SimpleMessageAccumulator implements MessageAccumulator { private static final Function NULL_FILTER_VALUE_EXTRACTOR = m -> null; - protected final BlockingQueue messages; + protected final BlockingQueue messages; protected final Clock clock; private final int capacity; protected final Codec codec; @@ -93,8 +93,8 @@ public void add(Message message, ConfirmationHandler confirmationHandler) { } } - ProducerUtils.AccumulatedEntity get() { - ProducerUtils.AccumulatedEntity entity = this.messages.poll(); + AccumulatedEntity get() { + AccumulatedEntity entity = this.messages.poll(); if (entity != null) { this.observationCollector.published( entity.observationContext(), entity.confirmationCallback().message()); @@ -113,24 +113,20 @@ public void flush(boolean force) { synchronized (this.producer) { publishBatch(stateCheck); } - // System.out.println(sent.get()); } - AtomicInteger sent = new AtomicInteger(); - private void publishBatch(boolean stateCheck) { if ((!stateCheck || this.producer.canSend()) && !this.messages.isEmpty()) { List entities = new ArrayList<>(this.capacity); int batchCount = 0; while (batchCount != this.capacity) { - ProducerUtils.AccumulatedEntity entity = this.get(); + AccumulatedEntity entity = this.get(); if (entity == null) { break; } entities.add(entity); batchCount++; } - this.sent.addAndGet(entities.size()); producer.publishInternal(entities); } } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index 8c1de81345..9cecc8518b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -20,6 +20,7 @@ import com.rabbitmq.stream.*; import com.rabbitmq.stream.compression.Compression; +import com.rabbitmq.stream.compression.CompressionCodec; import com.rabbitmq.stream.impl.Client.Response; import com.rabbitmq.stream.impl.ProducerUtils.AccumulatedEntity; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; @@ -72,8 +73,6 @@ class StreamProducer implements Producer { private final Codec codec; private final ToLongFunction publishSequenceFunction = entity -> ((AccumulatedEntity) entity).publishingId(); - private final Function filterValueExtractor; - private final ObservationCollector observationCollector; private final long enqueueTimeoutMs; private final boolean blockOnMaxUnconfirmed; private final boolean retryOnRecovery; @@ -120,44 +119,41 @@ class StreamProducer implements Producer { return publishingSequence.getAndIncrement(); } }; - this.filterValueExtractor = filterValueExtractor == null ? m -> null : filterValueExtractor; this.clock = environment.clock(); - this.observationCollector = - (ObservationCollector) this.environment.observationCollector(); if (subEntrySize <= 1) { - this.accumulator = - new SimpleMessageAccumulator( - batchSize, - environment.codec(), - client.maxFrameSize(), - accumulatorPublishSequenceFunction, - filterValueExtractor, - this.environment.clock(), - stream, - this.environment.observationCollector(), - this); + // this.accumulator = + // new SimpleMessageAccumulator( + // batchSize, + // environment.codec(), + // client.maxFrameSize(), + // accumulatorPublishSequenceFunction, + // filterValueExtractor, + // this.environment.clock(), + // stream, + // this.environment.observationCollector(), + // this); if (filterValueExtractor == null) { delegateWriteCallback = Client.OUTBOUND_MESSAGE_WRITE_CALLBACK; } else { delegateWriteCallback = OUTBOUND_MSG_FILTER_VALUE_WRITE_CALLBACK; } } else { - this.accumulator = - new SubEntryMessageAccumulator( - subEntrySize, - batchSize, - compression == Compression.NONE - ? null - : environment.compressionCodecFactory().get(compression), - environment.codec(), - this.environment.byteBufAllocator(), - client.maxFrameSize(), - accumulatorPublishSequenceFunction, - this.environment.clock(), - stream, - environment.observationCollector(), - this); + // this.accumulator = + // new SubEntryMessageAccumulator( + // subEntrySize, + // batchSize, + // compression == Compression.NONE + // ? null + // : environment.compressionCodecFactory().get(compression), + // environment.codec(), + // this.environment.byteBufAllocator(), + // client.maxFrameSize(), + // accumulatorPublishSequenceFunction, + // this.environment.clock(), + // stream, + // environment.observationCollector(), + // this); delegateWriteCallback = Client.OUTBOUND_MESSAGE_BATCH_WRITE_CALLBACK; } @@ -201,6 +197,26 @@ public int fragmentLength(Object entity) { }; } + CompressionCodec compressionCodec = null; + if (compression != null) { + compressionCodec = environment.compressionCodecFactory().get(compression); + } + this.accumulator = + ProducerUtils.createMessageAccumulator( + false, + subEntrySize, + batchSize, + compressionCodec, + environment.codec(), + environment.byteBufAllocator(), + client.maxFrameSize(), + accumulatorPublishSequenceFunction, + filterValueExtractor, + environment.clock(), + stream, + environment.observationCollector(), + this); + /* if (subEntrySize <= 1) { this.dynamicBatch = @@ -480,17 +496,6 @@ public void send(Message message, ConfirmationHandler confirmationHandler) { private void doSend(Message message, ConfirmationHandler confirmationHandler) { if (canSend()) { - // long publishingId = this.accumulatorPublishSequenceFunction.applyAsLong(message); - // Object observationContext = this.observationCollector.prePublish(this.stream, - // message); - // this.dynamicBatch.add( - // new ProducerUtils.SimpleAccumulatedEntity( - // this.clock.time(), - // publishingId, - // this.filterValueExtractor.apply(message), - // this.codec.encode(message), - // new ProducerUtils.SimpleConfirmationCallback(message, confirmationHandler), - // observationContext)); this.accumulator.add(message, confirmationHandler); } else { failPublishing(message, confirmationHandler); diff --git a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java index dd15601e10..3cd2fbdb78 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java @@ -42,7 +42,7 @@ public SubEntryMessageAccumulator( ToLongFunction publishSequenceFunction, Clock clock, String stream, - ObservationCollector observationCollector, + ObservationCollector observationCollector, StreamProducer producer) { super( subEntrySize * batchSize, diff --git a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java index 9680845842..1dc42b7bba 100644 --- a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java @@ -42,8 +42,6 @@ void test() { DynamicBatch batch = new DynamicBatch<>( items -> { - // System.out.println(System.currentTimeMillis()); - // System.out.println(items.size()); batchSizeMetrics.update(items.size()); sync.down(items.size()); try { @@ -51,6 +49,7 @@ void test() { } catch (InterruptedException e) { throw new RuntimeException(e); } + return true; }, 100); RateLimiter rateLimiter = RateLimiter.create(3000); diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java index 28c87bfbc2..44240c2a5c 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java @@ -27,6 +27,7 @@ import com.rabbitmq.stream.StreamException; import com.rabbitmq.stream.codec.SimpleCodec; import com.rabbitmq.stream.compression.Compression; +import com.rabbitmq.stream.compression.DefaultCompressionCodecFactory; import com.rabbitmq.stream.impl.Client.OutboundEntityWriteCallback; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; @@ -115,6 +116,8 @@ void init() { when(env.clock()).thenReturn(clock); when(env.codec()).thenReturn(new SimpleCodec()); when(env.observationCollector()).thenAnswer(invocation -> ObservationCollector.NO_OP); + DefaultCompressionCodecFactory ccf = new DefaultCompressionCodecFactory(); + when(env.compressionCodecFactory()).thenReturn(ccf); doAnswer( (Answer) invocationOnMock -> { From 127e3ca395f3b53f2dd8f116ebe8525afc047246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 5 Nov 2024 18:33:55 +0100 Subject: [PATCH 247/449] Clean up producer code --- .../rabbitmq/stream/impl/StreamProducer.java | 137 +----------------- 1 file changed, 1 insertion(+), 136 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index 9cecc8518b..2618d7f2dc 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -56,8 +56,6 @@ class StreamProducer implements Producer { private static final ConfirmationHandler NO_OP_CONFIRMATION_HANDLER = confirmationStatus -> {}; private final long id; private final MessageAccumulator accumulator; - // private final DynamicBatch dynamicBatch; - private final Clock clock; private final ToLongFunction accumulatorPublishSequenceFunction; // FIXME investigate a more optimized data structure to handle pending messages private final ConcurrentMap unconfirmedMessages; @@ -119,41 +117,14 @@ class StreamProducer implements Producer { return publishingSequence.getAndIncrement(); } }; - this.clock = environment.clock(); if (subEntrySize <= 1) { - // this.accumulator = - // new SimpleMessageAccumulator( - // batchSize, - // environment.codec(), - // client.maxFrameSize(), - // accumulatorPublishSequenceFunction, - // filterValueExtractor, - // this.environment.clock(), - // stream, - // this.environment.observationCollector(), - // this); if (filterValueExtractor == null) { delegateWriteCallback = Client.OUTBOUND_MESSAGE_WRITE_CALLBACK; } else { delegateWriteCallback = OUTBOUND_MSG_FILTER_VALUE_WRITE_CALLBACK; } } else { - // this.accumulator = - // new SubEntryMessageAccumulator( - // subEntrySize, - // batchSize, - // compression == Compression.NONE - // ? null - // : environment.compressionCodecFactory().get(compression), - // environment.codec(), - // this.environment.byteBufAllocator(), - // client.maxFrameSize(), - // accumulatorPublishSequenceFunction, - // this.environment.clock(), - // stream, - // environment.observationCollector(), - // this); delegateWriteCallback = Client.OUTBOUND_MESSAGE_BATCH_WRITE_CALLBACK; } @@ -217,88 +188,6 @@ public int fragmentLength(Object entity) { environment.observationCollector(), this); - /* - if (subEntrySize <= 1) { - this.dynamicBatch = - new DynamicBatch<>( - items -> { - client.publishInternal( - this.publishVersion, - this.publisherId, - items, - this.writeCallback, - this.publishSequenceFunction); - }, - batchSize); - } else { - CompressionCodec compressionCodec = - compression == Compression.NONE - ? null - : environment.compressionCodecFactory().get(compression); - byte compressionCode = - compressionCodec == null ? Compression.NONE.code() : compressionCodec.code(); - this.dynamicBatch = - new DynamicBatch<>( - items -> { - List subBatches = new ArrayList<>(); - int count = 0; - ProducerUtils.Batch batch = - new ProducerUtils.Batch( - Client.EncodedMessageBatch.create( - this.environment.byteBufAllocator(), - compressionCode, - compressionCodec, - subEntrySize), - new ProducerUtils.CompositeConfirmationCallback( - new ArrayList<>(subEntrySize))); - AccumulatedEntity lastMessageInBatch = null; - for (Object msg : items) { - AccumulatedEntity message = (AccumulatedEntity) msg; - this.observationCollector.published( - message.observationContext(), message.confirmationCallback().message()); - lastMessageInBatch = message; - batch.add( - (Codec.EncodedMessage) message.encodedEntity(), - message.confirmationCallback()); - count++; - if (count == subEntrySize) { - batch.time = lastMessageInBatch.time(); - batch.publishingId = lastMessageInBatch.publishingId(); - batch.encodedMessageBatch.close(); - subBatches.add(batch); - lastMessageInBatch = null; - batch = - new ProducerUtils.Batch( - Client.EncodedMessageBatch.create( - this.environment.byteBufAllocator(), - compressionCode, - compressionCodec, - subEntrySize), - new ProducerUtils.CompositeConfirmationCallback( - new ArrayList<>(subEntrySize))); - count = 0; - } - } - - if (!batch.isEmpty() && count < subEntrySize) { - batch.time = lastMessageInBatch.time(); - batch.publishingId = lastMessageInBatch.publishingId(); - batch.encodedMessageBatch.close(); - subBatches.add(batch); - } - - client.publishInternal( - this.publishVersion, - this.publisherId, - subBatches, - this.writeCallback, - this.publishSequenceFunction); - - }, - batchSize * subEntrySize); - } - */ - if (!batchPublishingDelay.isNegative() && !batchPublishingDelay.isZero()) { AtomicReference taskReference = new AtomicReference<>(); Runnable task = @@ -388,7 +277,7 @@ private Runnable confirmTimeoutTask(Duration confirmTimeout) { error(unconfirmedEntry.getKey(), Constants.CODE_PUBLISH_CONFIRM_TIMEOUT); count++; } else { - // everything else is after, so we can stop + // everything else is after, we can stop break; } } @@ -571,30 +460,6 @@ private void cancelConfirmTimeoutTask() { } } - /* - private void publishBatch(boolean stateCheck) { - if ((!stateCheck || canSend()) && !accumulator.isEmpty()) { - List messages = new ArrayList<>(this.batchSize); - int batchCount = 0; - while (batchCount != this.batchSize) { - AccumulatedEntity accMessage = accumulator.get(); - if (accMessage == null) { - break; - } - messages.add(accMessage); - batchCount++; - } - client.publishInternal( - this.publishVersion, - this.publisherId, - messages, - this.writeCallback, - this.publishSequenceFunction); - } - } - - */ - void publishInternal(List messages) { client.publishInternal( this.publishVersion, From f2ce3048d3f7bcf8f3404a4635377ce8c114437d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 6 Nov 2024 10:01:59 +0100 Subject: [PATCH 248/449] Test against dynamic-batch message accumulator --- .../impl/DynamicBatchMessageAccumulator.java | 19 +++++++++++++++++- .../rabbitmq/stream/impl/StreamProducer.java | 9 ++++++++- .../stream/impl/DynamicBatchTest.java | 5 ++--- .../stream/impl/StreamProducerUnitTest.java | 20 +++++++++++++------ 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java index 11b1a768b0..73583f6e04 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java @@ -65,7 +65,24 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { this.filterValueExtractor = filterValueExtractor == null ? NULL_FILTER_VALUE_EXTRACTOR : filterValueExtractor; if (subEntrySize <= 1) { - this.dynamicBatch = new DynamicBatch<>(this::publish, batchSize); + this.dynamicBatch = + new DynamicBatch<>( + items -> { + // TODO add a "replay" flag to DynamicBatch to avoid checking the producer status + // the status check helps to avoid collecting the observation another time + if (producer.canSend()) { + items.forEach( + i -> { + AccumulatedEntity entity = (AccumulatedEntity) i; + this.observationCollector.published( + entity.observationContext(), entity.confirmationCallback().message()); + }); + return this.publish(items); + } else { + return false; + } + }, + batchSize); } else { byte compressionCode = compressionCodec == null ? Compression.NONE.code() : compressionCodec.code(); diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index 2618d7f2dc..5b4876af0b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -174,7 +174,7 @@ public int fragmentLength(Object entity) { } this.accumulator = ProducerUtils.createMessageAccumulator( - false, + true, subEntrySize, batchSize, compressionCodec, @@ -306,8 +306,10 @@ private long computeFirstValueOfPublishingSequence() { } } + // visible for testing void confirm(long publishingId) { AccumulatedEntity accumulatedEntity = this.unconfirmedMessages.remove(publishingId); + if (accumulatedEntity != null) { int confirmedCount = accumulatedEntity.confirmationCallback().handle(true, Constants.RESPONSE_CODE_OK); @@ -317,6 +319,11 @@ void confirm(long publishingId) { } } + // for testing + int unconfirmedCount() { + return this.unconfirmedMessages.size(); + } + void error(long publishingId, short errorCode) { AccumulatedEntity accumulatedEntity = unconfirmedMessages.remove(publishingId); if (accumulatedEntity != null) { diff --git a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java index 1dc42b7bba..764631b615 100644 --- a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java @@ -18,7 +18,6 @@ import com.codahale.metrics.Histogram; import com.codahale.metrics.MetricRegistry; import com.google.common.util.concurrent.RateLimiter; -import java.time.Duration; import java.util.Random; import java.util.concurrent.TimeUnit; import java.util.stream.IntStream; @@ -62,7 +61,7 @@ void test() { }); Assertions.assertThat(sync).completes(); long end = System.nanoTime(); - System.out.println("Done in " + Duration.ofNanos(end - start)); - reporter.report(); + // System.out.println("Done in " + Duration.ofNanos(end - start)); + // reporter.report(); } } diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java index 44240c2a5c..451df47de5 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java @@ -15,6 +15,7 @@ package com.rabbitmq.stream.impl; import static com.rabbitmq.stream.impl.TestUtils.waitAtMost; +import static java.util.stream.IntStream.range; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.ArgumentMatchers.*; @@ -43,8 +44,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.function.ToLongFunction; -import java.util.stream.IntStream; import org.assertj.core.api.ThrowableAssert.ThrowingCallable; +import org.assertj.core.data.Offset; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.params.ParameterizedTest; @@ -184,26 +185,33 @@ void confirmTimeoutTaskShouldFailMessagesAfterTimeout( null, env); - IntStream.range(0, messageCount) + range(0, messageCount) .forEach( i -> producer.send( producer.messageBuilder().addData("".getBytes()).build(), confirmationHandler)); - IntStream.range(0, confirmedPart).forEach(publishingId -> producer.confirm(publishingId)); - assertThat(confirmedCount.get()).isEqualTo(expectedConfirmed); + waitAtMost(() -> producer.unconfirmedCount() >= messageCount / subEntrySize); + range(0, confirmedPart).forEach(producer::confirm); + if (subEntrySize == 1) { + assertThat(confirmedCount.get()).isEqualTo(expectedConfirmed); + } else { + assertThat(confirmedCount.get()).isCloseTo(confirmedCount.get(), Offset.offset(subEntrySize)); + } assertThat(erroredCount.get()).isZero(); + int confirmedPreviously = confirmedCount.get(); executorService.scheduleAtFixedRate(() -> clock.refresh(), 100, 100, TimeUnit.MILLISECONDS); Thread.sleep(waitTime.toMillis()); - assertThat(confirmedCount.get()).isEqualTo(expectedConfirmed); + assertThat(confirmedCount.get()).isEqualTo(confirmedPreviously); if (confirmTimeout.isZero()) { assertThat(erroredCount.get()).isZero(); assertThat(responseCodes).isEmpty(); } else { waitAtMost( - waitTime.multipliedBy(2), () -> erroredCount.get() == (messageCount - expectedConfirmed)); + waitTime.multipliedBy(2), + () -> erroredCount.get() == (messageCount - confirmedPreviously)); assertThat(responseCodes).hasSize(1).contains(Constants.CODE_PUBLISH_CONFIRM_TIMEOUT); } } From 8c54607985645649583f32c9196dec5b051dc58c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 6 Nov 2024 11:48:47 +0100 Subject: [PATCH 249/449] Add helper for message accumulator --- .../impl/DynamicBatchMessageAccumulator.java | 55 +++------- .../rabbitmq/stream/impl/ProducerUtils.java | 57 ++++++++++ .../stream/impl/SimpleMessageAccumulator.java | 44 +++----- .../rabbitmq/stream/impl/StreamProducer.java | 9 +- .../impl/SubEntryMessageAccumulator.java | 15 ++- .../stream/impl/StreamProducerTest.java | 101 +++++++++--------- src/test/resources/logback-test.xml | 1 - 7 files changed, 146 insertions(+), 136 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java index 73583f6e04..3c850440ba 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java @@ -29,17 +29,10 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { - private static final Function NULL_FILTER_VALUE_EXTRACTOR = m -> null; - private final DynamicBatch dynamicBatch; private final ObservationCollector observationCollector; - private final ToLongFunction publishSequenceFunction; - private final String stream; private final StreamProducer producer; - private final Codec codec; - private final int maxFrameSize; - private final Clock clock; - private final Function filterValueExtractor; + private final ProducerUtils.MessageAccumulatorHelper helper; @SuppressWarnings("unchecked") DynamicBatchMessageAccumulator( @@ -55,15 +48,17 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { ByteBufAllocator byteBufAllocator, ObservationCollector observationCollector, StreamProducer producer) { + this.helper = + new ProducerUtils.MessageAccumulatorHelper( + codec, + maxFrameSize, + publishSequenceFunction, + filterValueExtractor, + clock, + stream, + observationCollector); this.producer = producer; - this.stream = stream; - this.publishSequenceFunction = publishSequenceFunction; this.observationCollector = (ObservationCollector) observationCollector; - this.codec = codec; - this.clock = clock; - this.maxFrameSize = maxFrameSize; - this.filterValueExtractor = - filterValueExtractor == null ? NULL_FILTER_VALUE_EXTRACTOR : filterValueExtractor; if (subEntrySize <= 1) { this.dynamicBatch = new DynamicBatch<>( @@ -93,11 +88,8 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { List subBatches = new ArrayList<>(); int count = 0; ProducerUtils.Batch batch = - new ProducerUtils.Batch( - Client.EncodedMessageBatch.create( - byteBufAllocator, compressionCode, compressionCodec, subEntrySize), - new ProducerUtils.CompositeConfirmationCallback( - new ArrayList<>(subEntrySize))); + this.helper.batch( + byteBufAllocator, compressionCode, compressionCodec, subEntrySize); AccumulatedEntity lastMessageInBatch = null; for (Object msg : items) { AccumulatedEntity message = (AccumulatedEntity) msg; @@ -115,14 +107,8 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { subBatches.add(batch); lastMessageInBatch = null; batch = - new ProducerUtils.Batch( - Client.EncodedMessageBatch.create( - byteBufAllocator, - compressionCode, - compressionCodec, - subEntrySize), - new ProducerUtils.CompositeConfirmationCallback( - new ArrayList<>(subEntrySize))); + this.helper.batch( + byteBufAllocator, compressionCode, compressionCodec, subEntrySize); count = 0; } } @@ -145,18 +131,7 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { @Override public void add(Message message, ConfirmationHandler confirmationHandler) { - Object observationContext = this.observationCollector.prePublish(this.stream, message); - Codec.EncodedMessage encodedMessage = this.codec.encode(message); - Client.checkMessageFitsInFrame(this.maxFrameSize, encodedMessage); - long publishingId = this.publishSequenceFunction.applyAsLong(message); - this.dynamicBatch.add( - new ProducerUtils.SimpleAccumulatedEntity( - this.clock.time(), - publishingId, - this.filterValueExtractor.apply(message), - this.codec.encode(message), - new ProducerUtils.SimpleConfirmationCallback(message, confirmationHandler), - observationContext)); + this.dynamicBatch.add(helper.entity(message, confirmationHandler)); } @Override diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java b/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java index f4facf78da..c74fa0102b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java @@ -17,6 +17,7 @@ import com.rabbitmq.stream.*; import com.rabbitmq.stream.compression.CompressionCodec; import io.netty.buffer.ByteBufAllocator; +import java.util.ArrayList; import java.util.List; import java.util.function.Function; import java.util.function.ToLongFunction; @@ -262,4 +263,60 @@ public Object observationContext() { "batch entity does not contain only one observation context"); } } + + static final class MessageAccumulatorHelper { + + private static final Function NULL_FILTER_VALUE_EXTRACTOR = m -> null; + + private final ObservationCollector observationCollector; + private final ToLongFunction publishSequenceFunction; + private final String stream; + private final Codec codec; + private final int maxFrameSize; + private final Clock clock; + private final Function filterValueExtractor; + + @SuppressWarnings("unchecked") + MessageAccumulatorHelper( + Codec codec, + int maxFrameSize, + ToLongFunction publishSequenceFunction, + Function filterValueExtractor, + Clock clock, + String stream, + ObservationCollector observationCollector) { + this.publishSequenceFunction = publishSequenceFunction; + this.codec = codec; + this.clock = clock; + this.maxFrameSize = maxFrameSize; + this.filterValueExtractor = + filterValueExtractor == null ? NULL_FILTER_VALUE_EXTRACTOR : filterValueExtractor; + this.observationCollector = (ObservationCollector) observationCollector; + this.stream = stream; + } + + AccumulatedEntity entity(Message message, ConfirmationHandler confirmationHandler) { + Object observationContext = this.observationCollector.prePublish(this.stream, message); + Codec.EncodedMessage encodedMessage = this.codec.encode(message); + Client.checkMessageFitsInFrame(this.maxFrameSize, encodedMessage); + long publishingId = this.publishSequenceFunction.applyAsLong(message); + return new ProducerUtils.SimpleAccumulatedEntity( + this.clock.time(), + publishingId, + this.filterValueExtractor.apply(message), + this.codec.encode(message), + new ProducerUtils.SimpleConfirmationCallback(message, confirmationHandler), + observationContext); + } + + Batch batch( + ByteBufAllocator bba, + byte compressionCode, + CompressionCodec compressionCodec, + int subEntrySize) { + return new ProducerUtils.Batch( + Client.EncodedMessageBatch.create(bba, compressionCode, compressionCodec, subEntrySize), + new ProducerUtils.CompositeConfirmationCallback(new ArrayList<>(subEntrySize))); + } + } } diff --git a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java index 3a14ec21d8..b88fe115cd 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java @@ -26,18 +26,11 @@ class SimpleMessageAccumulator implements MessageAccumulator { - private static final Function NULL_FILTER_VALUE_EXTRACTOR = m -> null; - protected final BlockingQueue messages; - protected final Clock clock; private final int capacity; - protected final Codec codec; - private final int maxFrameSize; - private final ToLongFunction publishSequenceFunction; - private final Function filterValueExtractor; - final String stream; final ObservationCollector observationCollector; private final StreamProducer producer; + final ProducerUtils.MessageAccumulatorHelper helper; @SuppressWarnings("unchecked") SimpleMessageAccumulator( @@ -50,36 +43,25 @@ class SimpleMessageAccumulator implements MessageAccumulator { String stream, ObservationCollector observationCollector, StreamProducer producer) { + this.helper = + new ProducerUtils.MessageAccumulatorHelper( + codec, + maxFrameSize, + publishSequenceFunction, + filterValueExtractor, + clock, + stream, + observationCollector); this.capacity = capacity; - this.messages = new LinkedBlockingQueue<>(capacity); - this.codec = codec; - this.maxFrameSize = maxFrameSize; - this.publishSequenceFunction = publishSequenceFunction; - this.filterValueExtractor = - filterValueExtractor == null ? NULL_FILTER_VALUE_EXTRACTOR : filterValueExtractor; - this.clock = clock; - this.stream = stream; + this.messages = new LinkedBlockingQueue<>(this.capacity); this.observationCollector = (ObservationCollector) observationCollector; this.producer = producer; } public void add(Message message, ConfirmationHandler confirmationHandler) { - Object observationContext = this.observationCollector.prePublish(this.stream, message); - Codec.EncodedMessage encodedMessage = this.codec.encode(message); - Client.checkMessageFitsInFrame(this.maxFrameSize, encodedMessage); - long publishingId = this.publishSequenceFunction.applyAsLong(message); + AccumulatedEntity entity = this.helper.entity(message, confirmationHandler); try { - boolean offered = - messages.offer( - new ProducerUtils.SimpleAccumulatedEntity( - clock.time(), - publishingId, - this.filterValueExtractor.apply(message), - encodedMessage, - new ProducerUtils.SimpleConfirmationCallback(message, confirmationHandler), - observationContext), - 60, - TimeUnit.SECONDS); + boolean offered = messages.offer(entity, 60, TimeUnit.SECONDS); if (!offered) { throw new StreamException("Could not accumulate outbound message"); } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index 5b4876af0b..7ae4582da9 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -172,9 +172,10 @@ public int fragmentLength(Object entity) { if (compression != null) { compressionCodec = environment.compressionCodecFactory().get(compression); } + boolean dynamicBatch = true; this.accumulator = ProducerUtils.createMessageAccumulator( - true, + dynamicBatch, subEntrySize, batchSize, compressionCodec, @@ -188,7 +189,11 @@ public int fragmentLength(Object entity) { environment.observationCollector(), this); - if (!batchPublishingDelay.isNegative() && !batchPublishingDelay.isZero()) { + boolean backgroundBatchPublishingTaskRequired = + !dynamicBatch && batchPublishingDelay.toMillis() > 0; + LOGGER.debug( + "Background batch publishing task required? {}", backgroundBatchPublishingTaskRequired); + if (backgroundBatchPublishingTaskRequired) { AtomicReference taskReference = new AtomicReference<>(); Runnable task = () -> { diff --git a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java index 3cd2fbdb78..27e7fcce0d 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java @@ -20,9 +20,7 @@ import com.rabbitmq.stream.ObservationCollector; import com.rabbitmq.stream.compression.Compression; import com.rabbitmq.stream.compression.CompressionCodec; -import com.rabbitmq.stream.impl.Client.EncodedMessageBatch; import io.netty.buffer.ByteBufAllocator; -import java.util.ArrayList; import java.util.function.ToLongFunction; final class SubEntryMessageAccumulator extends SimpleMessageAccumulator { @@ -30,7 +28,7 @@ final class SubEntryMessageAccumulator extends SimpleMessageAccumulator { private final int subEntrySize; private final CompressionCodec compressionCodec; private final ByteBufAllocator byteBufAllocator; - private final byte compression; + private final byte compressionCode; public SubEntryMessageAccumulator( int subEntrySize, @@ -56,15 +54,14 @@ public SubEntryMessageAccumulator( producer); this.subEntrySize = subEntrySize; this.compressionCodec = compressionCodec; - this.compression = compressionCodec == null ? Compression.NONE.code() : compressionCodec.code(); + this.compressionCode = + compressionCodec == null ? Compression.NONE.code() : compressionCodec.code(); this.byteBufAllocator = byteBufAllocator; } private ProducerUtils.Batch createBatch() { - return new ProducerUtils.Batch( - EncodedMessageBatch.create( - byteBufAllocator, compression, compressionCodec, this.subEntrySize), - new ProducerUtils.CompositeConfirmationCallback(new ArrayList<>(this.subEntrySize))); + return this.helper.batch( + this.byteBufAllocator, this.compressionCode, this.compressionCodec, this.subEntrySize); } @Override @@ -73,7 +70,7 @@ protected ProducerUtils.AccumulatedEntity get() { return null; } int count = 0; - ProducerUtils.Batch batch = createBatch(); + ProducerUtils.Batch batch = this.createBatch(); ProducerUtils.AccumulatedEntity lastMessageInBatch = null; while (count != this.subEntrySize) { ProducerUtils.AccumulatedEntity message = messages.poll(); diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java index 19be5ea05b..ef68af3bf0 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java @@ -20,7 +20,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; -import ch.qos.logback.classic.Level; import com.rabbitmq.stream.*; import com.rabbitmq.stream.compression.Compression; import com.rabbitmq.stream.impl.MonitoringTestUtils.ProducerInfo; @@ -347,63 +346,59 @@ void shouldRecoverAfterConnectionIsKilled(int subEntrySize) throws Exception { @ParameterizedTest @ValueSource(ints = {1, 7}) void producerShouldBeClosedWhenStreamIsDeleted(int subEntrySize, TestInfo info) throws Exception { - Level initialLogLevel = TestUtils.newLoggerLevel(ProducersCoordinator.class, Level.DEBUG); - try { - String s = streamName(info); - environment.streamCreator().stream(s).create(); - - StreamProducer producer = - (StreamProducer) - environment.producerBuilder().subEntrySize(subEntrySize).stream(s).build(); - - AtomicInteger published = new AtomicInteger(0); - AtomicInteger confirmed = new AtomicInteger(0); - AtomicInteger errored = new AtomicInteger(0); - Set errorCodes = ConcurrentHashMap.newKeySet(); - - AtomicBoolean continuePublishing = new AtomicBoolean(true); - Thread publishThread = - new Thread( - () -> { - ConfirmationHandler confirmationHandler = - confirmationStatus -> { - if (confirmationStatus.isConfirmed()) { - confirmed.incrementAndGet(); - } else { - errored.incrementAndGet(); - errorCodes.add(confirmationStatus.getCode()); - } - }; - while (continuePublishing.get()) { - try { - producer.send( - producer - .messageBuilder() - .addData("".getBytes(StandardCharsets.UTF_8)) - .build(), - confirmationHandler); - published.incrementAndGet(); - } catch (StreamException e) { - // OK - } + String s = streamName(info); + environment.streamCreator().stream(s).create(); + + StreamProducer producer = + (StreamProducer) environment.producerBuilder().subEntrySize(subEntrySize).stream(s).build(); + + AtomicInteger published = new AtomicInteger(0); + AtomicInteger confirmed = new AtomicInteger(0); + AtomicInteger errored = new AtomicInteger(0); + Set errorCodes = ConcurrentHashMap.newKeySet(); + + AtomicBoolean continuePublishing = new AtomicBoolean(true); + Thread publishThread = + new Thread( + () -> { + ConfirmationHandler confirmationHandler = + confirmationStatus -> { + if (confirmationStatus.isConfirmed()) { + confirmed.incrementAndGet(); + } else { + errored.incrementAndGet(); + errorCodes.add(confirmationStatus.getCode()); + } + }; + while (continuePublishing.get()) { + try { + producer.send( + producer + .messageBuilder() + .addData("".getBytes(StandardCharsets.UTF_8)) + .build(), + confirmationHandler); + published.incrementAndGet(); + } catch (StreamException e) { + // OK } - }); - publishThread.start(); + } + }); + publishThread.start(); - Thread.sleep(1000L); + waitAtMost(() -> confirmed.get() > 100); + int confirmedNow = confirmed.get(); + waitAtMost(() -> confirmed.get() > confirmedNow + 1000); - assertThat(producer.isOpen()).isTrue(); + assertThat(producer.isOpen()).isTrue(); - environment.deleteStream(s); + environment.deleteStream(s); - waitAtMost(() -> !producer.isOpen()); - continuePublishing.set(false); - waitAtMost( - () -> !errorCodes.isEmpty(), - () -> "The producer should have received negative publish confirms"); - } finally { - TestUtils.newLoggerLevel(ProducersCoordinator.class, initialLogLevel); - } + waitAtMost(() -> !producer.isOpen()); + continuePublishing.set(false); + waitAtMost( + () -> !errorCodes.isEmpty(), + () -> "The producer should have received negative publish confirms"); } @ParameterizedTest diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 6931d5f21a..4bec720537 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -6,7 +6,6 @@ - From 517926e2d0af3108455a4c4069c7a0efe06c0bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 6 Nov 2024 15:44:22 +0100 Subject: [PATCH 250/449] Run test suite against both versions of message accumulator Regular and dynamic batch. --- .github/workflows/test-rabbitmq-alphas.yml | 10 +++++++++- .github/workflows/test-supported-java-versions.yml | 11 ++++++++++- .github/workflows/test.yml | 10 +++++++++- .../java/com/rabbitmq/stream/impl/StreamProducer.java | 2 +- .../rabbitmq/stream/impl/StreamProducerBuilder.java | 6 ++++++ .../rabbitmq/stream/impl/StreamProducerUnitTest.java | 3 +++ 6 files changed, 38 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index 4409947e27..2a89ab39ff 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -32,11 +32,19 @@ jobs: run: ci/start-broker.sh env: RABBITMQ_IMAGE: ${{ matrix.rabbitmq-image }} - - name: Test + - name: Test (no dynamic-batch publishing) run: | ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + -Drabbitmq.stream.producer.dynamic.batch=false \ -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem + - name: Test (dynamic-batch publishing) + run: | + ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + -Drabbitmq.stream.producer.dynamic.batch=true \ + -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ + -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ + -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem - name: Stop broker run: docker stop rabbitmq && docker rm rabbitmq diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index 05983059c4..8e66bcb89d 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -33,12 +33,21 @@ jobs: run: ci/start-broker.sh - name: Display Java version run: ./mvnw --version - - name: Test + - name: Test (no dynamic-batch publishing) run: | ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + -Drabbitmq.stream.producer.dynamic.batch=false \ -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem \ -Dnet.bytebuddy.experimental=true -Djacoco.skip=true -Dspotbugs.skip=true + - name: Test (dynamic-batch publishing) + run: | + ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + -Drabbitmq.stream.producer.dynamic.batch=true \ + -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ + -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ + -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem \ + -Dnet.bytebuddy.experimental=true -Djacoco.skip=true -Dspotbugs.skip=true - name: Stop broker run: docker stop rabbitmq && docker rm rabbitmq diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7081a78ee5..91a432ef39 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,12 +33,20 @@ jobs: gpg-passphrase: MAVEN_GPG_PASSPHRASE - name: Start broker run: ci/start-broker.sh - - name: Test + - name: Test (no dynamic-batch publishing) run: | ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + -Drabbitmq.stream.producer.dynamic.batch=false \ -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem + - name: Test (dynamic-batch publishing) + run: | + ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + -Drabbitmq.stream.producer.dynamic.batch=true \ + -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ + -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ + -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem - name: Stop broker run: docker stop rabbitmq && docker rm rabbitmq - name: Upload Codecov report diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index 7ae4582da9..24ffdc8ffb 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -86,6 +86,7 @@ class StreamProducer implements Producer { String stream, int subEntrySize, int batchSize, + boolean dynamicBatch, Compression compression, Duration batchPublishingDelay, int maxUnconfirmedMessages, @@ -172,7 +173,6 @@ public int fragmentLength(Object entity) { if (compression != null) { compressionCodec = environment.compressionCodecFactory().get(compression); } - boolean dynamicBatch = true; this.accumulator = ProducerUtils.createMessageAccumulator( dynamicBatch, diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java index 493426c67f..3ed441c9eb 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java @@ -27,6 +27,9 @@ class StreamProducerBuilder implements ProducerBuilder { + static final boolean DEFAULT_DYNAMIC_BATCH = + Boolean.parseBoolean(System.getProperty("rabbitmq.stream.producer.dynamic.batch", "false")); + private final StreamEnvironment environment; private String name; @@ -53,6 +56,8 @@ class StreamProducerBuilder implements ProducerBuilder { private Function filterValueExtractor; + private boolean dynamicBatch = DEFAULT_DYNAMIC_BATCH; + StreamProducerBuilder(StreamEnvironment environment) { this.environment = environment; } @@ -198,6 +203,7 @@ public Producer build() { stream, subEntrySize, batchSize, + dynamicBatch, compression, batchPublishingDelay, maxUnconfirmedMessages, diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java index 451df47de5..c91590a4ec 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java @@ -176,6 +176,7 @@ void confirmTimeoutTaskShouldFailMessagesAfterTimeout( "stream", subEntrySize, 10, + StreamProducerBuilder.DEFAULT_DYNAMIC_BATCH, Compression.NONE, Duration.ofMillis(100), messageCount * 10, @@ -226,6 +227,7 @@ void enqueueTimeoutMessageShouldBeFailedWhenEnqueueTimeoutIsReached(int subEntry "stream", subEntrySize, 10, + StreamProducerBuilder.DEFAULT_DYNAMIC_BATCH, Compression.NONE, Duration.ZERO, 2, @@ -266,6 +268,7 @@ void enqueueTimeoutSendingShouldBlockWhenEnqueueTimeoutIsZero(int subEntrySize) "stream", subEntrySize, 10, + StreamProducerBuilder.DEFAULT_DYNAMIC_BATCH, Compression.NONE, Duration.ZERO, 2, From fa5e0a3fbea9226f33ea2be4116cd3f63c1c9961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 6 Nov 2024 15:56:44 +0100 Subject: [PATCH 251/449] Add dynamic batch option in producer builder --- src/docs/asciidoc/api.adoc | 4 ++++ .../com/rabbitmq/stream/ProducerBuilder.java | 22 +++++++++++++++++++ .../stream/impl/StreamProducerBuilder.java | 7 ++++++ 3 files changed, 33 insertions(+) diff --git a/src/docs/asciidoc/api.adoc b/src/docs/asciidoc/api.adoc index 28eb063bc6..f7edd8fffd 100644 --- a/src/docs/asciidoc/api.adoc +++ b/src/docs/asciidoc/api.adoc @@ -455,6 +455,10 @@ blocking when the limit is reached. |Period to send a batch of messages. |100 ms +|`dynamicBatch` +|Adapt batch size depending on ingress rate. +|false + |`confirmTimeout` |[[producer-confirm-timeout-configuration-entry]]Time before the client calls the confirm callback to signal outstanding unconfirmed messages timed out. diff --git a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java index 5686a370cf..8d9c8cc7b4 100644 --- a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java @@ -97,6 +97,28 @@ public interface ProducerBuilder { */ ProducerBuilder batchPublishingDelay(Duration batchPublishingDelay); + /** + * Adapt batch size depending on ingress rate. + * + *

A dynamic-batch approach improves latency for low ingress rates. It can be counterproductive + * for sustained high ingress rates. + * + *

Set this flag to true if you want as little delay as possible before calling + * {@link Producer#send(Message, ConfirmationHandler)} and the message being sent to the broker. + * + *

Set this flag to false if latency is not critical for your use case and you + * want the highest throughput possible for both publishing and consuming. + * + *

Dynamic batch is not activated by default (dynamicBatch = false). + * + *

Dynamic batch is experimental. + * + * @param dynamicBatch + * @return this builder instance + * @since 0.20.0 + */ + ProducerBuilder dynamicBatch(boolean dynamicBatch); + /** * The maximum number of unconfirmed outbound messages. * diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java index 3ed441c9eb..814266f7e5 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java @@ -102,11 +102,18 @@ public ProducerBuilder compression(Compression compression) { return this; } + @Override public StreamProducerBuilder batchPublishingDelay(Duration batchPublishingDelay) { this.batchPublishingDelay = batchPublishingDelay; return this; } + @Override + public ProducerBuilder dynamicBatch(boolean dynamicBatch) { + this.dynamicBatch = dynamicBatch; + return this; + } + @Override public ProducerBuilder maxUnconfirmedMessages(int maxUnconfirmedMessages) { if (maxUnconfirmedMessages <= 0) { From 6d5165343793da2d98e899fe48bd3f24c1e0214a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 6 Nov 2024 16:05:48 +0100 Subject: [PATCH 252/449] Fix producer builder duplication --- .../rabbitmq/stream/impl/StreamProducerBuilder.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java index 814266f7e5..14a7526a43 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java @@ -21,6 +21,7 @@ import com.rabbitmq.stream.StreamException; import com.rabbitmq.stream.compression.Compression; import java.lang.reflect.Field; +import java.lang.reflect.Modifier; import java.time.Duration; import java.util.function.Function; import java.util.function.ToIntFunction; @@ -242,11 +243,13 @@ public Producer build() { StreamProducerBuilder duplicate() { StreamProducerBuilder duplicate = new StreamProducerBuilder(this.environment); for (Field field : StreamProducerBuilder.class.getDeclaredFields()) { - field.setAccessible(true); - try { - field.set(duplicate, field.get(this)); - } catch (IllegalAccessException e) { - throw new StreamException("Error while duplicating stream producer builder", e); + if (!Modifier.isStatic(field.getModifiers())) { + field.setAccessible(true); + try { + field.set(duplicate, field.get(this)); + } catch (IllegalAccessException e) { + throw new StreamException("Error while duplicating stream producer builder", e); + } } } return duplicate; From 40d58c895862687a1c620c5471f9c0b40eaf7be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 6 Nov 2024 16:43:23 +0100 Subject: [PATCH 253/449] Stop thread in DynamicBatch --- .../java/com/rabbitmq/stream/impl/DynamicBatch.java | 11 +++++++++-- .../stream/impl/DynamicBatchMessageAccumulator.java | 5 +++++ .../com/rabbitmq/stream/impl/MessageAccumulator.java | 5 ++++- .../stream/impl/SimpleMessageAccumulator.java | 3 +++ .../java/com/rabbitmq/stream/impl/StreamProducer.java | 1 + 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java index a2dc00acd7..9984f3125f 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java @@ -26,7 +26,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -class DynamicBatch { +final class DynamicBatch implements AutoCloseable { private static final Logger LOGGER = LoggerFactory.getLogger(DynamicBatch.class); private static final int MIN_BATCH_SIZE = 32; @@ -35,11 +35,13 @@ class DynamicBatch { private final BlockingQueue requests = new LinkedBlockingQueue<>(); private final Predicate> consumer; private final int configuredBatchSize; + private final Thread thread; DynamicBatch(Predicate> consumer, int batchSize) { this.consumer = consumer; this.configuredBatchSize = min(max(batchSize, MIN_BATCH_SIZE), MAX_BATCH_SIZE); - new Thread(this::loop).start(); + this.thread = new Thread(this::loop); + this.thread.start(); } void add(T item) { @@ -103,4 +105,9 @@ private boolean completeBatch(List items) { return false; } } + + @Override + public void close() { + this.thread.interrupt(); + } } diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java index 3c850440ba..0420216712 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java @@ -151,4 +151,9 @@ private boolean publish(List entities) { return false; } } + + @Override + public void close() { + this.dynamicBatch.close(); + } } diff --git a/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java index ff0c592317..56222dc355 100644 --- a/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java @@ -17,11 +17,14 @@ import com.rabbitmq.stream.ConfirmationHandler; import com.rabbitmq.stream.Message; -interface MessageAccumulator { +interface MessageAccumulator extends AutoCloseable { void add(Message message, ConfirmationHandler confirmationHandler); int size(); void flush(boolean force); + + @Override + void close(); } diff --git a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java index b88fe115cd..53253bd77d 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java @@ -112,4 +112,7 @@ private void publishBatch(boolean stateCheck) { producer.publishInternal(entities); } } + + @Override + public void close() {} } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index 24ffdc8ffb..546ea1549a 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -441,6 +441,7 @@ public void close() { } void closeFromEnvironment() { + this.accumulator.close(); this.closingCallback.run(); cancelConfirmTimeoutTask(); this.closed.set(true); From b56df00204c10652bafa6fda6b8686bf86b8e70c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 6 Nov 2024 17:37:48 +0100 Subject: [PATCH 254/449] Use virtual threads if available in dynamic batch support class --- pom.xml | 2 +- .../com/rabbitmq/stream/ProducerBuilder.java | 2 +- .../stream/impl/ConcurrencyUtils.java | 60 +++++++ .../rabbitmq/stream/impl/DynamicBatch.java | 2 +- .../impl/DynamicBatchMessageAccumulator.java | 1 - .../stream/impl/MessageAccumulator.java | 2 +- .../stream/impl/SimpleMessageAccumulator.java | 35 ++-- .../rabbitmq/stream/impl/StreamProducer.java | 151 ++++++++++-------- .../stream/impl/StreamProducerBuilder.java | 2 +- .../impl/SubEntryMessageAccumulator.java | 2 +- .../stream/impl/StreamProducerTest.java | 2 +- .../stream/impl/StreamProducerUnitTest.java | 2 +- .../com/rabbitmq/stream/impl/TestUtils.java | 2 +- 13 files changed, 174 insertions(+), 91 deletions(-) create mode 100644 src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java diff --git a/pom.xml b/pom.xml index b4e60445f3..e8f3751d30 100644 --- a/pom.xml +++ b/pom.xml @@ -533,7 +533,7 @@ - + origin/main // Copyright (c) $YEAR Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. diff --git a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java index 8d9c8cc7b4..79bc9905d6 100644 --- a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java b/src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java new file mode 100644 index 0000000000..daf877f20b --- /dev/null +++ b/src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java @@ -0,0 +1,60 @@ +// Copyright (c) 2024 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.impl; + +import java.lang.reflect.InvocationTargetException; +import java.util.Arrays; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +final class ConcurrencyUtils { + + private static final Logger LOGGER = LoggerFactory.getLogger(ConcurrencyUtils.class); + + private static final ThreadFactory THREAD_FACTORY; + + static { + if (isJava21OrMore()) { + LOGGER.debug("Running Java 21 or more, using virtual threads"); + Class builderClass = + Arrays.stream(Thread.class.getDeclaredClasses()) + .filter(c -> "Builder".equals(c.getSimpleName())) + .findFirst() + .get(); + // Reflection code is the same as: + // Thread.ofVirtual().factory(); + try { + Object builder = Thread.class.getDeclaredMethod("ofVirtual").invoke(null); + THREAD_FACTORY = (ThreadFactory) builderClass.getDeclaredMethod("factory").invoke(builder); + } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { + throw new RuntimeException(e); + } + } else { + THREAD_FACTORY = Executors.defaultThreadFactory(); + } + } + + private ConcurrencyUtils() {} + + static ThreadFactory defaultThreadFactory() { + return THREAD_FACTORY; + } + + private static boolean isJava21OrMore() { + return Utils.versionCompare(System.getProperty("java.version"), "21.0") >= 0; + } +} diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java index 9984f3125f..f06cbc6591 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java @@ -40,7 +40,7 @@ final class DynamicBatch implements AutoCloseable { DynamicBatch(Predicate> consumer, int batchSize) { this.consumer = consumer; this.configuredBatchSize = min(max(batchSize, MIN_BATCH_SIZE), MAX_BATCH_SIZE); - this.thread = new Thread(this::loop); + this.thread = ConcurrencyUtils.defaultThreadFactory().newThread(this::loop); this.thread.start(); } diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java index 0420216712..0031ebd6c2 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java @@ -119,7 +119,6 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { batch.encodedMessageBatch.close(); subBatches.add(batch); } - return this.publish(subBatches); } else { return false; diff --git a/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java index 56222dc355..80e3bb516e 100644 --- a/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java index 53253bd77d..97e99e4b9f 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -69,9 +69,7 @@ public void add(Message message, ConfirmationHandler confirmationHandler) { throw new StreamException("Error while accumulating outbound message", e); } if (this.messages.size() == this.capacity) { - synchronized (this.producer) { - publishBatch(true); - } + publishBatch(true); } } @@ -92,24 +90,27 @@ public int size() { @Override public void flush(boolean force) { boolean stateCheck = !force; - synchronized (this.producer) { - publishBatch(stateCheck); - } + publishBatch(stateCheck); } private void publishBatch(boolean stateCheck) { - if ((!stateCheck || this.producer.canSend()) && !this.messages.isEmpty()) { - List entities = new ArrayList<>(this.capacity); - int batchCount = 0; - while (batchCount != this.capacity) { - AccumulatedEntity entity = this.get(); - if (entity == null) { - break; + this.producer.lock(); + try { + if ((!stateCheck || this.producer.canSend()) && !this.messages.isEmpty()) { + List entities = new ArrayList<>(this.capacity); + int batchCount = 0; + while (batchCount != this.capacity) { + AccumulatedEntity entity = this.get(); + if (entity == null) { + break; + } + entities.add(entity); + batchCount++; } - entities.add(entity); - batchCount++; + producer.publishInternal(entities); } - producer.publishInternal(entities); + } finally { + this.producer.unlock(); } } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index 546ea1549a..e7e67be0be 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -43,6 +43,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import java.util.function.Function; import java.util.function.ToLongFunction; import org.slf4j.Logger; @@ -56,7 +58,6 @@ class StreamProducer implements Producer { private static final ConfirmationHandler NO_OP_CONFIRMATION_HANDLER = confirmationStatus -> {}; private final long id; private final MessageAccumulator accumulator; - private final ToLongFunction accumulatorPublishSequenceFunction; // FIXME investigate a more optimized data structure to handle pending messages private final ConcurrentMap unconfirmedMessages; private final int batchSize; @@ -79,6 +80,7 @@ class StreamProducer implements Producer { private volatile Status status; private volatile ScheduledFuture confirmTimeoutFuture; private final short publishVersion; + private final Lock lock = new ReentrantLock(); @SuppressFBWarnings("CT_CONSTRUCTOR_THROW") StreamProducer( @@ -110,7 +112,7 @@ class StreamProducer implements Producer { this.closingCallback = environment.registerProducer(this, name, this.stream); final Client.OutboundEntityWriteCallback delegateWriteCallback; AtomicLong publishingSequence = new AtomicLong(computeFirstValueOfPublishingSequence()); - this.accumulatorPublishSequenceFunction = + ToLongFunction accumulatorPublishSequenceFunction = msg -> { if (msg.hasPublishingId()) { return msg.getPublishingId(); @@ -491,76 +493,80 @@ void unavailable() { } void running() { - synchronized (this) { - LOGGER.debug( - "Recovering producer with {} unconfirmed message(s) and {} accumulated message(s)", - this.unconfirmedMessages.size(), - this.accumulator.size()); - if (this.retryOnRecovery) { - LOGGER.debug("Re-publishing {} unconfirmed message(s)", this.unconfirmedMessages.size()); - if (!this.unconfirmedMessages.isEmpty()) { - Map messagesToResend = new TreeMap<>(this.unconfirmedMessages); - this.unconfirmedMessages.clear(); - Iterator> resendIterator = - messagesToResend.entrySet().iterator(); - while (resendIterator.hasNext()) { - List messages = new ArrayList<>(this.batchSize); - int batchCount = 0; - while (batchCount != this.batchSize) { - Object accMessage = - resendIterator.hasNext() ? resendIterator.next().getValue() : null; - if (accMessage == null) { - break; + this.executeInLock( + () -> { + LOGGER.debug( + "Recovering producer with {} unconfirmed message(s) and {} accumulated message(s)", + this.unconfirmedMessages.size(), + this.accumulator.size()); + if (this.retryOnRecovery) { + LOGGER.debug( + "Re-publishing {} unconfirmed message(s)", this.unconfirmedMessages.size()); + if (!this.unconfirmedMessages.isEmpty()) { + Map messagesToResend = + new TreeMap<>(this.unconfirmedMessages); + this.unconfirmedMessages.clear(); + Iterator> resendIterator = + messagesToResend.entrySet().iterator(); + while (resendIterator.hasNext()) { + List messages = new ArrayList<>(this.batchSize); + int batchCount = 0; + while (batchCount != this.batchSize) { + Object accMessage = + resendIterator.hasNext() ? resendIterator.next().getValue() : null; + if (accMessage == null) { + break; + } + messages.add(accMessage); + batchCount++; + } + client.publishInternal( + this.publishVersion, + this.publisherId, + messages, + this.writeCallback, + this.publishSequenceFunction); + } + } + } else { + LOGGER.debug( + "Skipping republishing of {} unconfirmed messages", + this.unconfirmedMessages.size()); + Map messagesToFail = new TreeMap<>(this.unconfirmedMessages); + this.unconfirmedMessages.clear(); + for (AccumulatedEntity accumulatedEntity : messagesToFail.values()) { + try { + int permits = + accumulatedEntity + .confirmationCallback() + .handle(false, CODE_PUBLISH_CONFIRM_TIMEOUT); + this.unconfirmedMessagesSemaphore.release(permits); + } catch (Exception e) { + LOGGER.debug("Error while nack-ing outbound message: {}", e.getMessage()); + this.unconfirmedMessagesSemaphore.release(1); } - messages.add(accMessage); - batchCount++; } - client.publishInternal( - this.publishVersion, - this.publisherId, - messages, - this.writeCallback, - this.publishSequenceFunction); } - } - } else { - LOGGER.debug( - "Skipping republishing of {} unconfirmed messages", this.unconfirmedMessages.size()); - Map messagesToFail = new TreeMap<>(this.unconfirmedMessages); - this.unconfirmedMessages.clear(); - for (AccumulatedEntity accumulatedEntity : messagesToFail.values()) { - try { - int permits = - accumulatedEntity - .confirmationCallback() - .handle(false, CODE_PUBLISH_CONFIRM_TIMEOUT); - this.unconfirmedMessagesSemaphore.release(permits); - } catch (Exception e) { - LOGGER.debug("Error while nack-ing outbound message: {}", e.getMessage()); - this.unconfirmedMessagesSemaphore.release(1); + this.accumulator.flush(true); + int toRelease = maxUnconfirmedMessages - unconfirmedMessagesSemaphore.availablePermits(); + if (toRelease > 0) { + unconfirmedMessagesSemaphore.release(toRelease); + if (!unconfirmedMessagesSemaphore.tryAcquire(this.unconfirmedMessages.size())) { + LOGGER.debug( + "Could not acquire {} permit(s) for message republishing", + this.unconfirmedMessages.size()); + } } - } - } - this.accumulator.flush(true); - int toRelease = maxUnconfirmedMessages - unconfirmedMessagesSemaphore.availablePermits(); - if (toRelease > 0) { - unconfirmedMessagesSemaphore.release(toRelease); - if (!unconfirmedMessagesSemaphore.tryAcquire(this.unconfirmedMessages.size())) { - LOGGER.debug( - "Could not acquire {} permit(s) for message republishing", - this.unconfirmedMessages.size()); - } - } - } + }); this.status = Status.RUNNING; } - synchronized void setClient(Client client) { - this.client = client; + void setClient(Client client) { + this.executeInLock(() -> this.client = client); } - synchronized void setPublisherId(byte publisherId) { - this.publisherId = publisherId; + void setPublisherId(byte publisherId) { + this.executeInLock(() -> this.publisherId = publisherId); } Status status() { @@ -646,4 +652,21 @@ public int fragmentLength(Object entity) { } } } + + void lock() { + this.lock.lock(); + } + + void unlock() { + this.lock.unlock(); + } + + private void executeInLock(Runnable action) { + this.lock(); + try { + action.run(); + } finally { + this.unlock(); + } + } } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java index 14a7526a43..54807489e2 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java index 27e7fcce0d..14645074e6 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java index ef68af3bf0..e900fb4990 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java index c91590a4ec..19390e6877 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index 8700987f0f..76c1418d36 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the From f582f7d2f5f9fbdf7de878eb418fbd084c37ee06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 6 Nov 2024 18:11:05 +0100 Subject: [PATCH 255/449] Introduce replay argument in dynamic batch support class --- .../rabbitmq/stream/impl/DynamicBatch.java | 64 +++++++++-------- .../impl/DynamicBatchMessageAccumulator.java | 70 +++++++++---------- .../stream/impl/DynamicBatchTest.java | 32 +++++---- 3 files changed, 86 insertions(+), 80 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java index f06cbc6591..ba52d23950 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java @@ -22,7 +22,7 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import java.util.function.Predicate; +import java.util.function.BiPredicate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,11 +33,11 @@ final class DynamicBatch implements AutoCloseable { private static final int MAX_BATCH_SIZE = 8192; private final BlockingQueue requests = new LinkedBlockingQueue<>(); - private final Predicate> consumer; + private final BiPredicate, Boolean> consumer; private final int configuredBatchSize; private final Thread thread; - DynamicBatch(Predicate> consumer, int batchSize) { + DynamicBatch(BiPredicate, Boolean> consumer, int batchSize) { this.consumer = consumer; this.configuredBatchSize = min(max(batchSize, MIN_BATCH_SIZE), MAX_BATCH_SIZE); this.thread = ConcurrencyUtils.defaultThreadFactory().newThread(this::loop); @@ -53,8 +53,10 @@ void add(T item) { } private void loop() { - int batchSize = this.configuredBatchSize; - List batch = new ArrayList<>(batchSize); + State state = new State<>(); + state.batchSize = this.configuredBatchSize; + state.items = new ArrayList<>(state.batchSize); + state.retry = false; Thread currentThread = Thread.currentThread(); T item; while (!currentThread.isInterrupted()) { @@ -65,44 +67,50 @@ private void loop() { return; } if (item != null) { - batch.add(item); - if (batch.size() >= batchSize) { - if (this.completeBatch(batch)) { - batchSize = min(batchSize * 2, MAX_BATCH_SIZE); - batch = new ArrayList<>(batchSize); - } + state.items.add(item); + if (state.items.size() >= state.batchSize) { + this.maybeCompleteBatch(state, true); } else { item = this.requests.poll(); if (item == null) { - if (this.completeBatch(batch)) { - batchSize = max(batchSize / 2, MIN_BATCH_SIZE); - batch = new ArrayList<>(batchSize); - } + this.maybeCompleteBatch(state, false); } else { - batch.add(item); - if (batch.size() >= batchSize) { - if (this.completeBatch(batch)) { - batchSize = min(batchSize * 2, MAX_BATCH_SIZE); - batch = new ArrayList<>(batchSize); - } + state.items.add(item); + if (state.items.size() >= state.batchSize) { + this.maybeCompleteBatch(state, true); } } } } else { - if (this.completeBatch(batch)) { - batchSize = min(batchSize * 2, MAX_BATCH_SIZE); - batch = new ArrayList<>(batchSize); - } + this.maybeCompleteBatch(state, false); } } } - private boolean completeBatch(List items) { + private static final class State { + + int batchSize; + List items; + boolean retry; + } + + private void maybeCompleteBatch(State state, boolean increaseIfCompleted) { try { - return this.consumer.test(items); + boolean completed = this.consumer.test(state.items, state.retry); + if (completed) { + if (increaseIfCompleted) { + state.batchSize = min(state.batchSize * 2, MAX_BATCH_SIZE); + } else { + state.batchSize = max(state.batchSize / 2, MIN_BATCH_SIZE); + } + state.items = new ArrayList<>(state.batchSize); + state.retry = false; + } else { + state.retry = true; + } } catch (Exception e) { LOGGER.warn("Error during dynamic batch completion: {}", e.getMessage()); - return false; + state.retry = true; } } diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java index 0031ebd6c2..2b8d6241e9 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java @@ -62,20 +62,16 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { if (subEntrySize <= 1) { this.dynamicBatch = new DynamicBatch<>( - items -> { - // TODO add a "replay" flag to DynamicBatch to avoid checking the producer status - // the status check helps to avoid collecting the observation another time - if (producer.canSend()) { + (items, replay) -> { + if (!replay) { items.forEach( i -> { AccumulatedEntity entity = (AccumulatedEntity) i; this.observationCollector.published( entity.observationContext(), entity.confirmationCallback().message()); }); - return this.publish(items); - } else { - return false; } + return this.publish(items); }, batchSize); } else { @@ -83,46 +79,44 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { compressionCodec == null ? Compression.NONE.code() : compressionCodec.code(); this.dynamicBatch = new DynamicBatch<>( - items -> { - if (this.producer.canSend()) { - List subBatches = new ArrayList<>(); - int count = 0; - ProducerUtils.Batch batch = - this.helper.batch( - byteBufAllocator, compressionCode, compressionCodec, subEntrySize); - AccumulatedEntity lastMessageInBatch = null; - for (Object msg : items) { - AccumulatedEntity message = (AccumulatedEntity) msg; + (items, replay) -> { + List subBatches = new ArrayList<>(); + int count = 0; + ProducerUtils.Batch batch = + this.helper.batch( + byteBufAllocator, compressionCode, compressionCodec, subEntrySize); + AccumulatedEntity lastMessageInBatch = null; + for (Object msg : items) { + AccumulatedEntity message = (AccumulatedEntity) msg; + if (!replay) { this.observationCollector.published( message.observationContext(), message.confirmationCallback().message()); - lastMessageInBatch = message; - batch.add( - (Codec.EncodedMessage) message.encodedEntity(), - message.confirmationCallback()); - count++; - if (count == subEntrySize) { - batch.time = lastMessageInBatch.time(); - batch.publishingId = lastMessageInBatch.publishingId(); - batch.encodedMessageBatch.close(); - subBatches.add(batch); - lastMessageInBatch = null; - batch = - this.helper.batch( - byteBufAllocator, compressionCode, compressionCodec, subEntrySize); - count = 0; - } } - - if (!batch.isEmpty() && count < subEntrySize) { + lastMessageInBatch = message; + batch.add( + (Codec.EncodedMessage) message.encodedEntity(), + message.confirmationCallback()); + count++; + if (count == subEntrySize) { batch.time = lastMessageInBatch.time(); batch.publishingId = lastMessageInBatch.publishingId(); batch.encodedMessageBatch.close(); subBatches.add(batch); + lastMessageInBatch = null; + batch = + this.helper.batch( + byteBufAllocator, compressionCode, compressionCodec, subEntrySize); + count = 0; } - return this.publish(subBatches); - } else { - return false; } + + if (!batch.isEmpty() && count < subEntrySize) { + batch.time = lastMessageInBatch.time(); + batch.publishingId = lastMessageInBatch.publishingId(); + batch.encodedMessageBatch.close(); + subBatches.add(batch); + } + return this.publish(subBatches); }, batchSize * subEntrySize); } diff --git a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java index 764631b615..2049915457 100644 --- a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java @@ -40,28 +40,32 @@ void test() { Random random = new Random(); DynamicBatch batch = new DynamicBatch<>( - items -> { + (items, replay) -> { batchSizeMetrics.update(items.size()); - sync.down(items.size()); try { Thread.sleep(random.nextInt(10) + 1); } catch (InterruptedException e) { throw new RuntimeException(e); } + sync.down(items.size()); return true; }, 100); - RateLimiter rateLimiter = RateLimiter.create(3000); - long start = System.nanoTime(); - IntStream.range(0, itemCount) - .forEach( - i -> { - rateLimiter.acquire(); - batch.add(String.valueOf(i)); - }); - Assertions.assertThat(sync).completes(); - long end = System.nanoTime(); - // System.out.println("Done in " + Duration.ofNanos(end - start)); - // reporter.report(); + try { + RateLimiter rateLimiter = RateLimiter.create(3000); + long start = System.nanoTime(); + IntStream.range(0, itemCount) + .forEach( + i -> { + rateLimiter.acquire(); + batch.add(String.valueOf(i)); + }); + Assertions.assertThat(sync).completes(); + long end = System.nanoTime(); + // System.out.println("Done in " + Duration.ofNanos(end - start)); + // reporter.report(); + } finally { + batch.close(); + } } } From 30524543b9a73c8ff7d3ecccd2ef70811869b997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 6 Nov 2024 18:57:40 +0100 Subject: [PATCH 256/449] Test dynamic batch publishing on CI --- .github/workflows/test-pr.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 0af64477fa..7543f2f175 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -24,9 +24,17 @@ jobs: cache: 'maven' - name: Start broker run: ci/start-broker.sh - - name: Test + - name: Test (no dynamic-batch publishing) run: | ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + -Drabbitmq.stream.producer.dynamic.batch=false \ + -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ + -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ + -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem + - name: Test (dynamic-batch publishing) + run: | + ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + -Drabbitmq.stream.producer.dynamic.batch=true \ -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem From eb89b1f4654234158ad3727e620b507ea3a73889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 7 Nov 2024 10:53:32 +0100 Subject: [PATCH 257/449] Fix Java version check --- src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java b/src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java index daf877f20b..a4dc9f154b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java @@ -55,6 +55,7 @@ static ThreadFactory defaultThreadFactory() { } private static boolean isJava21OrMore() { - return Utils.versionCompare(System.getProperty("java.version"), "21.0") >= 0; + String version = System.getProperty("java.version").replace("-beta", ""); + return Utils.versionCompare(version, "21.0") >= 0; } } From 136ba9dd9c512006f5ab5d9a1ab1a23b1dcbe4b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:11:05 +0000 Subject: [PATCH 258/449] Bump netty.version from 4.1.114.Final to 4.1.115.Final Bumps `netty.version` from 4.1.114.Final to 4.1.115.Final. Updates `io.netty:netty-transport` from 4.1.114.Final to 4.1.115.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.114.Final...netty-4.1.115.Final) Updates `io.netty:netty-codec` from 4.1.114.Final to 4.1.115.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.114.Final...netty-4.1.115.Final) Updates `io.netty:netty-handler` from 4.1.114.Final to 4.1.115.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.114.Final...netty-4.1.115.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.114.Final to 4.1.115.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.114.Final...netty-4.1.115.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e8f3751d30..af5a4be2bb 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.114.Final + 4.1.115.Final 0.34.1 4.2.28 1.13.6 From f20dc9c45675c100f6edc9279a93a6e882e0aa8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:11:18 +0000 Subject: [PATCH 259/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.3.5 to 1.4.0. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.3.5...v1.4.0) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e8f3751d30..29ff6a0115 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.11.0 0.10.5 1.2.5 - 1.3.5 + 1.4.0 1.0.4 3.13.0 3.5.2 From cc30ae1a09d73f74b7f5ac157c51233ae64c7a90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:11:27 +0000 Subject: [PATCH 260/449] Bump io.micrometer:micrometer-core from 1.13.6 to 1.14.0 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.13.6 to 1.14.0. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.13.6...v1.14.0) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e8f3751d30..c83420b934 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.114.Final 0.34.1 4.2.28 - 1.13.6 + 1.14.0 12.2.2 4.7.5 1.27.1 From 0eb5ea455d88c7ae9bbcc5bf39450b6814510c57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Nov 2024 16:11:57 +0000 Subject: [PATCH 261/449] Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.6.5 to 4.8.6.6 Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.8.6.5 to 4.8.6.6. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.8.6.5...spotbugs-maven-plugin-4.8.6.6) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 95170a24ec..d9dd632e2d 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,7 @@ 2.43.0 1.24.0 0.8.12 - 4.8.6.5 + 4.8.6.6 4.8.6 4.0 From 76048e073eb755290124024e19ca4b90a2f05f1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 13 Nov 2024 17:14:27 +0100 Subject: [PATCH 262/449] Add test for dynamic batch support class --- .../java/com/rabbitmq/stream/impl/Client.java | 3 +- .../rabbitmq/stream/impl/DynamicBatch.java | 19 ++- .../impl/DynamicBatchMessageAccumulator.java | 24 ++-- .../stream/impl/SimpleMessageAccumulator.java | 6 +- .../stream/impl/DynamicBatchTest.java | 118 +++++++++++++----- 5 files changed, 111 insertions(+), 59 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index a86a6881a1..5a169b2044 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -25,7 +25,6 @@ import static java.lang.String.join; import static java.util.Arrays.asList; import static java.util.concurrent.TimeUnit.SECONDS; -import static java.util.stream.StreamSupport.stream; import com.rabbitmq.stream.AuthenticationFailureException; import com.rabbitmq.stream.ByteCapacity; diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java index ba52d23950..44b85f5464 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java @@ -22,7 +22,6 @@ import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.TimeUnit; -import java.util.function.BiPredicate; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -33,11 +32,11 @@ final class DynamicBatch implements AutoCloseable { private static final int MAX_BATCH_SIZE = 8192; private final BlockingQueue requests = new LinkedBlockingQueue<>(); - private final BiPredicate, Boolean> consumer; + private final BatchConsumer consumer; private final int configuredBatchSize; private final Thread thread; - DynamicBatch(BiPredicate, Boolean> consumer, int batchSize) { + DynamicBatch(BatchConsumer consumer, int batchSize) { this.consumer = consumer; this.configuredBatchSize = min(max(batchSize, MIN_BATCH_SIZE), MAX_BATCH_SIZE); this.thread = ConcurrencyUtils.defaultThreadFactory().newThread(this::loop); @@ -56,7 +55,6 @@ private void loop() { State state = new State<>(); state.batchSize = this.configuredBatchSize; state.items = new ArrayList<>(state.batchSize); - state.retry = false; Thread currentThread = Thread.currentThread(); T item; while (!currentThread.isInterrupted()) { @@ -91,12 +89,11 @@ private static final class State { int batchSize; List items; - boolean retry; } private void maybeCompleteBatch(State state, boolean increaseIfCompleted) { try { - boolean completed = this.consumer.test(state.items, state.retry); + boolean completed = this.consumer.process(state.items); if (completed) { if (increaseIfCompleted) { state.batchSize = min(state.batchSize * 2, MAX_BATCH_SIZE); @@ -104,13 +101,9 @@ private void maybeCompleteBatch(State state, boolean increaseIfCompleted) { state.batchSize = max(state.batchSize / 2, MIN_BATCH_SIZE); } state.items = new ArrayList<>(state.batchSize); - state.retry = false; - } else { - state.retry = true; } } catch (Exception e) { LOGGER.warn("Error during dynamic batch completion: {}", e.getMessage()); - state.retry = true; } } @@ -118,4 +111,10 @@ private void maybeCompleteBatch(State state, boolean increaseIfCompleted) { public void close() { this.thread.interrupt(); } + + @FunctionalInterface + interface BatchConsumer { + + boolean process(List items); + } } diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java index 2b8d6241e9..1eab27313e 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java @@ -59,11 +59,13 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { observationCollector); this.producer = producer; this.observationCollector = (ObservationCollector) observationCollector; + boolean shouldObserve = !this.observationCollector.isNoop(); if (subEntrySize <= 1) { this.dynamicBatch = new DynamicBatch<>( - (items, replay) -> { - if (!replay) { + items -> { + boolean result = this.publish(items); + if (result && shouldObserve) { items.forEach( i -> { AccumulatedEntity entity = (AccumulatedEntity) i; @@ -71,7 +73,7 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { entity.observationContext(), entity.confirmationCallback().message()); }); } - return this.publish(items); + return result; }, batchSize); } else { @@ -79,7 +81,7 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { compressionCodec == null ? Compression.NONE.code() : compressionCodec.code(); this.dynamicBatch = new DynamicBatch<>( - (items, replay) -> { + items -> { List subBatches = new ArrayList<>(); int count = 0; ProducerUtils.Batch batch = @@ -88,10 +90,6 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { AccumulatedEntity lastMessageInBatch = null; for (Object msg : items) { AccumulatedEntity message = (AccumulatedEntity) msg; - if (!replay) { - this.observationCollector.published( - message.observationContext(), message.confirmationCallback().message()); - } lastMessageInBatch = message; batch.add( (Codec.EncodedMessage) message.encodedEntity(), @@ -116,7 +114,15 @@ final class DynamicBatchMessageAccumulator implements MessageAccumulator { batch.encodedMessageBatch.close(); subBatches.add(batch); } - return this.publish(subBatches); + boolean result = this.publish(subBatches); + if (result && shouldObserve) { + for (Object msg : items) { + AccumulatedEntity message = (AccumulatedEntity) msg; + this.observationCollector.published( + message.observationContext(), message.confirmationCallback().message()); + } + } + return result; }, batchSize * subEntrySize); } diff --git a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java index 97e99e4b9f..44acd3744b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java @@ -75,10 +75,8 @@ public void add(Message message, ConfirmationHandler confirmationHandler) { AccumulatedEntity get() { AccumulatedEntity entity = this.messages.poll(); - if (entity != null) { - this.observationCollector.published( - entity.observationContext(), entity.confirmationCallback().message()); - } + this.observationCollector.published( + entity.observationContext(), entity.confirmationCallback().message()); return entity; } diff --git a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java index 2049915457..bbc2484c50 100644 --- a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java @@ -14,58 +14,108 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; -import com.codahale.metrics.ConsoleReporter; -import com.codahale.metrics.Histogram; -import com.codahale.metrics.MetricRegistry; +import static com.rabbitmq.stream.impl.Assertions.assertThat; +import static com.rabbitmq.stream.impl.TestUtils.sync; +import static com.rabbitmq.stream.impl.TestUtils.waitAtMost; + +import com.codahale.metrics.*; import com.google.common.util.concurrent.RateLimiter; +import com.rabbitmq.stream.impl.TestUtils.Sync; +import java.util.Locale; import java.util.Random; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.IntStream; import org.junit.jupiter.api.Test; public class DynamicBatchTest { + private static void simulateActivity(long duration) { + try { + Thread.sleep(duration); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } + + private static void printHistogram(Histogram histogram) { + Locale locale = Locale.getDefault(); + System.out.printf(locale, " count = %d%n", histogram.getCount()); + Snapshot snapshot = histogram.getSnapshot(); + System.out.printf(locale, " min = %d%n", snapshot.getMin()); + System.out.printf(locale, " max = %d%n", snapshot.getMax()); + System.out.printf(locale, " mean = %2.2f%n", snapshot.getMean()); + System.out.printf(locale, " stddev = %2.2f%n", snapshot.getStdDev()); + System.out.printf(locale, " median = %2.2f%n", snapshot.getMedian()); + System.out.printf(locale, " 75%% <= %2.2f%n", snapshot.get75thPercentile()); + System.out.printf(locale, " 95%% <= %2.2f%n", snapshot.get95thPercentile()); + System.out.printf(locale, " 98%% <= %2.2f%n", snapshot.get98thPercentile()); + System.out.printf(locale, " 99%% <= %2.2f%n", snapshot.get99thPercentile()); + System.out.printf(locale, " 99.9%% <= %2.2f%n", snapshot.get999thPercentile()); + } + @Test - void test() { + void itemAreProcessed() { MetricRegistry metrics = new MetricRegistry(); Histogram batchSizeMetrics = metrics.histogram("batch-size"); - ConsoleReporter reporter = - ConsoleReporter.forRegistry(metrics) - .convertRatesTo(TimeUnit.SECONDS) - .convertDurationsTo(TimeUnit.MILLISECONDS) - .build(); - int itemCount = 3000; - TestUtils.Sync sync = TestUtils.sync(itemCount); + Sync sync = sync(itemCount); Random random = new Random(); - DynamicBatch batch = - new DynamicBatch<>( - (items, replay) -> { - batchSizeMetrics.update(items.size()); - try { - Thread.sleep(random.nextInt(10) + 1); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } - sync.down(items.size()); - return true; - }, - 100); - try { - RateLimiter rateLimiter = RateLimiter.create(3000); - long start = System.nanoTime(); + DynamicBatch.BatchConsumer action = + items -> { + batchSizeMetrics.update(items.size()); + simulateActivity(random.nextInt(10) + 1); + sync.down(items.size()); + return true; + }; + try (DynamicBatch batch = new DynamicBatch<>(action, 100)) { + RateLimiter rateLimiter = RateLimiter.create(10000); IntStream.range(0, itemCount) .forEach( i -> { rateLimiter.acquire(); batch.add(String.valueOf(i)); }); - Assertions.assertThat(sync).completes(); - long end = System.nanoTime(); - // System.out.println("Done in " + Duration.ofNanos(end - start)); - // reporter.report(); - } finally { - batch.close(); + assertThat(sync).completes(); + // printHistogram(batchSizeMetrics); + } + } + + @Test + void failedProcessingIsReplayed() throws Exception { + int itemCount = 10000; + AtomicInteger collected = new AtomicInteger(0); + AtomicInteger processed = new AtomicInteger(0); + AtomicBoolean canProcess = new AtomicBoolean(true); + DynamicBatch.BatchConsumer action = + items -> { + boolean result; + if (canProcess.get()) { + collected.addAndGet(items.size()); + processed.addAndGet(items.size()); + result = true; + } else { + result = false; + } + return result; + }; + try (DynamicBatch batch = new DynamicBatch<>(action, 100)) { + int firstRoundCount = itemCount / 5; + IntStream.range(0, firstRoundCount) + .forEach( + i -> { + batch.add(String.valueOf(i)); + }); + waitAtMost(() -> processed.get() == firstRoundCount); + canProcess.set(false); + IntStream.range(firstRoundCount, itemCount) + .forEach( + i -> { + batch.add(String.valueOf(i)); + }); + canProcess.set(true); + waitAtMost(() -> processed.get() == itemCount); + waitAtMost(() -> collected.get() == itemCount); } } } From 3c445db812152646739a6886855dcac87071828a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 13 Nov 2024 17:37:21 +0100 Subject: [PATCH 263/449] Null-check entity before observation collection --- .../com/rabbitmq/stream/impl/SimpleMessageAccumulator.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java index 44acd3744b..97e99e4b9f 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java @@ -75,8 +75,10 @@ public void add(Message message, ConfirmationHandler confirmationHandler) { AccumulatedEntity get() { AccumulatedEntity entity = this.messages.poll(); - this.observationCollector.published( - entity.observationContext(), entity.confirmationCallback().message()); + if (entity != null) { + this.observationCollector.published( + entity.observationContext(), entity.confirmationCallback().message()); + } return entity; } From 6c58e151d5523314b744d8aefb6b2ceab6f201d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:54:51 +0000 Subject: [PATCH 264/449] Bump io.micrometer:micrometer-core from 1.14.0 to 1.14.1 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.14.0 to 1.14.1. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.14.0...v1.14.1) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d9dd632e2d..8cfacd2aae 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.115.Final 0.34.1 4.2.28 - 1.14.0 + 1.14.1 12.2.2 4.7.5 1.27.1 From fc7c8fbf129197b0ff971a65859f21d7a9527a30 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 16:54:58 +0000 Subject: [PATCH 265/449] Bump org.asciidoctor:asciidoctor-maven-plugin from 3.1.0 to 3.1.1 Bumps [org.asciidoctor:asciidoctor-maven-plugin](https://github.com/asciidoctor/asciidoctor-maven-plugin) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/asciidoctor/asciidoctor-maven-plugin/releases) - [Changelog](https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/main/CHANGELOG.adoc) - [Commits](https://github.com/asciidoctor/asciidoctor-maven-plugin/compare/asciidoctor-maven-tools-3.1.0...asciidoctor-maven-tools-3.1.1) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctor-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d9dd632e2d..b33c303a8d 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.11.1 3.4.2 3.4.0 - 3.1.0 + 3.1.1 3.0.0 2.3.1 3.2.1 From a64b2b90c8763321e4bd9aef8f8cf671192c5cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 18 Nov 2024 10:15:12 +0100 Subject: [PATCH 266/449] Set release version to 0.20.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index 39bfdfacd9..66a11640c1 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,5 +1,5 @@ -RELEASE_VERSION="0.20.0.RC1" -DEVELOPMENT_VERSION="0.20.0-SNAPSHOT" +RELEASE_VERSION="0.20.0" +DEVELOPMENT_VERSION="0.21.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From c97c0472a687a9bfdd457fa8a44b7916d5a912c4 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 18 Nov 2024 09:17:10 +0000 Subject: [PATCH 267/449] [maven-release-plugin] prepare release v0.20.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index cab28f830b..87083b59d1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.20.0-SNAPSHOT + 0.20.0 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.20.0 From bb61b62000ac63707c0c01ff40a0ea3e52816098 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 18 Nov 2024 09:17:11 +0000 Subject: [PATCH 268/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 87083b59d1..3057338324 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.20.0 + 0.21.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.20.0 + HEAD From 2d78a99da0242a948fd9316ecac366ec41150230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 18 Nov 2024 10:40:35 +0100 Subject: [PATCH 269/449] Set release version to 0.21.0 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index 66a11640c1..4dc23ed6f3 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,4 +1,4 @@ -RELEASE_VERSION="0.20.0" +RELEASE_VERSION="0.21.0" DEVELOPMENT_VERSION="0.21.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 46c502f22b5d099913e9569d60c470146f532b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 18 Nov 2024 10:43:35 +0100 Subject: [PATCH 270/449] Polish Javadoc --- src/main/java/com/rabbitmq/stream/ProducerBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java index 79bc9905d6..02d6f48274 100644 --- a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java @@ -103,7 +103,7 @@ public interface ProducerBuilder { *

A dynamic-batch approach improves latency for low ingress rates. It can be counterproductive * for sustained high ingress rates. * - *

Set this flag to true if you want as little delay as possible before calling + *

Set this flag to true if you want as little delay as possible between calling * {@link Producer#send(Message, ConfirmationHandler)} and the message being sent to the broker. * *

Set this flag to false if latency is not critical for your use case and you From d4028a8af7588bd6f1a23e203f8fe092da12bcac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:55:21 +0000 Subject: [PATCH 271/449] Bump com.rabbitmq:amqp-client from 5.22.0 to 5.23.0 Bumps [com.rabbitmq:amqp-client](https://github.com/rabbitmq/rabbitmq-java-client) from 5.22.0 to 5.23.0. - [Release notes](https://github.com/rabbitmq/rabbitmq-java-client/releases) - [Commits](https://github.com/rabbitmq/rabbitmq-java-client/compare/v5.22.0...v5.23.0) --- updated-dependencies: - dependency-name: com.rabbitmq:amqp-client dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3057338324..8b97984ec8 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 5.11.3 3.26.3 5.14.2 - 5.22.0 + 5.23.0 3.17.0 1.17.1 2.11.0 From e3304f4d38b4a7fb1a3b77aa70069e16d6ffb8f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 16:55:31 +0000 Subject: [PATCH 272/449] Bump com.google.googlejavaformat:google-java-format Bumps [com.google.googlejavaformat:google-java-format](https://github.com/google/google-java-format) from 1.24.0 to 1.25.0. - [Release notes](https://github.com/google/google-java-format/releases) - [Commits](https://github.com/google/google-java-format/compare/v1.24.0...v1.25.0) --- updated-dependencies: - dependency-name: com.google.googlejavaformat:google-java-format dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3057338324..a5065a8d49 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 3.2.1 1.37 2.43.0 - 1.24.0 + 1.25.0 0.8.12 4.8.6.6 4.8.6 From 624cfc00720b71c658882ced265c75925318804d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:51:31 +0000 Subject: [PATCH 273/449] Bump com.github.luben:zstd-jni from 1.5.6-7 to 1.5.6-8 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.6-7 to 1.5.6-8. - [Commits](https://github.com/luben/zstd-jni/compare/v1.5.6-7...v1.5.6-8) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ed55a9b8ee..d9e26e1ac0 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 12.2.2 4.7.5 1.27.1 - 1.5.6-7 + 1.5.6-8 1.8.0 1.1.10.7 5.11.3 From 599d41d7d2a05ef70207a5ad3bebee35d7a21e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 25 Nov 2024 15:36:44 +0100 Subject: [PATCH 274/449] Consider candidates when picking a node And not only one node. --- .../stream/impl/ConsumersCoordinator.java | 64 +++++----- .../stream/impl/ProducersCoordinator.java | 43 +++---- .../stream/impl/StreamEnvironment.java | 5 +- .../java/com/rabbitmq/stream/impl/Utils.java | 109 ++++++++++-------- .../stream/impl/ConsumersCoordinatorTest.java | 74 ++++++++++-- .../stream/impl/ProducersCoordinatorTest.java | 18 ++- .../com/rabbitmq/stream/impl/UtilsTest.java | 25 ++-- src/test/resources/logback-test.xml | 2 + 8 files changed, 212 insertions(+), 128 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java index d563ffb3b1..9b0f311ed6 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -70,6 +70,7 @@ class ConsumersCoordinator { private final AtomicLong managerIdSequence = new AtomicLong(0); private final NavigableSet managers = new ConcurrentSkipListSet<>(); private final AtomicLong trackerIdSequence = new AtomicLong(0); + private final Function, Broker> brokerPicker; private final List trackers = new CopyOnWriteArrayList<>(); private final ExecutorServiceFactory executorServiceFactory = @@ -83,16 +84,14 @@ class ConsumersCoordinator { int maxConsumersByConnection, Function connectionNamingStrategy, ClientFactory clientFactory, - boolean forceReplica) { + boolean forceReplica, + Function, Broker> brokerPicker) { this.environment = environment; this.clientFactory = clientFactory; this.maxConsumersByConnection = maxConsumersByConnection; this.connectionNamingStrategy = connectionNamingStrategy; this.forceReplica = forceReplica; - } - - private static String keyForClientSubscription(Client.Broker broker) { - return broker.getHost() + ":" + broker.getPort(); + this.brokerPicker = brokerPicker; } private BackOffDelayPolicy recoveryBackOffDelayPolicy() { @@ -138,7 +137,7 @@ Runnable subscribe( flowStrategy); try { - addToManager(newNode, subscriptionTracker, offsetSpecification, true); + addToManager(newNode, candidates, subscriptionTracker, offsetSpecification, true); } catch (ConnectionStreamException e) { // these exceptions are not public throw new StreamException(e.getMessage()); @@ -162,6 +161,7 @@ Runnable subscribe( private void addToManager( Broker node, + List candidates, SubscriptionTracker tracker, OffsetSpecification offsetSpecification, boolean isInitialSubscription) { @@ -189,9 +189,9 @@ private void addToManager( } } if (pickedManager == null) { - String name = keyForClientSubscription(node); + String name = keyForNode(node); LOGGER.debug("Creating subscription manager on {}", name); - pickedManager = new ClientSubscriptionsManager(node, clientParameters); + pickedManager = new ClientSubscriptionsManager(node, candidates, clientParameters); LOGGER.debug("Created subscription manager on {}, id {}", name, pickedManager.id); } try { @@ -571,6 +571,7 @@ private class ClientSubscriptionsManager implements Comparable: (actual or advertised) private final String name; // the 2 data structures track the subscriptions, they must remain consistent private final Map> streamToStreamSubscriptions = @@ -582,12 +583,12 @@ private class ClientSubscriptionsManager implements Comparable candidates, Client.ClientParameters clientParameters) { this.id = managerIdSequence.getAndIncrement(); - this.node = node; - this.name = keyForClientSubscription(node); - LOGGER.debug("creating subscription manager on {}", name); this.trackerCount = 0; + AtomicReference nameReference = new AtomicReference<>(); + AtomicBoolean clientInitializedInManager = new AtomicBoolean(false); ChunkListener chunkListener = (client, subscriptionId, offset, messageCount, dataSize) -> { @@ -639,7 +640,7 @@ private ClientSubscriptionsManager(Broker node, Client.ClientParameters clientPa "Could not find stream subscription {} in manager {}, node {} for message listener", subscriptionId, this.id, - this.name); + nameReference.get()); } }; MessageIgnoredListener messageIgnoredListener = @@ -663,7 +664,7 @@ private ClientSubscriptionsManager(Broker node, Client.ClientParameters clientPa "Could not find stream subscription {} in manager {}, node {} for message ignored listener", subscriptionId, this.id, - this.name); + nameReference.get()); } }; ShutdownListener shutdownListener = @@ -675,7 +676,7 @@ private ClientSubscriptionsManager(Broker node, Client.ClientParameters clientPa if (shutdownContext.isShutdownUnexpected()) { LOGGER.debug( "Unexpected shutdown notification on subscription connection {}, scheduling consumers re-assignment", - name); + nameReference.get()); LOGGER.debug( "Subscription connection has {} consumer(s) over {} stream(s) to recover", this.subscriptionTrackers.stream().filter(Objects::nonNull).count(), @@ -718,7 +719,7 @@ private ClientSubscriptionsManager(Broker node, Client.ClientParameters clientPa } }, "Consumers re-assignment after disconnection from %s", - name)); + nameReference.get())); } }; MetadataListener metadataListener = @@ -792,18 +793,23 @@ private ClientSubscriptionsManager(Broker node, Client.ClientParameters clientPa }; String connectionName = connectionNamingStrategy.apply(ClientConnectionType.CONSUMER); ClientFactoryContext clientFactoryContext = - ClientFactoryContext.fromParameters( - clientParameters - .clientProperty("connection_name", connectionName) - .chunkListener(chunkListener) - .creditNotification(creditNotification) - .messageListener(messageListener) - .messageIgnoredListener(messageIgnoredListener) - .shutdownListener(shutdownListener) - .metadataListener(metadataListener) - .consumerUpdateListener(consumerUpdateListener)) - .key(name); + new ClientFactoryContext( + clientParameters + .clientProperty("connection_name", connectionName) + .chunkListener(chunkListener) + .creditNotification(creditNotification) + .messageListener(messageListener) + .messageIgnoredListener(messageIgnoredListener) + .shutdownListener(shutdownListener) + .metadataListener(metadataListener) + .consumerUpdateListener(consumerUpdateListener), + keyForNode(targetNode), + candidates); this.client = clientFactory.client(clientFactoryContext); + this.node = brokerFromClient(this.client); + this.name = keyForNode(this.node); + nameReference.set(this.name); + LOGGER.debug("creating subscription manager on {}", name); LOGGER.debug("Created consumer connection '{}'", connectionName); clientInitializedInManager.set(true); } @@ -906,7 +912,7 @@ private void recoverSubscription(List candidates, SubscriptionTracker tr } else { offsetSpecification = tracker.initialOffsetSpecification; } - addToManager(broker, tracker, offsetSpecification, false); + addToManager(broker, candidates, tracker, offsetSpecification, false); } } } else { diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java index 56143a0547..14a1f3adc0 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -32,13 +32,7 @@ import com.rabbitmq.stream.impl.Utils.ClientConnectionType; import com.rabbitmq.stream.impl.Utils.ClientFactory; import com.rabbitmq.stream.impl.Utils.ClientFactoryContext; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.NavigableSet; -import java.util.Objects; -import java.util.Set; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentSkipListSet; @@ -87,10 +81,6 @@ class ProducersCoordinator { this.connectionNamingStrategy = connectionNamingStrategy; } - private static String keyForNode(Client.Broker broker) { - return broker.getHost() + ":" + broker.getPort(); - } - Runnable registerProducer(StreamProducer producer, String reference, String stream) { return lock( this.coordinatorLock, @@ -162,7 +152,7 @@ private void addToManager(Broker node, AgentTracker tracker) { } if (pickedManager == null) { String name = keyForNode(node); - LOGGER.debug("Creating producer manager on {}", name); + LOGGER.debug("Trying to create producer manager on {}", name); pickedManager = new ClientProducersManager(node, this.clientFactory, clientParameters); LOGGER.debug("Created producer manager on {}, id {}", name, pickedManager.id); } @@ -578,10 +568,9 @@ private class ClientProducersManager implements Comparable nameReference = new AtomicReference<>(); AtomicReference ref = new AtomicReference<>(); AtomicBoolean clientInitializedInManager = new AtomicBoolean(false); PublishConfirmListener publishConfirmListener = @@ -636,7 +625,7 @@ private ClientProducersManager( }); }, "Producer recovery after disconnection from %s", - name)); + nameReference.get())); } }; MetadataListener metadataListener = @@ -685,15 +674,19 @@ private ClientProducersManager( }; String connectionName = connectionNamingStrategy.apply(ClientConnectionType.PRODUCER); ClientFactoryContext connectionFactoryContext = - ClientFactoryContext.fromParameters( - clientParameters - .publishConfirmListener(publishConfirmListener) - .publishErrorListener(publishErrorListener) - .shutdownListener(shutdownListener) - .metadataListener(metadataListener) - .clientProperty("connection_name", connectionName)) - .key(name); + new ClientFactoryContext( + clientParameters + .publishConfirmListener(publishConfirmListener) + .publishErrorListener(publishErrorListener) + .shutdownListener(shutdownListener) + .metadataListener(metadataListener) + .clientProperty("connection_name", connectionName), + keyForNode(targetNode), + Collections.emptyList()); this.client = cf.client(connectionFactoryContext); + this.node = Utils.brokerFromClient(this.client); + this.name = keyForNode(this.node); + nameReference.set(this.name); LOGGER.debug("Created producer connection '{}'", connectionName); clientInitializedInManager.set(true); ref.set(this.client); diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index ed951c38b7..3b66e0d3ca 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -219,7 +219,8 @@ class StreamEnvironment implements Environment { maxConsumersByConnection, connectionNamingStrategy, Utils.coordinatorClientFactory(this), - forceReplicaForConsumers); + forceReplicaForConsumers, + Utils.brokerPicker()); this.offsetTrackingCoordinator = new OffsetTrackingCoordinator(this); ClientParameters clientParametersForInit = locatorParametersCopy(); Runnable locatorInitSequence = diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index 745c7778a1..96fd9c22ac 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -15,6 +15,7 @@ package com.rabbitmq.stream.impl; import static java.lang.String.format; +import static java.util.Collections.unmodifiableList; import com.rabbitmq.stream.*; import com.rabbitmq.stream.impl.Client.ClientParameters; @@ -22,13 +23,7 @@ import java.net.UnknownHostException; import java.security.cert.X509Certificate; import java.time.Duration; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; +import java.util.*; import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; @@ -40,12 +35,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.locks.Lock; +import java.util.function.*; import java.util.function.Consumer; -import java.util.function.Function; -import java.util.function.LongConsumer; -import java.util.function.LongSupplier; -import java.util.function.Predicate; -import java.util.function.Supplier; import javax.net.ssl.X509TrustManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -157,14 +148,15 @@ static ClientFactory coordinatorClientFactory(StreamEnvironment environment) { address = environment.addressResolver().resolve(address); parametersCopy.host(address.host()).port(address.port()); - if (context.key() == null) { + if (context.targetKey() == null) { throw new IllegalArgumentException("A key is necessary to create the client connection"); } try { - return Utils.connectToAdvertisedNodeClientFactory( - context.key(), context1 -> new Client(context1.parameters())) - .client(Utils.ClientFactoryContext.fromParameters(parametersCopy).key(context.key())); + ClientFactory delegate = context1 -> new Client(context1.parameters()); + ClientFactoryContext clientFactoryContext = + new ClientFactoryContext(parametersCopy, context.targetKey(), context.candidates()); + return Utils.connectToAdvertisedNodeClientFactory(delegate).client(clientFactoryContext); } catch (TimeoutStreamException e) { throw new TimeoutStreamException( format(messageFormat, e.getMessage(), e.getCause().getMessage(), e.getCause())); @@ -181,29 +173,53 @@ static ClientFactory coordinatorClientFactory(StreamEnvironment environment) { }; } - static ClientFactory connectToAdvertisedNodeClientFactory( - String expectedAdvertisedHostPort, ClientFactory clientFactory) { + static ClientFactory connectToAdvertisedNodeClientFactory(ClientFactory clientFactory) { return connectToAdvertisedNodeClientFactory( - expectedAdvertisedHostPort, clientFactory, ExactNodeRetryClientFactory.RETRY_INTERVAL); + clientFactory, ConditionalClientFactory.RETRY_INTERVAL); } static ClientFactory connectToAdvertisedNodeClientFactory( - String expectedAdvertisedHostPort, ClientFactory clientFactory, Duration retryInterval) { - return new ExactNodeRetryClientFactory( + ClientFactory clientFactory, Duration retryInterval) { + return new ConditionalClientFactory( clientFactory, - client -> { + (ctx, client) -> { String currentKey = client.serverAdvertisedHost() + ":" + client.serverAdvertisedPort(); - boolean success = expectedAdvertisedHostPort.equals(currentKey); + boolean success = ctx.targetKey().equals(currentKey); + if (!success && !ctx.candidates().isEmpty()) { + success = ctx.candidates().stream().anyMatch(b -> currentKey.equals(keyForNode(b))); + } LOGGER.debug( - "Expected client {}, got {}: {}", - expectedAdvertisedHostPort, + "Expected client {}, got {}, viable candidates {}: {}", + ctx.targetKey(), currentKey, + ctx.candidates(), success ? "success" : "failure"); return success; }, retryInterval); } + static String keyForNode(Client.Broker broker) { + return broker.getHost() + ":" + broker.getPort(); + } + + static Client.Broker brokerFromClient(Client client) { + return new Client.Broker(client.serverAdvertisedHost(), client.serverAdvertisedPort()); + } + + static Function, Client.Broker> brokerPicker() { + Random random = new Random(); + return brokers -> { + if (brokers.isEmpty()) { + return null; + } else if (brokers.size() == 1) { + return brokers.get(0); + } else { + return brokers.get(random.nextInt(brokers.size())); + } + }; + } + static Runnable namedRunnable(Runnable task, String format, Object... args) { return new NamedRunnable(format(format, args), task); } @@ -295,16 +311,18 @@ interface ClientFactory { Client client(ClientFactoryContext context); } - static class ExactNodeRetryClientFactory implements ClientFactory { + static class ConditionalClientFactory implements ClientFactory { private static final Duration RETRY_INTERVAL = Duration.ofSeconds(1); private final ClientFactory delegate; - private final Predicate condition; + private final BiPredicate condition; private final Duration retryInterval; - ExactNodeRetryClientFactory( - ClientFactory delegate, Predicate condition, Duration retryInterval) { + ConditionalClientFactory( + ClientFactory delegate, + BiPredicate condition, + Duration retryInterval) { this.delegate = delegate; this.condition = condition; this.retryInterval = retryInterval; @@ -314,7 +332,7 @@ static class ExactNodeRetryClientFactory implements ClientFactory { public Client client(ClientFactoryContext context) { while (true) { Client client = this.delegate.client(context); - if (condition.test(client)) { + if (condition.test(context, client)) { return client; } else { try { @@ -335,29 +353,30 @@ public Client client(ClientFactoryContext context) { static class ClientFactoryContext { - private ClientParameters parameters; - private String key; + private final ClientParameters parameters; + private final String targetKey; + private final List candidates; - static ClientFactoryContext fromParameters(ClientParameters parameters) { - return new ClientFactoryContext().parameters(parameters); + ClientFactoryContext( + ClientParameters parameters, String targetKey, List candidates) { + this.parameters = parameters; + this.targetKey = targetKey; + this.candidates = + candidates == null + ? Collections.emptyList() + : unmodifiableList(new ArrayList<>(candidates)); } ClientParameters parameters() { return parameters; } - ClientFactoryContext parameters(ClientParameters parameters) { - this.parameters = parameters; - return this; - } - - String key() { - return key; + String targetKey() { + return targetKey; } - ClientFactoryContext key(String key) { - this.key = key; - return this; + List candidates() { + return candidates; } } diff --git a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java index 6b655e9141..1ac1c2b550 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -22,6 +22,7 @@ import static com.rabbitmq.stream.impl.TestUtils.metadata; import static com.rabbitmq.stream.impl.TestUtils.namedConsumer; import static com.rabbitmq.stream.impl.TestUtils.waitAtMost; +import static com.rabbitmq.stream.impl.Utils.brokerPicker; import static java.lang.String.format; import static java.util.Collections.emptyList; import static org.assertj.core.api.Assertions.assertThat; @@ -151,6 +152,7 @@ public Client.ClientParameters shutdownListener( when(environment.addressResolver()).thenReturn(address -> address); when(client.brokerVersion()).thenReturn("3.11.0"); when(client.isOpen()).thenReturn(true); + clientAdvertises(replica().get(0)); coordinator = new ConsumersCoordinator( @@ -158,7 +160,8 @@ public Client.ClientParameters shutdownListener( ConsumersCoordinator.MAX_SUBSCRIPTIONS_PER_CLIENT, type -> "consumer-connection", clientFactory, - false); + false, + brokerPicker()); } @AfterEach @@ -179,8 +182,7 @@ void tearDown() throws Exception { shouldRetryUntilGettingExactNodeWithAdvertisedHostNameClientFactoryAndNotExactNodeOnFirstTime() { ClientFactory cf = context -> - Utils.connectToAdvertisedNodeClientFactory( - context.key(), clientFactory, Duration.ofMillis(1)) + Utils.connectToAdvertisedNodeClientFactory(clientFactory, Duration.ofMillis(1)) .client(context); ConsumersCoordinator c = new ConsumersCoordinator( @@ -188,7 +190,8 @@ void tearDown() throws Exception { ConsumersCoordinator.MAX_SUBSCRIPTIONS_PER_CLIENT, type -> "consumer-connection", cf, - false); + false, + brokerPicker()); when(locator.metadata("stream")).thenReturn(metadata(null, replica())); when(clientFactory.client(any())).thenReturn(client); @@ -221,8 +224,7 @@ void tearDown() throws Exception { void shouldGetExactNodeImmediatelyWithAdvertisedHostNameClientFactoryAndExactNodeOnFirstTime() { ClientFactory cf = context -> - Utils.connectToAdvertisedNodeClientFactory( - context.key(), clientFactory, Duration.ofMillis(1)) + Utils.connectToAdvertisedNodeClientFactory(clientFactory, Duration.ofMillis(1)) .client(context); ConsumersCoordinator c = new ConsumersCoordinator( @@ -230,7 +232,8 @@ void shouldGetExactNodeImmediatelyWithAdvertisedHostNameClientFactoryAndExactNod ConsumersCoordinator.MAX_SUBSCRIPTIONS_PER_CLIENT, type -> "consumer-connection", cf, - false); + false, + brokerPicker()); when(locator.metadata("stream")).thenReturn(metadata(null, replica())); when(clientFactory.client(any())).thenReturn(client); @@ -259,6 +262,48 @@ void shouldGetExactNodeImmediatelyWithAdvertisedHostNameClientFactoryAndExactNod .subscribe(anyByte(), anyString(), any(OffsetSpecification.class), anyInt(), anyMap()); } + @Test + void shouldAcceptCandidateNode() { + ClientFactory cf = + context -> + Utils.connectToAdvertisedNodeClientFactory(clientFactory, Duration.ofMillis(1)) + .client(context); + ConsumersCoordinator c = + new ConsumersCoordinator( + environment, + ConsumersCoordinator.MAX_SUBSCRIPTIONS_PER_CLIENT, + type -> "consumer-connection", + cf, + false, + brokers -> brokers.get(0)); + + when(locator.metadata("stream")).thenReturn(metadata(null, replicas())); + when(clientFactory.client(any())).thenReturn(client); + when(client.subscribe( + subscriptionIdCaptor.capture(), + anyString(), + any(OffsetSpecification.class), + anyInt(), + anyMap())) + .thenReturn(new Client.Response(Constants.RESPONSE_CODE_OK)); + when(client.serverAdvertisedHost()).thenReturn("foo").thenReturn(replicas().get(1).getHost()); + when(client.serverAdvertisedPort()).thenReturn(42).thenReturn(replicas().get(1).getPort()); + + c.subscribe( + consumer, + "stream", + OffsetSpecification.first(), + null, + NO_OP_SUBSCRIPTION_LISTENER, + NO_OP_TRACKING_CLOSING_CALLBACK, + (offset, message) -> {}, + Collections.emptyMap(), + flowStrategy()); + verify(clientFactory, times(2)).client(any()); + verify(client, times(1)) + .subscribe(anyByte(), anyString(), any(OffsetSpecification.class), anyInt(), anyMap()); + } + @Test @SuppressWarnings("unchecked") void shouldSubscribeWithEmptyPropertiesWithUnamedConsumer() { @@ -495,6 +540,7 @@ void shouldNotUnsubscribeIfClientIsClosed() { @Test void subscribeShouldSubscribeToStreamAndDispatchMessageWithManySubscriptions() { when(locator.metadata("stream")).thenReturn(metadata(leader(), null)); + clientAdvertises(leader()); when(clientFactory.client(any())).thenReturn(client); when(client.subscribe( @@ -1078,6 +1124,7 @@ void metadataUpdate_shouldCloseConsumerIfRetryTimeoutIsReached() throws Exceptio void shouldUseNewClientsForMoreThanMaxSubscriptionsAndCloseClientAfterUnsubscriptions( int maxConsumersByConnection) { when(locator.metadata("stream")).thenReturn(metadata(leader(), null)); + clientAdvertises(leader()); when(clientFactory.client(any())).thenReturn(client); @@ -1099,7 +1146,8 @@ void shouldUseNewClientsForMoreThanMaxSubscriptionsAndCloseClientAfterUnsubscrip maxConsumersByConnection, type -> "consumer-connection", clientFactory, - false); + false, + brokerPicker()); List closingRunnables = IntStream.range(0, subscriptionCount) @@ -1919,7 +1967,8 @@ void shouldRetryUntilReplicaIsAvailableWhenForceReplicaIsOn() throws Exception { ConsumersCoordinator.MAX_SUBSCRIPTIONS_PER_CLIENT, type -> "consumer-connection", clientFactory, - true); + true, + brokerPicker()); AtomicInteger messageHandlerCalls = new AtomicInteger(); Runnable closingRunnable = @@ -2066,4 +2115,9 @@ private static Response responseOk() { private static ConsumerFlowStrategy flowStrategy() { return ConsumerFlowStrategy.creditOnChunkArrival(10); } + + private void clientAdvertises(Client.Broker broker) { + when(client.serverAdvertisedHost()).thenReturn(broker.getHost()); + when(client.serverAdvertisedPort()).thenReturn(broker.getPort()); + } } diff --git a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java index 238c645053..dc89e5ec4c 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -117,6 +117,8 @@ public Client.ClientParameters metadataListener( when(trackingConsumer.stream()).thenReturn("stream"); when(client.declarePublisher(anyByte(), isNull(), anyString())) .thenReturn(new Response(Constants.RESPONSE_CODE_OK)); + when(client.serverAdvertisedHost()).thenReturn(leader().getHost()); + when(client.serverAdvertisedPort()).thenReturn(leader().getPort()); coordinator = new ProducersCoordinator( environment, @@ -184,8 +186,7 @@ void registerShouldAllowPublishing() { shouldRetryUntilGettingExactNodeWithAdvertisedHostNameClientFactoryAndNotExactNodeOnFirstTime() { ClientFactory cf = context -> - Utils.connectToAdvertisedNodeClientFactory( - context.key(), clientFactory, Duration.ofMillis(1)) + Utils.connectToAdvertisedNodeClientFactory(clientFactory, Duration.ofMillis(1)) .client(context); ProducersCoordinator c = new ProducersCoordinator( @@ -212,8 +213,7 @@ void registerShouldAllowPublishing() { void shouldGetExactNodeImmediatelyWithAdvertisedHostNameClientFactoryAndExactNodeOnFirstTime() { ClientFactory cf = context -> - Utils.connectToAdvertisedNodeClientFactory( - context.key(), clientFactory, Duration.ofMillis(1)) + Utils.connectToAdvertisedNodeClientFactory(clientFactory, Duration.ofMillis(1)) .client(context); ProducersCoordinator c = new ProducersCoordinator( @@ -391,6 +391,10 @@ void shouldRedistributeProducersAndTrackingConsumersOnMetadataUpdate() throws Ex .thenReturn(metadata(movingStream, null, replicas())) .thenReturn(metadata(movingStream, leader2(), replicas())); + // the created client is on leader1 + when(client.serverAdvertisedHost()).thenReturn(leader1().getHost()); + when(client.serverAdvertisedPort()).thenReturn(leader1().getPort()); + String fixedStream = "fixed-stream"; when(locator.metadata(fixedStream)).thenReturn(metadata(fixedStream, leader1(), replicas())); @@ -440,6 +444,10 @@ void shouldRedistributeProducersAndTrackingConsumersOnMetadataUpdate() throws Ex verify(fixedTrackingConsumer, times(1)).setTrackingClient(client); assertThat(coordinator.clientCount()).isEqualTo(1); + // the created client is on leader2 + when(client.serverAdvertisedHost()).thenReturn(leader2().getHost()); + when(client.serverAdvertisedPort()).thenReturn(leader2().getPort()); + metadataListener.handle(movingStream, Constants.RESPONSE_CODE_STREAM_NOT_AVAILABLE); assertThat(setClientLatch.await(5, TimeUnit.SECONDS)).isTrue(); diff --git a/src/test/java/com/rabbitmq/stream/impl/UtilsTest.java b/src/test/java/com/rabbitmq/stream/impl/UtilsTest.java index b8b3e8c1b3..bd564968f4 100644 --- a/src/test/java/com/rabbitmq/stream/impl/UtilsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/UtilsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -20,6 +20,7 @@ import static com.rabbitmq.stream.impl.Utils.defaultConnectionNamingStrategy; import static com.rabbitmq.stream.impl.Utils.formatConstant; import static com.rabbitmq.stream.impl.Utils.offsetBefore; +import static java.util.Collections.emptyList; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; @@ -32,10 +33,10 @@ import com.rabbitmq.stream.impl.Utils.ClientConnectionType; import com.rabbitmq.stream.impl.Utils.ClientFactory; import com.rabbitmq.stream.impl.Utils.ClientFactoryContext; -import com.rabbitmq.stream.impl.Utils.ExactNodeRetryClientFactory; +import com.rabbitmq.stream.impl.Utils.ConditionalClientFactory; import java.time.Duration; +import java.util.function.BiPredicate; import java.util.function.Function; -import java.util.function.Predicate; import java.util.stream.IntStream; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -53,14 +54,14 @@ void formatConstantOk() { } @Test - void exactNodeRetryClientFactoryShouldReturnImmediatelyIfConditionOk() { + void conditionalClientFactoryShouldReturnImmediatelyIfConditionOk() { Client client = mock(Client.class); ClientFactory cf = mock(ClientFactory.class); when(cf.client(any())).thenReturn(client); - Predicate condition = c -> true; + BiPredicate condition = (ctx, c) -> true; Client result = - new ExactNodeRetryClientFactory(cf, condition, Duration.ofMillis(1)) - .client(ClientFactoryContext.fromParameters(new ClientParameters())); + new ConditionalClientFactory(cf, condition, Duration.ofMillis(1)) + .client(new ClientFactoryContext(new ClientParameters(), "", emptyList())); assertThat(result).isEqualTo(client); verify(cf, times(1)).client(any()); verify(client, never()).close(); @@ -68,15 +69,15 @@ void exactNodeRetryClientFactoryShouldReturnImmediatelyIfConditionOk() { @Test @SuppressWarnings("unchecked") - void exactNodeRetryClientFactoryShouldRetryUntilConditionOk() { + void conditionalClientFactoryShouldRetryUntilConditionOk() { Client client = mock(Client.class); ClientFactory cf = mock(ClientFactory.class); when(cf.client(any())).thenReturn(client); - Predicate condition = mock(Predicate.class); - when(condition.test(any())).thenReturn(false).thenReturn(false).thenReturn(true); + BiPredicate condition = mock(BiPredicate.class); + when(condition.test(any(), any())).thenReturn(false).thenReturn(false).thenReturn(true); Client result = - new ExactNodeRetryClientFactory(cf, condition, Duration.ofMillis(1)) - .client(ClientFactoryContext.fromParameters(new ClientParameters())); + new ConditionalClientFactory(cf, condition, Duration.ofMillis(1)) + .client(new ClientFactoryContext(new ClientParameters(), "", emptyList())); assertThat(result).isEqualTo(client); verify(cf, times(3)).client(any()); verify(client, times(2)).close(); diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 4bec720537..b24a27dca8 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -6,6 +6,8 @@ + + From d8bdf7f8fa96e9780685b3148c93c3ba98b09e67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 26 Nov 2024 11:20:23 +0100 Subject: [PATCH 275/449] Refine node picking for consumers --- .../stream/impl/ConsumersCoordinator.java | 82 +++++++----- .../java/com/rabbitmq/stream/impl/Utils.java | 49 ++++++- src/test/java/com/rabbitmq/stream/Host.java | 4 +- .../stream/impl/ConsumersCoordinatorTest.java | 88 ++++++++++--- .../stream/impl/LoadBalancerClusterTest.java | 124 ++++++++++++++++++ .../stream/impl/MonitoringTestUtils.java | 8 +- .../stream/impl/StreamTestInfrastructure.java | 24 ++++ .../com/rabbitmq/stream/impl/TestUtils.java | 32 +++++ src/test/resources/logback-test.xml | 2 +- 9 files changed, 352 insertions(+), 61 deletions(-) create mode 100644 src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java create mode 100644 src/test/java/com/rabbitmq/stream/impl/StreamTestInfrastructure.java diff --git a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java index 9b0f311ed6..d60f4ff943 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java @@ -16,6 +16,7 @@ import static com.rabbitmq.stream.impl.Utils.*; import static java.lang.String.format; +import static java.util.stream.Collectors.toList; import com.rabbitmq.stream.*; import com.rabbitmq.stream.Consumer; @@ -35,7 +36,6 @@ import java.util.Map.Entry; import java.util.NavigableSet; import java.util.Objects; -import java.util.Random; import java.util.Set; import java.util.concurrent.Callable; import java.util.concurrent.ConcurrentHashMap; @@ -53,7 +53,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -class ConsumersCoordinator { +final class ConsumersCoordinator implements AutoCloseable { static final int MAX_SUBSCRIPTIONS_PER_CLIENT = 256; static final int MAX_ATTEMPT_BEFORE_FALLING_BACK_TO_LEADER = 5; @@ -62,7 +62,6 @@ class ConsumersCoordinator { static final OffsetSpecification DEFAULT_OFFSET_SPECIFICATION = OffsetSpecification.next(); private static final Logger LOGGER = LoggerFactory.getLogger(ConsumersCoordinator.class); - private final Random random = new Random(); private final StreamEnvironment environment; private final ClientFactory clientFactory; private final int maxConsumersByConnection; @@ -115,8 +114,8 @@ Runnable subscribe( return lock( this.coordinatorLock, () -> { - List candidates = findBrokersForStream(stream, forceReplica); - Client.Broker newNode = pickBroker(candidates); + List candidates = findCandidateNodes(stream, forceReplica); + Broker newNode = pickBroker(this.brokerPicker, candidates); if (newNode == null) { throw new IllegalStateException("No available node to subscribe to"); } @@ -161,7 +160,7 @@ Runnable subscribe( private void addToManager( Broker node, - List candidates, + List candidates, SubscriptionTracker tracker, OffsetSpecification offsetSpecification, boolean isInitialSubscription) { @@ -231,7 +230,7 @@ int managerCount() { } // package protected for testing - List findBrokersForStream(String stream, boolean forceReplica) { + List findCandidateNodes(String stream, boolean forceReplica) { LOGGER.debug( "Candidate lookup to consumer from '{}', forcing replica? {}", stream, forceReplica); Map metadata = @@ -254,12 +253,13 @@ List findBrokersForStream(String stream, boolean forceReplica) { } } - List replicas = streamMetadata.getReplicas(); - if ((replicas == null || replicas.isEmpty()) && streamMetadata.getLeader() == null) { + Broker leader = streamMetadata.getLeader(); + List replicas = streamMetadata.getReplicas(); + if ((replicas == null || replicas.isEmpty()) && leader == null) { throw new IllegalStateException("No node available to consume from stream " + stream); } - List brokers; + List brokers; if (replicas == null || replicas.isEmpty()) { if (forceReplica) { throw new IllegalStateException( @@ -268,13 +268,18 @@ List findBrokersForStream(String stream, boolean forceReplica) { + "consuming from leader has been deactivated for this consumer", stream)); } else { - brokers = Collections.singletonList(streamMetadata.getLeader()); - LOGGER.debug( - "Only leader node {} for consuming from {}", streamMetadata.getLeader(), stream); + brokers = Collections.singletonList(new BrokerWrapper(leader, true)); + LOGGER.debug("Only leader node {} for consuming from {}", leader, stream); } } else { LOGGER.debug("Replicas for consuming from {}: {}", stream, replicas); - brokers = new ArrayList<>(replicas); + brokers = + replicas.stream() + .map(b -> new BrokerWrapper(b, false)) + .collect(Collectors.toCollection(ArrayList::new)); + if (!forceReplica && leader != null) { + brokers.add(new BrokerWrapper(leader, true)); + } } LOGGER.debug("Candidates to consume from {}: {}", stream, brokers); @@ -282,7 +287,7 @@ List findBrokersForStream(String stream, boolean forceReplica) { return brokers; } - private Callable> findBrokersForStream(String stream) { + private Callable> findCandidateNodes(String stream) { AtomicInteger attemptNumber = new AtomicInteger(); return () -> { boolean mustUseReplica; @@ -294,20 +299,10 @@ private Callable> findBrokersForStream(String stream) { } LOGGER.debug( "Looking for broker(s) for stream {}, forcing replica {}", stream, mustUseReplica); - return findBrokersForStream(stream, mustUseReplica); + return findCandidateNodes(stream, mustUseReplica); }; } - private Client.Broker pickBroker(List brokers) { - if (brokers.isEmpty()) { - return null; - } else if (brokers.size() == 1) { - return brokers.get(0); - } else { - return brokers.get(random.nextInt(brokers.size())); - } - } - public void close() { Iterator iterator = this.managers.iterator(); while (iterator.hasNext()) { @@ -584,7 +579,9 @@ private class ClientSubscriptionsManager implements Comparable candidates, Client.ClientParameters clientParameters) { + Broker targetNode, + List candidates, + Client.ClientParameters clientParameters) { this.id = managerIdSequence.getAndIncrement(); this.trackerCount = 0; AtomicReference nameReference = new AtomicReference<>(); @@ -804,7 +801,7 @@ private ClientSubscriptionsManager( .metadataListener(metadataListener) .consumerUpdateListener(consumerUpdateListener), keyForNode(targetNode), - candidates); + candidates.stream().map(BrokerWrapper::broker).collect(toList())); this.client = clientFactory.client(clientFactoryContext); this.node = brokerFromClient(this.client); this.name = keyForNode(this.node); @@ -834,7 +831,7 @@ private void assignConsumersToStream( } }; - AsyncRetry.asyncRetry(findBrokersForStream(stream)) + AsyncRetry.asyncRetry(findCandidateNodes(stream)) .description("Candidate lookup to consume from '%s'", stream) .scheduler(environment.scheduledExecutorService()) .retry(ex -> !(ex instanceof StreamDoesNotExistException)) @@ -842,7 +839,7 @@ private void assignConsumersToStream( .build() .thenAccept( candidateNodes -> { - List candidates = candidateNodes; + List candidates = candidateNodes; if (candidates == null) { LOGGER.debug("No candidate nodes to consume from '{}'", stream); consumersClosingCallback.run(); @@ -876,7 +873,8 @@ private List createSubscriptionTrackerList() { return newSubscriptions; } - private void maybeRecoverSubscription(List candidates, SubscriptionTracker tracker) { + private void maybeRecoverSubscription( + List candidates, SubscriptionTracker tracker) { if (tracker.compareAndSet(SubscriptionState.ACTIVE, SubscriptionState.RECOVERING)) { try { recoverSubscription(candidates, tracker); @@ -897,12 +895,12 @@ private void maybeRecoverSubscription(List candidates, SubscriptionTrack } } - private void recoverSubscription(List candidates, SubscriptionTracker tracker) { + private void recoverSubscription(List candidates, SubscriptionTracker tracker) { boolean reassignmentCompleted = false; while (!reassignmentCompleted) { try { if (tracker.consumer.isOpen()) { - Broker broker = pickBroker(candidates); + Broker broker = pickBroker(brokerPicker, candidates); LOGGER.debug("Using {} to resume consuming from {}", broker, tracker.stream); synchronized (tracker.consumer) { if (tracker.consumer.isOpen()) { @@ -933,7 +931,7 @@ private void recoverSubscription(List candidates, SubscriptionTracker tr // maybe not a good candidate, let's refresh and retry for this one candidates = Utils.callAndMaybeRetry( - findBrokersForStream(tracker.stream), + findCandidateNodes(tracker.stream), ex -> !(ex instanceof StreamDoesNotExistException), recoveryBackOffDelayPolicy(), "Candidate lookup to consume from '%s' (subscription recovery)", @@ -1301,4 +1299,20 @@ static int pickSlot(List list, AtomicInteger sequence) { } return index; } + + private static List keepReplicasIfPossible(Collection brokers) { + if (brokers.size() > 1) { + return brokers.stream() + .filter(w -> !w.isLeader()) + .map(BrokerWrapper::broker) + .collect(toList()); + } else { + return brokers.stream().map(BrokerWrapper::broker).collect(toList()); + } + } + + static Broker pickBroker( + Function, Broker> picker, Collection candidates) { + return picker.apply(keepReplicasIfPossible(candidates)); + } } diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index 96fd9c22ac..558d2a347b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -136,6 +136,11 @@ static short encodeResponseCode(Short code) { } static ClientFactory coordinatorClientFactory(StreamEnvironment environment) { + return coordinatorClientFactory(environment, ConditionalClientFactory.RETRY_INTERVAL); + } + + static ClientFactory coordinatorClientFactory( + StreamEnvironment environment, Duration retryInterval) { String messageFormat = "%s. %s. " + "This may be due to the usage of a load balancer that makes topology discovery fail. " @@ -156,7 +161,8 @@ static ClientFactory coordinatorClientFactory(StreamEnvironment environment) { ClientFactory delegate = context1 -> new Client(context1.parameters()); ClientFactoryContext clientFactoryContext = new ClientFactoryContext(parametersCopy, context.targetKey(), context.candidates()); - return Utils.connectToAdvertisedNodeClientFactory(delegate).client(clientFactoryContext); + return Utils.connectToAdvertisedNodeClientFactory(delegate, retryInterval) + .client(clientFactoryContext); } catch (TimeoutStreamException e) { throw new TimeoutStreamException( format(messageFormat, e.getMessage(), e.getCause().getMessage(), e.getCause())); @@ -173,11 +179,6 @@ static ClientFactory coordinatorClientFactory(StreamEnvironment environment) { }; } - static ClientFactory connectToAdvertisedNodeClientFactory(ClientFactory clientFactory) { - return connectToAdvertisedNodeClientFactory( - clientFactory, ConditionalClientFactory.RETRY_INTERVAL); - } - static ClientFactory connectToAdvertisedNodeClientFactory( ClientFactory clientFactory, Duration retryInterval) { return new ConditionalClientFactory( @@ -692,4 +693,40 @@ static T lock(Lock lock, Supplier action) { lock.unlock(); } } + + static class BrokerWrapper { + + private final Client.Broker broker; + private final boolean leader; + + BrokerWrapper(Client.Broker broker, boolean leader) { + this.broker = broker; + this.leader = leader; + } + + Client.Broker broker() { + return broker; + } + + boolean isLeader() { + return this.leader; + } + + @Override + public boolean equals(Object o) { + if (o == null || getClass() != o.getClass()) return false; + BrokerWrapper that = (BrokerWrapper) o; + return leader == that.leader && Objects.equals(broker, that.broker); + } + + @Override + public int hashCode() { + return Objects.hash(broker, leader); + } + + @Override + public String toString() { + return "BrokerWrapper{" + "broker=" + broker + ", leader=" + leader + '}'; + } + } } diff --git a/src/test/java/com/rabbitmq/stream/Host.java b/src/test/java/com/rabbitmq/stream/Host.java index f1267075ed..48c8c0d972 100644 --- a/src/test/java/com/rabbitmq/stream/Host.java +++ b/src/test/java/com/rabbitmq/stream/Host.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -118,7 +118,7 @@ static Process rabbitmqStreams(String command) { return executeCommand(rabbitmqStreamsCommand() + " " + command); } - public static Process rabbitmqctlIgnoreError(String command) throws IOException { + public static Process rabbitmqctlIgnoreError(String command) { return executeCommand(rabbitmqctlCommand() + " " + command, true); } diff --git a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java index 1ac1c2b550..acb40d7314 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java @@ -15,8 +15,7 @@ package com.rabbitmq.stream.impl; import static com.rabbitmq.stream.BackOffDelayPolicy.fixedWithInitialDelay; -import static com.rabbitmq.stream.impl.ConsumersCoordinator.MAX_SUBSCRIPTIONS_PER_CLIENT; -import static com.rabbitmq.stream.impl.ConsumersCoordinator.pickSlot; +import static com.rabbitmq.stream.impl.ConsumersCoordinator.*; import static com.rabbitmq.stream.impl.TestUtils.b; import static com.rabbitmq.stream.impl.TestUtils.latchAssert; import static com.rabbitmq.stream.impl.TestUtils.metadata; @@ -25,6 +24,9 @@ import static com.rabbitmq.stream.impl.Utils.brokerPicker; import static java.lang.String.format; import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static java.util.stream.Collectors.toList; +import static java.util.stream.IntStream.*; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.ArgumentMatchers.any; @@ -53,8 +55,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.IntStream; +import java.util.function.Function; import java.util.stream.Stream; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -441,17 +442,58 @@ void subscribeShouldThrowExceptionIfNoNodeAvailableForStream() { } @Test - void findBrokersForStreamShouldReturnLeaderIfNoReplicas() { + void findCandidateNodesShouldReturnLeaderIfNoReplicas() { when(locator.metadata("stream")).thenReturn(metadata(leader(), null)); - assertThat(coordinator.findBrokersForStream("stream", false)).hasSize(1).contains(leader()); + assertThat(coordinator.findCandidateNodes("stream", false)) + .hasSize(1) + .contains(leaderWrapper()); } @Test - void findBrokersForStreamShouldReturnReplicasIfThereAreSome() { + void findCandidateNodesShouldReturnReplicasIfThereAreSome() { when(locator.metadata("stream")).thenReturn(metadata(null, replicas())); - assertThat(coordinator.findBrokersForStream("stream", false)) + assertThat(coordinator.findCandidateNodes("stream", false)) .hasSize(2) - .hasSameElementsAs(replicas()); + .hasSameElementsAs(replicaWrappers()); + } + + @Test + void findCandidateNodesShouldReturnLeaderAndReplicasIfForceReplicaIsFalse() { + when(locator.metadata("stream")).thenReturn(metadata(leader(), replicas())); + assertThat(coordinator.findCandidateNodes("stream", false)) + .hasSize(3) + .contains(leaderWrapper()) + .containsAll(replicaWrappers()); + } + + @Test + void findCandidateNodesShouldReturnOnlyReplicasIfForceReplicaIsTrue() { + when(locator.metadata("stream")).thenReturn(metadata(leader(), replicas())); + assertThat(coordinator.findCandidateNodes("stream", true)) + .hasSize(2) + .containsAll(replicaWrappers()); + } + + @Test + void pickBrokerShouldPreferReplicas() { + Client.Broker leader = leader(); + List replicas = replicas(); + AtomicInteger sequence = new AtomicInteger(); + Function, Client.Broker> picker = + candidates -> candidates.get(sequence.getAndIncrement() % candidates.size()); + // never pick a leader if replicas are available + List leaderAndOneReplica = + Arrays.asList(leaderWrapper(), replicaWrappers().get(0)); + range(0, 10) + .forEach( + ignored -> { + Client.Broker picked = pickBroker(picker, nodeWrappers()); + assertThat(picked).isNotEqualTo(leader).isIn(replicas); + picked = pickBroker(picker, leaderAndOneReplica); + assertThat(picked).isNotEqualTo(leader).isIn(replicas); + }); + // pick the leader if it is the only one + assertThat(pickBroker(picker, singletonList(leaderWrapper()))).isEqualTo(leader); } @Test @@ -1150,7 +1192,7 @@ void shouldUseNewClientsForMoreThanMaxSubscriptionsAndCloseClientAfterUnsubscrip brokerPicker()); List closingRunnables = - IntStream.range(0, subscriptionCount) + range(0, subscriptionCount) .mapToObj( i -> coordinator.subscribe( @@ -1163,7 +1205,7 @@ void shouldUseNewClientsForMoreThanMaxSubscriptionsAndCloseClientAfterUnsubscrip (offset, message) -> {}, Collections.emptyMap(), flowStrategy())) - .collect(Collectors.toList()); + .collect(toList()); verify(clientFactory, times(2)).client(any()); verify(client, times(subscriptionCount)) @@ -1211,7 +1253,7 @@ void shouldRemoveClientSubscriptionManagerFromPoolAfterConnectionDies() throws E int extraSubscriptionCount = ConsumersCoordinator.MAX_SUBSCRIPTIONS_PER_CLIENT / 5; int subscriptionCount = ConsumersCoordinator.MAX_SUBSCRIPTIONS_PER_CLIENT + extraSubscriptionCount; - IntStream.range(0, subscriptionCount) + range(0, subscriptionCount) .forEach( i -> { coordinator.subscribe( @@ -1276,7 +1318,7 @@ void shouldRemoveClientSubscriptionManagerFromPoolIfEmptyAfterMetadataUpdate() t int extraSubscriptionCount = ConsumersCoordinator.MAX_SUBSCRIPTIONS_PER_CLIENT / 5; int subscriptionCount = ConsumersCoordinator.MAX_SUBSCRIPTIONS_PER_CLIENT + extraSubscriptionCount; - IntStream.range(0, subscriptionCount) + range(0, subscriptionCount) .forEach( i -> { coordinator.subscribe( @@ -2039,7 +2081,7 @@ void shouldRetryUntilReplicaIsAvailableWhenForceReplicaIsOn() throws Exception { @Test void pickSlotTest() { List list = new ArrayList<>(ConsumersCoordinator.MAX_SUBSCRIPTIONS_PER_CLIENT); - IntStream.range(0, MAX_SUBSCRIPTIONS_PER_CLIENT).forEach(ignored -> list.add(null)); + range(0, MAX_SUBSCRIPTIONS_PER_CLIENT).forEach(ignored -> list.add(null)); AtomicInteger sequence = new AtomicInteger(0); int index = pickSlot(list, sequence); assertThat(index).isZero(); @@ -2077,14 +2119,28 @@ void pickSlotTest() { assertThat(index).isEqualTo(5); } - Client.Broker leader() { + static Client.Broker leader() { return new Client.Broker("leader", -1); } - List replicas() { + static Utils.BrokerWrapper leaderWrapper() { + return new Utils.BrokerWrapper(leader(), true); + } + + static List replicas() { return Arrays.asList(new Client.Broker("replica1", -1), new Client.Broker("replica2", -1)); } + static List nodeWrappers() { + List wrappers = new ArrayList<>(replicaWrappers()); + wrappers.add(leaderWrapper()); + return wrappers; + } + + static List replicaWrappers() { + return replicas().stream().map(b -> new Utils.BrokerWrapper(b, false)).collect(toList()); + } + List replica() { return replicas().subList(0, 1); } diff --git a/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java new file mode 100644 index 0000000000..727ccc58e4 --- /dev/null +++ b/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java @@ -0,0 +1,124 @@ +// Copyright (c) 2024 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.impl; + +import static java.lang.Integer.parseInt; +import static java.util.stream.Collectors.toSet; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; + +import com.rabbitmq.stream.Address; +import com.rabbitmq.stream.ConsumerFlowStrategy; +import com.rabbitmq.stream.OffsetSpecification; +import com.rabbitmq.stream.SubscriptionListener; +import com.rabbitmq.stream.impl.MonitoringTestUtils.ConsumerCoordinatorInfo; +import com.rabbitmq.stream.impl.TestUtils.DisabledIfNotCluster; +import io.netty.channel.EventLoopGroup; +import java.time.Duration; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import java.util.stream.IntStream; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; + +@DisabledIfNotCluster +@StreamTestInfrastructure +public class LoadBalancerClusterTest { + + private static final int LB_PORT = 5555; + private static final SubscriptionListener NO_OP_SUBSCRIPTION_LISTENER = subscriptionContext -> {}; + private static final Runnable NO_OP_TRACKING_CLOSING_CALLBACK = () -> {}; + + @Mock StreamEnvironment environment; + @Mock StreamConsumer consumer; + AutoCloseable mocks; + TestUtils.ClientFactory cf; + String stream; + EventLoopGroup eventLoopGroup; + Client locator; + + @BeforeEach + void init() { + mocks = MockitoAnnotations.openMocks(this); + locator = cf.get(new Client.ClientParameters().port(LB_PORT)); + when(environment.locator()).thenReturn(locator); + when(environment.clientParametersCopy()) + .thenReturn(new Client.ClientParameters().eventLoopGroup(eventLoopGroup).port(LB_PORT)); + Address loadBalancerAddress = new Address("localhost", LB_PORT); + when(environment.addressResolver()).thenReturn(address -> loadBalancerAddress); + when(environment.locatorOperation(any())).thenCallRealMethod(); + } + + @AfterEach + void tearDown() throws Exception { + mocks.close(); + } + + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void pickConsumersAmongCandidates(boolean forceReplica) { + int maxSubscriptionsPerClient = 2; + int subscriptionCount = maxSubscriptionsPerClient * 10; + try (ConsumersCoordinator c = + new ConsumersCoordinator( + environment, + maxSubscriptionsPerClient, + type -> "consumer-connection", + Utils.coordinatorClientFactory(this.environment, Duration.ofMillis(10)), + forceReplica, + Utils.brokerPicker())) { + + IntStream.range(0, subscriptionCount) + .forEach( + ignored -> { + c.subscribe( + consumer, + stream, + OffsetSpecification.first(), + null, + NO_OP_SUBSCRIPTION_LISTENER, + NO_OP_TRACKING_CLOSING_CALLBACK, + (offset, message) -> {}, + Collections.emptyMap(), + flowStrategy()); + }); + + Client.StreamMetadata metadata = locator.metadata(stream).get(stream); + Set allowedNodes = new HashSet<>(metadata.getReplicas()); + if (!forceReplica) { + allowedNodes.add(metadata.getLeader()); + } + + ConsumerCoordinatorInfo info = MonitoringTestUtils.extract(c); + assertThat(info.consumerCount()).isEqualTo(subscriptionCount); + Set usedNodes = + info.clients().stream() + .map(m -> m.node().split(":")) + .map(np -> new Client.Broker(np[0], parseInt(np[1]))) + .collect(toSet()); + assertThat(usedNodes).hasSameSizeAs(allowedNodes).containsAll(allowedNodes); + } + } + + private static ConsumerFlowStrategy flowStrategy() { + return ConsumerFlowStrategy.creditOnChunkArrival(10); + } +} diff --git a/src/test/java/com/rabbitmq/stream/impl/MonitoringTestUtils.java b/src/test/java/com/rabbitmq/stream/impl/MonitoringTestUtils.java index 4fc9ae051a..e645f4eb93 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MonitoringTestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/MonitoringTestUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -130,7 +130,11 @@ public ConsumerManager(long id, String node, int consumer_count) { } public int getConsumerCount() { - return consumer_count; + return this.consumer_count; + } + + public String node() { + return this.node; } @Override diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamTestInfrastructure.java b/src/test/java/com/rabbitmq/stream/impl/StreamTestInfrastructure.java new file mode 100644 index 0000000000..4c39066377 --- /dev/null +++ b/src/test/java/com/rabbitmq/stream/impl/StreamTestInfrastructure.java @@ -0,0 +1,24 @@ +// Copyright (c) 2024 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.impl; + +import java.lang.annotation.*; +import org.junit.jupiter.api.extension.ExtendWith; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +@Documented +@ExtendWith(TestUtils.StreamTestInfrastructureExtension.class) +public @interface StreamTestInfrastructure {} diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index 76c1418d36..41e4689ef9 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -386,6 +386,16 @@ static boolean tlsAvailable() { } } + static boolean isCluster() { + try { + Process process = Host.rabbitmqctl("eval 'nodes().'"); + String content = capture(process.getInputStream()); + return !content.replace("[", "").replace("]", "").trim().isEmpty(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + private static String capture(InputStream is) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(is)); String line; @@ -536,6 +546,12 @@ static boolean atLeastVersion(String expectedVersion, String currentVersion) { @ExtendWith(DisabledIfTlsNotEnabledCondition.class) public @interface DisabledIfTlsNotEnabled {} + @Target({ElementType.TYPE, ElementType.METHOD}) + @Retention(RetentionPolicy.RUNTIME) + @Documented + @ExtendWith(DisabledIfNotClusterCondition.class) + @interface DisabledIfNotCluster {} + @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Documented @@ -898,6 +914,22 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con } } + static class DisabledIfNotClusterCondition implements ExecutionCondition { + + private static final String KEY = "isCluster"; + + @Override + public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { + ExtensionContext.Store store = context.getRoot().getStore(ExtensionContext.Namespace.GLOBAL); + boolean isCluster = store.getOrComputeIfAbsent(KEY, k -> isCluster(), Boolean.class); + if (isCluster) { + return ConditionEvaluationResult.enabled("Multi-node cluster"); + } else { + return ConditionEvaluationResult.disabled("Not a multi-node cluster"); + } + } + } + private static class BaseBrokerVersionAtLeastCondition implements ExecutionCondition { private final Function versionProvider; diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index b24a27dca8..d5a75a1ef7 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -7,7 +7,7 @@ - + From 9d19298fe0cbe51fa7fd495472f777d343e014f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 26 Nov 2024 11:21:10 +0100 Subject: [PATCH 276/449] Add cluster tests --- .github/workflows/test-pr.yml | 8 ++- ci/cluster/configuration-0/enabled_plugins | 1 + ci/cluster/configuration-0/rabbitmq.conf | 8 +++ ci/cluster/configuration-1/enabled_plugins | 1 + ci/cluster/configuration-1/rabbitmq.conf | 8 +++ ci/cluster/configuration-2/enabled_plugins | 1 + ci/cluster/configuration-2/rabbitmq.conf | 8 +++ ci/cluster/docker-compose.yml | 64 ++++++++++++++++++++++ ci/cluster/load-balancer/haproxy.cfg | 31 +++++++++++ ci/start-cluster.sh | 26 +++++++++ 10 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 ci/cluster/configuration-0/enabled_plugins create mode 100644 ci/cluster/configuration-0/rabbitmq.conf create mode 100644 ci/cluster/configuration-1/enabled_plugins create mode 100644 ci/cluster/configuration-1/rabbitmq.conf create mode 100644 ci/cluster/configuration-2/enabled_plugins create mode 100644 ci/cluster/configuration-2/rabbitmq.conf create mode 100644 ci/cluster/docker-compose.yml create mode 100644 ci/cluster/load-balancer/haproxy.cfg create mode 100755 ci/start-cluster.sh diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 7543f2f175..2019fc656a 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -33,10 +33,16 @@ jobs: -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem - name: Test (dynamic-batch publishing) run: | - ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + ./mvnw test -Drabbitmqctl.bin=DOCKER:rabbitmq \ -Drabbitmq.stream.producer.dynamic.batch=true \ -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem - name: Stop broker run: docker stop rabbitmq && docker rm rabbitmq + - name: Start cluster + run: ci/start-cluster.sh + - name: Test against cluster + run: ./mvnw test -Dtest="*ClusterTest" -Drabbitmqctl.bin=DOCKER:rabbitmq0 + - name: Stop cluster + run: docker compose --file ci/cluster/docker-compose.yml down diff --git a/ci/cluster/configuration-0/enabled_plugins b/ci/cluster/configuration-0/enabled_plugins new file mode 100644 index 0000000000..244c8f60e8 --- /dev/null +++ b/ci/cluster/configuration-0/enabled_plugins @@ -0,0 +1 @@ +[rabbitmq_stream_management]. diff --git a/ci/cluster/configuration-0/rabbitmq.conf b/ci/cluster/configuration-0/rabbitmq.conf new file mode 100644 index 0000000000..9216e03142 --- /dev/null +++ b/ci/cluster/configuration-0/rabbitmq.conf @@ -0,0 +1,8 @@ +cluster_formation.peer_discovery_backend = rabbit_peer_discovery_classic_config +cluster_formation.classic_config.nodes.1 = rabbit@node0 +cluster_formation.classic_config.nodes.2 = rabbit@node1 +cluster_formation.classic_config.nodes.3 = rabbit@node2 +loopback_users = none + +stream.advertised_host = localhost +stream.advertised_port = 5552 diff --git a/ci/cluster/configuration-1/enabled_plugins b/ci/cluster/configuration-1/enabled_plugins new file mode 100644 index 0000000000..244c8f60e8 --- /dev/null +++ b/ci/cluster/configuration-1/enabled_plugins @@ -0,0 +1 @@ +[rabbitmq_stream_management]. diff --git a/ci/cluster/configuration-1/rabbitmq.conf b/ci/cluster/configuration-1/rabbitmq.conf new file mode 100644 index 0000000000..2184b5e340 --- /dev/null +++ b/ci/cluster/configuration-1/rabbitmq.conf @@ -0,0 +1,8 @@ +cluster_formation.peer_discovery_backend = rabbit_peer_discovery_classic_config +cluster_formation.classic_config.nodes.1 = rabbit@node0 +cluster_formation.classic_config.nodes.2 = rabbit@node1 +cluster_formation.classic_config.nodes.3 = rabbit@node2 +loopback_users = none + +stream.advertised_host = localhost +stream.advertised_port = 5553 diff --git a/ci/cluster/configuration-2/enabled_plugins b/ci/cluster/configuration-2/enabled_plugins new file mode 100644 index 0000000000..244c8f60e8 --- /dev/null +++ b/ci/cluster/configuration-2/enabled_plugins @@ -0,0 +1 @@ +[rabbitmq_stream_management]. diff --git a/ci/cluster/configuration-2/rabbitmq.conf b/ci/cluster/configuration-2/rabbitmq.conf new file mode 100644 index 0000000000..ff57480c50 --- /dev/null +++ b/ci/cluster/configuration-2/rabbitmq.conf @@ -0,0 +1,8 @@ +cluster_formation.peer_discovery_backend = rabbit_peer_discovery_classic_config +cluster_formation.classic_config.nodes.1 = rabbit@node0 +cluster_formation.classic_config.nodes.2 = rabbit@node1 +cluster_formation.classic_config.nodes.3 = rabbit@node2 +loopback_users = none + +stream.advertised_host = localhost +stream.advertised_port = 5554 diff --git a/ci/cluster/docker-compose.yml b/ci/cluster/docker-compose.yml new file mode 100644 index 0000000000..39345d3e8d --- /dev/null +++ b/ci/cluster/docker-compose.yml @@ -0,0 +1,64 @@ +services: + node0: + environment: + - RABBITMQ_ERLANG_COOKIE='secret_cookie' + networks: + - rabbitmq-cluster + hostname: node0 + container_name: rabbitmq0 + image: ${RABBITMQ_IMAGE:-rabbitmq:4.0} + pull_policy: always + ports: + - "5672:5672" + - "5552:5552" + - "15672:15672" + tty: true + volumes: + - ./configuration-0/:/etc/rabbitmq/ + node1: + environment: + - RABBITMQ_ERLANG_COOKIE='secret_cookie' + networks: + - rabbitmq-cluster + hostname: node1 + container_name: rabbitmq1 + image: ${RABBITMQ_IMAGE:-rabbitmq:4.0} + pull_policy: always + ports: + - "5673:5672" + - "5553:5552" + - "15673:15672" + tty: true + volumes: + - ./configuration-1/:/etc/rabbitmq/ + node2: + environment: + - RABBITMQ_ERLANG_COOKIE='secret_cookie' + networks: + - rabbitmq-cluster + hostname: node2 + container_name: rabbitmq2 + image: ${RABBITMQ_IMAGE:-rabbitmq:4.0} + pull_policy: always + ports: + - "5674:5672" + - "5554:5552" + - "15674:15672" + tty: true + volumes: + - ./configuration-2/:/etc/rabbitmq/ + load-balander: + networks: + - rabbitmq-cluster + hostname: load-balancer + container_name: haproxy + image: haproxy:3.0 + pull_policy: always + ports: + - "5555:5555" + - "8100:8100" + tty: true + volumes: + - ./load-balancer/:/usr/local/etc/haproxy:ro +networks: + rabbitmq-cluster: diff --git a/ci/cluster/load-balancer/haproxy.cfg b/ci/cluster/load-balancer/haproxy.cfg new file mode 100644 index 0000000000..e5c628bec1 --- /dev/null +++ b/ci/cluster/load-balancer/haproxy.cfg @@ -0,0 +1,31 @@ +global + log 127.0.0.1 local0 info + maxconn 512 + +defaults + log global + mode tcp + option tcplog + option dontlognull + retries 3 + option redispatch + maxconn 512 + timeout connect 5s + timeout client 120s + timeout server 120s + +listen stream + bind :5555 + mode tcp + balance roundrobin + server rabbitmq-0 node0:5552 + server rabbitmq-1 node1:5552 + server rabbitmq-2 node2:5552 + +listen stats + bind :8100 + mode http + option httplog + stats enable + stats uri /stats + stats refresh 5s diff --git a/ci/start-cluster.sh b/ci/start-cluster.sh new file mode 100755 index 0000000000..c7a5a9f321 --- /dev/null +++ b/ci/start-cluster.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +export RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:4.0} + +wait_for_message() { + while ! docker logs "$1" | grep -q "$2"; + do + sleep 2 + echo "Waiting 2 seconds for $1 to start..." + done +} + +docker compose --file ci/cluster/docker-compose.yml down +docker compose --file ci/cluster/docker-compose.yml up --detach + +wait_for_message rabbitmq0 "completed with" + +docker exec rabbitmq0 rabbitmqctl await_online_nodes 3 + +docker exec rabbitmq0 rabbitmqctl enable_feature_flag --opt-in khepri_db +docker exec rabbitmq1 rabbitmqctl enable_feature_flag --opt-in khepri_db +docker exec rabbitmq2 rabbitmqctl enable_feature_flag --opt-in khepri_db + +docker exec rabbitmq0 rabbitmqctl cluster_status + +docker compose --file ci/cluster/docker-compose.yml ps From 0e3329e39768876dfe3a2cc973ffa5dd700197d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 26 Nov 2024 11:56:57 +0100 Subject: [PATCH 277/449] Add test suite against cluster --- .github/workflows/test-rabbitmq-alphas.yml | 10 +++++++++- .github/workflows/test-supported-java-versions.yml | 8 +++++++- .github/workflows/test.yml | 8 +++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index 2a89ab39ff..08b7896e3a 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -41,10 +41,18 @@ jobs: -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem - name: Test (dynamic-batch publishing) run: | - ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + ./mvnw test -Drabbitmqctl.bin=DOCKER:rabbitmq \ -Drabbitmq.stream.producer.dynamic.batch=true \ -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem - name: Stop broker run: docker stop rabbitmq && docker rm rabbitmq + - name: Start cluster + run: ci/start-cluster.sh + env: + RABBITMQ_IMAGE: ${{ matrix.rabbitmq-image }} + - name: Test against cluster + run: ./mvnw test -Dtest="*ClusterTest" -Drabbitmqctl.bin=DOCKER:rabbitmq0 + - name: Stop cluster + run: docker compose --file ci/cluster/docker-compose.yml down diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index 8e66bcb89d..b17b6de1f9 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -43,7 +43,7 @@ jobs: -Dnet.bytebuddy.experimental=true -Djacoco.skip=true -Dspotbugs.skip=true - name: Test (dynamic-batch publishing) run: | - ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + ./mvnw test -Drabbitmqctl.bin=DOCKER:rabbitmq \ -Drabbitmq.stream.producer.dynamic.batch=true \ -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ @@ -51,3 +51,9 @@ jobs: -Dnet.bytebuddy.experimental=true -Djacoco.skip=true -Dspotbugs.skip=true - name: Stop broker run: docker stop rabbitmq && docker rm rabbitmq + - name: Start cluster + run: ci/start-cluster.sh + - name: Test against cluster + run: ./mvnw test -Dtest="*ClusterTest" -Drabbitmqctl.bin=DOCKER:rabbitmq0 + - name: Stop cluster + run: docker compose --file ci/cluster/docker-compose.yml down diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 91a432ef39..db302fb4bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -42,13 +42,19 @@ jobs: -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem - name: Test (dynamic-batch publishing) run: | - ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + ./mvnw test -Drabbitmqctl.bin=DOCKER:rabbitmq \ -Drabbitmq.stream.producer.dynamic.batch=true \ -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem - name: Stop broker run: docker stop rabbitmq && docker rm rabbitmq + - name: Start cluster + run: ci/start-cluster.sh + - name: Test against cluster + run: ./mvnw test -Dtest="*ClusterTest" -Drabbitmqctl.bin=DOCKER:rabbitmq0 + - name: Stop cluster + run: docker compose --file ci/cluster/docker-compose.yml down - name: Upload Codecov report run: bash <(curl -s https://codecov.io/bash) - name: Publish snapshot From c2c96999a26f51c4696086bbf53b22c07d90789f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 26 Nov 2024 17:39:04 +0100 Subject: [PATCH 278/449] Allow to connect to a replica for producers This can speed up producer creation/recovery when a load balancer is used. --- src/docs/asciidoc/api.adoc | 5 + .../rabbitmq/stream/EnvironmentBuilder.java | 35 ++++- .../java/com/rabbitmq/stream/impl/Client.java | 5 +- .../stream/impl/ProducersCoordinator.java | 78 +++++++--- .../stream/impl/StreamEnvironment.java | 10 +- .../stream/impl/StreamEnvironmentBuilder.java | 26 +++- .../java/com/rabbitmq/stream/impl/Utils.java | 4 - .../stream/impl/LoadBalancerClusterTest.java | 146 ++++++++++++++++-- .../stream/impl/ProducersCoordinatorTest.java | 43 +++++- .../impl/StreamEnvironmentUnitTest.java | 17 +- 10 files changed, 312 insertions(+), 57 deletions(-) diff --git a/src/docs/asciidoc/api.adoc b/src/docs/asciidoc/api.adoc index f7edd8fffd..30af7553cd 100644 --- a/src/docs/asciidoc/api.adoc +++ b/src/docs/asciidoc/api.adoc @@ -220,6 +220,11 @@ The client retries 5 times before falling back to the stream leader node. Set to `true` only for clustered environments, not for 1-node environments, where only the stream leader is available. |`false` +|`forceLeaderForProducers` +|Force connecting to a stream leader for producers. +Set to `false` if it acceptable to stay connected to a stream replica when a load balancer is in use. +|`true` + |`id` |Informational ID for the environment instance. Used as a prefix for connection names. diff --git a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java index 57fe269ea5..64010d4d51 100644 --- a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -354,7 +354,7 @@ EnvironmentBuilder topologyUpdateBackOffDelayPolicy( *

Do not set this flag to true when streams have only 1 member (the leader), * e.g. for local development. * - *

Default is false. + *

Default is false. * * @param forceReplica whether to force the connection to a replica or not * @return this builder instance @@ -364,6 +364,37 @@ EnvironmentBuilder topologyUpdateBackOffDelayPolicy( */ EnvironmentBuilder forceReplicaForConsumers(boolean forceReplica); + /** + * Flag to force the connection to the stream leader for producers. + * + *

The library prefers to connect to a node that hosts a stream leader for producers (default + * behavior). + * + *

When using a load balancer, the library does not know in advance the node it connects to. It + * may have to retry to connect to the appropriate node. + * + *

It will retry until it connects to the appropriate node (flag set to true, the + * default). This provides the best data locality, but may require several attempts, delaying the + * creation or the recovery of producers. This usually suits high-throughput use cases. + * + *

The library will accept the connection to a stream replica if the flag is set to false + * . This will speed up the creation/recovery of producers, but at the cost of network hops + * between cluster nodes when publishing messages because only a stream leader accepts writes. + * This is usually acceptable for low-throughput use cases. + * + *

Changing the default value should only benefit systems where a load balancer sits between + * the client applications and the cluster nodes. + * + *

Default is true. + * + * @param forceLeader whether to force the connection to the leader or not + * @return this builder instance + * @see #recoveryBackOffDelayPolicy(BackOffDelayPolicy) + * @see #topologyUpdateBackOffDelayPolicy(BackOffDelayPolicy) + * @since 0.21.0 + */ + EnvironmentBuilder forceLeaderForProducers(boolean forceLeader); + /** * Create the {@link Environment} instance. * diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 5a169b2044..0931e2d20b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -2245,7 +2245,10 @@ public StreamMetadata(String stream, short responseCode, Broker leader, List connectionNamingStrategy, - ClientFactory clientFactory) { + ClientFactory clientFactory, + boolean forceLeader) { this.environment = environment; this.clientFactory = clientFactory; this.maxProducersByClient = maxProducersByClient; this.maxTrackingConsumersByClient = maxTrackingConsumersByClient; this.connectionNamingStrategy = connectionNamingStrategy; + this.forceLeader = forceLeader; } Runnable registerProducer(StreamProducer producer, String reference, String stream) { @@ -105,9 +109,10 @@ Runnable registerTrackingConsumer(StreamConsumer consumer) { } private Runnable registerAgentTracker(AgentTracker tracker, String stream) { - Client.Broker broker = getBrokerForProducer(stream); + List candidates = findCandidateNodes(stream, this.forceLeader); + Broker broker = pickBroker(candidates); - addToManager(broker, tracker); + addToManager(broker, candidates, tracker); if (DEBUG) { return () -> { @@ -125,7 +130,7 @@ private Runnable registerAgentTracker(AgentTracker tracker, String stream) { } } - private void addToManager(Broker node, AgentTracker tracker) { + private void addToManager(Broker node, List candidates, AgentTracker tracker) { ClientParameters clientParameters = environment .clientParametersCopy() @@ -153,7 +158,8 @@ private void addToManager(Broker node, AgentTracker tracker) { if (pickedManager == null) { String name = keyForNode(node); LOGGER.debug("Trying to create producer manager on {}", name); - pickedManager = new ClientProducersManager(node, this.clientFactory, clientParameters); + pickedManager = + new ClientProducersManager(node, candidates, this.clientFactory, clientParameters); LOGGER.debug("Created producer manager on {}, id {}", name, pickedManager.id); } try { @@ -192,11 +198,12 @@ private void addToManager(Broker node, AgentTracker tracker) { } } - private Client.Broker getBrokerForProducer(String stream) { + // package protected for testing + List findCandidateNodes(String stream, boolean forceLeader) { Map metadata = this.environment.locatorOperation( namedFunction(c -> c.metadata(stream), "Candidate lookup to publish to '%s'", stream)); - if (metadata.size() == 0 || metadata.get(stream) == null) { + if (metadata.isEmpty() || metadata.get(stream) == null) { throw new StreamDoesNotExistException(stream); } @@ -210,17 +217,34 @@ private Client.Broker getBrokerForProducer(String stream) { } } + List candidates = new ArrayList<>(); Client.Broker leader = streamMetadata.getLeader(); - if (leader == null) { + if (leader == null && forceLeader) { throw new IllegalStateException("Not leader available for stream " + stream); } - LOGGER.debug( - "Using client on {}:{} to publish to {}", leader.getHost(), leader.getPort(), stream); + candidates.add(new BrokerWrapper(leader, true)); - return leader; + if (!forceLeader && !streamMetadata.getReplicas().isEmpty()) { + candidates.addAll( + streamMetadata.getReplicas().stream() + .map(b -> new BrokerWrapper(b, false)) + .collect(toList())); + } + + LOGGER.debug("Candidates to publish to {}: {}", stream, candidates); + + return Collections.unmodifiableList(candidates); + } + + static Broker pickBroker(List candidates) { + return candidates.stream() + .filter(BrokerWrapper::isLeader) + .findFirst() + .map(BrokerWrapper::broker) + .orElseThrow(() -> new IllegalStateException("Not leader available")); } - void close() { + public void close() { Iterator iterator = this.managers.iterator(); while (iterator.hasNext()) { ClientProducersManager manager = iterator.next(); @@ -568,7 +592,10 @@ private class ClientProducersManager implements Comparable candidates, + ClientFactory cf, + Client.ClientParameters clientParameters) { this.id = managerIdSequence.getAndIncrement(); AtomicReference nameReference = new AtomicReference<>(); AtomicReference ref = new AtomicReference<>(); @@ -682,7 +709,7 @@ private ClientProducersManager( .metadataListener(metadataListener) .clientProperty("connection_name", connectionName), keyForNode(targetNode), - Collections.emptyList()); + candidates.stream().map(BrokerWrapper::broker).collect(toList())); this.client = cf.client(connectionFactoryContext); this.node = Utils.brokerFromClient(this.client); this.name = keyForNode(this.node); @@ -694,18 +721,19 @@ private ClientProducersManager( private void assignProducersToNewManagers( Collection trackers, String stream, BackOffDelayPolicy delayPolicy) { - AsyncRetry.asyncRetry(() -> getBrokerForProducer(stream)) + AsyncRetry.asyncRetry(() -> findCandidateNodes(stream, forceLeader)) .description("Candidate lookup to publish to " + stream) .scheduler(environment.scheduledExecutorService()) .retry(ex -> !(ex instanceof StreamDoesNotExistException)) .delayPolicy(delayPolicy) .build() .thenAccept( - broker -> { + candidates -> { + Broker broker = pickBroker(candidates); String key = keyForNode(broker); LOGGER.debug( "Assigning {} producer(s) and consumer tracker(s) to {}", trackers.size(), key); - trackers.forEach(tracker -> maybeRecoverAgent(broker, tracker)); + trackers.forEach(tracker -> maybeRecoverAgent(broker, candidates, tracker)); }) .exceptionally( ex -> { @@ -730,10 +758,11 @@ private void assignProducersToNewManagers( }); } - private void maybeRecoverAgent(Broker broker, AgentTracker tracker) { + private void maybeRecoverAgent( + Broker broker, List candidates, AgentTracker tracker) { if (tracker.markRecoveryInProgress()) { try { - recoverAgent(broker, tracker); + recoverAgent(broker, candidates, tracker); } catch (Exception e) { LOGGER.warn( "Error while recovering {} tracker {} (stream '{}'). Reason: {}", @@ -750,14 +779,14 @@ private void maybeRecoverAgent(Broker broker, AgentTracker tracker) { } } - private void recoverAgent(Broker node, AgentTracker tracker) { + private void recoverAgent(Broker node, List candidates, AgentTracker tracker) { boolean reassignmentCompleted = false; while (!reassignmentCompleted) { try { if (tracker.isOpen()) { LOGGER.debug( "Using {} to resume {} to {}", node.label(), tracker.type(), tracker.stream()); - addToManager(node, tracker); + addToManager(node, candidates, tracker); tracker.running(); } else { LOGGER.debug( @@ -776,14 +805,15 @@ private void recoverAgent(Broker node, AgentTracker tracker) { tracker.identifiable() ? tracker.id() : "N/A", tracker.stream()); // maybe not a good candidate, let's refresh and retry for this one - node = + candidates = Utils.callAndMaybeRetry( - () -> getBrokerForProducer(tracker.stream()), + () -> findCandidateNodes(tracker.stream(), forceLeader), ex -> !(ex instanceof StreamDoesNotExistException), environment.recoveryBackOffDelayPolicy(), "Candidate lookup for %s on stream '%s'", tracker.type(), tracker.stream()); + node = pickBroker(candidates); } catch (Exception e) { LOGGER.warn( "Error while re-assigning {} (stream '{}')", tracker.type(), tracker.stream(), e); diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index 3b66e0d3ca..3f7642cbec 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -102,7 +102,10 @@ class StreamEnvironment implements Environment { Function connectionNamingStrategy, Function clientFactory, ObservationCollector observationCollector, - boolean forceReplicaForConsumers) { + boolean forceReplicaForConsumers, + boolean forceLeaderForProducers, + Duration producerNodeRetryDelay, + Duration consumerNodeRetryDelay) { this.recoveryBackOffDelayPolicy = recoveryBackOffDelayPolicy; this.topologyUpdateBackOffDelayPolicy = topologyBackOffDelayPolicy; this.byteBufAllocator = byteBufAllocator; @@ -212,13 +215,14 @@ class StreamEnvironment implements Environment { maxProducersByConnection, maxTrackingConsumersByConnection, connectionNamingStrategy, - Utils.coordinatorClientFactory(this)); + Utils.coordinatorClientFactory(this, producerNodeRetryDelay), + forceLeaderForProducers); this.consumersCoordinator = new ConsumersCoordinator( this, maxConsumersByConnection, connectionNamingStrategy, - Utils.coordinatorClientFactory(this), + Utils.coordinatorClientFactory(this, consumerNodeRetryDelay), forceReplicaForConsumers, Utils.brokerPicker()); this.offsetTrackingCoordinator = new OffsetTrackingCoordinator(this); diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java index 3fc919aaba..0ec0a9dca2 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -65,8 +65,11 @@ public class StreamEnvironmentBuilder implements EnvironmentBuilder { private CompressionCodecFactory compressionCodecFactory; private boolean lazyInit = false; private boolean forceReplicaForConsumers = false; + private boolean forceLeaderForProducers = true; private Function clientFactory = Client::new; private ObservationCollector observationCollector = ObservationCollector.NO_OP; + private Duration producerNodeRetryDelay = Duration.ofMillis(500); + private Duration consumerNodeRetryDelay = Duration.ofMillis(1000); public StreamEnvironmentBuilder() {} @@ -274,6 +277,12 @@ public EnvironmentBuilder forceReplicaForConsumers(boolean forceReplica) { return this; } + @Override + public EnvironmentBuilder forceLeaderForProducers(boolean forceLeader) { + this.forceLeaderForProducers = forceLeader; + return this; + } + @Override public TlsConfiguration tls() { this.tls.enable(); @@ -296,6 +305,16 @@ public EnvironmentBuilder observationCollector(ObservationCollector observati return this; } + StreamEnvironmentBuilder producerNodeRetryDelay(Duration producerNodeRetryDelay) { + this.producerNodeRetryDelay = producerNodeRetryDelay; + return this; + } + + StreamEnvironmentBuilder consumerNodeRetryDelay(Duration consumerNodeRetryDelay) { + this.consumerNodeRetryDelay = consumerNodeRetryDelay; + return this; + } + @Override public Environment build() { if (this.compressionCodecFactory == null) { @@ -327,7 +346,10 @@ public Environment build() { connectionNamingStrategy, this.clientFactory, this.observationCollector, - this.forceReplicaForConsumers); + this.forceReplicaForConsumers, + this.forceLeaderForProducers, + this.producerNodeRetryDelay, + this.consumerNodeRetryDelay); } static final class DefaultTlsConfiguration implements TlsConfiguration { diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index 558d2a347b..f63ac5792b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -135,10 +135,6 @@ static short encodeResponseCode(Short code) { return (short) (code | 0B1000_0000_0000_0000); } - static ClientFactory coordinatorClientFactory(StreamEnvironment environment) { - return coordinatorClientFactory(environment, ConditionalClientFactory.RETRY_INTERVAL); - } - static ClientFactory coordinatorClientFactory( StreamEnvironment environment, Duration retryInterval) { String messageFormat = diff --git a/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java index 727ccc58e4..9d63f42fdc 100644 --- a/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java @@ -14,26 +14,28 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; +import static com.rabbitmq.stream.impl.Assertions.assertThat; import static java.lang.Integer.parseInt; import static java.util.stream.Collectors.toSet; +import static java.util.stream.IntStream.range; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.when; -import com.rabbitmq.stream.Address; -import com.rabbitmq.stream.ConsumerFlowStrategy; -import com.rabbitmq.stream.OffsetSpecification; -import com.rabbitmq.stream.SubscriptionListener; +import com.rabbitmq.stream.*; +import com.rabbitmq.stream.impl.Client.Broker; import com.rabbitmq.stream.impl.MonitoringTestUtils.ConsumerCoordinatorInfo; +import com.rabbitmq.stream.impl.MonitoringTestUtils.EnvironmentInfo; +import com.rabbitmq.stream.impl.MonitoringTestUtils.ProducersCoordinatorInfo; import com.rabbitmq.stream.impl.TestUtils.DisabledIfNotCluster; import io.netty.channel.EventLoopGroup; import java.time.Duration; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; -import java.util.stream.IntStream; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; import org.mockito.Mock; @@ -49,11 +51,13 @@ public class LoadBalancerClusterTest { @Mock StreamEnvironment environment; @Mock StreamConsumer consumer; + @Mock StreamProducer producer; AutoCloseable mocks; TestUtils.ClientFactory cf; String stream; EventLoopGroup eventLoopGroup; Client locator; + Address loadBalancerAddress = new Address("localhost", LB_PORT); @BeforeEach void init() { @@ -62,7 +66,6 @@ void init() { when(environment.locator()).thenReturn(locator); when(environment.clientParametersCopy()) .thenReturn(new Client.ClientParameters().eventLoopGroup(eventLoopGroup).port(LB_PORT)); - Address loadBalancerAddress = new Address("localhost", LB_PORT); when(environment.addressResolver()).thenReturn(address -> loadBalancerAddress); when(environment.locatorOperation(any())).thenCallRealMethod(); } @@ -86,7 +89,7 @@ void pickConsumersAmongCandidates(boolean forceReplica) { forceReplica, Utils.brokerPicker())) { - IntStream.range(0, subscriptionCount) + range(0, subscriptionCount) .forEach( ignored -> { c.subscribe( @@ -102,22 +105,139 @@ void pickConsumersAmongCandidates(boolean forceReplica) { }); Client.StreamMetadata metadata = locator.metadata(stream).get(stream); - Set allowedNodes = new HashSet<>(metadata.getReplicas()); + Set allowedNodes = new HashSet<>(metadata.getReplicas()); if (!forceReplica) { allowedNodes.add(metadata.getLeader()); } ConsumerCoordinatorInfo info = MonitoringTestUtils.extract(c); assertThat(info.consumerCount()).isEqualTo(subscriptionCount); - Set usedNodes = + Set usedNodes = info.clients().stream() .map(m -> m.node().split(":")) - .map(np -> new Client.Broker(np[0], parseInt(np[1]))) + .map(np -> new Broker(np[0], parseInt(np[1]))) .collect(toSet()); assertThat(usedNodes).hasSameSizeAs(allowedNodes).containsAll(allowedNodes); } } + @Test + void pickProducersAmongCandidatesIfInstructed() { + boolean forceLeader = true; + when(consumer.stream()).thenReturn(stream); + int maxAgentPerClient = 2; + int agentCount = maxAgentPerClient * 10; + try (ProducersCoordinator c = + new ProducersCoordinator( + environment, + maxAgentPerClient, + maxAgentPerClient, + type -> "producer-connection", + Utils.coordinatorClientFactory(this.environment, Duration.ofMillis(10)), + forceLeader)) { + + range(0, agentCount) + .forEach( + ignored -> { + c.registerProducer(producer, null, stream); + c.registerTrackingConsumer(consumer); + }); + + Client.StreamMetadata metadata = locator.metadata(stream).get(stream); + Set allowedNodes = new HashSet<>(Collections.singleton(metadata.getLeader())); + if (!forceLeader) { + allowedNodes.addAll(metadata.getReplicas()); + } + + ProducersCoordinatorInfo info = MonitoringTestUtils.extract(c); + assertThat(info.producerCount()).isEqualTo(agentCount); + assertThat(info.trackingConsumerCount()).isEqualTo(agentCount); + Set usedNodes = + info.nodesConnected().stream() + .map(n -> n.split(":")) + .map(np -> new Broker(np[0], parseInt(np[1]))) + .collect(toSet()); + assertThat(usedNodes).hasSameSizeAs(allowedNodes).containsAll(allowedNodes); + } + } + + @ParameterizedTest + @ValueSource(booleans = {true, false}) + void producersConsumersShouldSpreadAccordingToDataLocalitySettings(boolean forceLocality) { + int maxPerConnection = 2; + int agentCount = maxPerConnection * 20; + StreamEnvironmentBuilder builder = (StreamEnvironmentBuilder) Environment.builder(); + builder + .producerNodeRetryDelay(Duration.ofMillis(10)) + .consumerNodeRetryDelay(Duration.ofMillis(10)); + try (Environment env = + builder + .port(LB_PORT) + .forceReplicaForConsumers(forceLocality) + .forceReplicaForConsumers(forceLocality) + .addressResolver(addr -> loadBalancerAddress) + .maxProducersByConnection(maxPerConnection) + .maxConsumersByConnection(maxPerConnection) + .forceLeaderForProducers(forceLocality) + .netty() + .eventLoopGroup(eventLoopGroup) + .environmentBuilder() + .build()) { + TestUtils.Sync consumeSync = TestUtils.sync(agentCount * agentCount); + Set consumersThatReceived = ConcurrentHashMap.newKeySet(agentCount); + List producers = new ArrayList<>(); + range(0, agentCount) + .forEach( + index -> { + producers.add(env.producerBuilder().stream(stream).build()); + env.consumerBuilder().stream(stream) + .messageHandler( + (ctx, msg) -> { + consumersThatReceived.add(index); + consumeSync.down(); + }) + .offset(OffsetSpecification.first()) + .build(); + }); + producers.forEach(p -> p.send(p.messageBuilder().build(), ctx -> {})); + assertThat(consumeSync).completes(); + assertThat(consumersThatReceived).containsAll(range(0, agentCount).boxed().collect(toSet())); + + EnvironmentInfo info = MonitoringTestUtils.extract(env); + ProducersCoordinatorInfo producerInfo = info.getProducers(); + ConsumerCoordinatorInfo consumerInfo = info.getConsumers(); + + assertThat(producerInfo.producerCount()).isEqualTo(agentCount); + assertThat(consumerInfo.consumerCount()).isEqualTo(agentCount); + + Client.StreamMetadata metadata = locator.metadata(stream).get(stream); + + Function, Set> toBrokers = + nodes -> + nodes.stream() + .map(n -> n.split(":")) + .map(n -> new Broker(n[0], parseInt(n[1]))) + .collect(toSet()); + Set usedNodes = toBrokers.apply(producerInfo.nodesConnected()); + assertThat(usedNodes).contains(metadata.getLeader()); + if (forceLocality) { + assertThat(usedNodes).hasSize(1); + } else { + assertThat(usedNodes).hasSize(metadata.getReplicas().size() + 1); + assertThat(usedNodes).containsAll(metadata.getReplicas()); + } + + usedNodes = toBrokers.apply(consumerInfo.nodesConnected()); + assertThat(usedNodes).containsAll(metadata.getReplicas()); + if (forceLocality) { + assertThat(usedNodes).hasSameSizeAs(metadata.getReplicas()); + } else { + assertThat(usedNodes).hasSize(metadata.getReplicas().size() + 1); + assertThat(usedNodes).contains(metadata.getLeader()); + } + } + } + private static ConsumerFlowStrategy flowStrategy() { return ConsumerFlowStrategy.creditOnChunkArrival(10); } diff --git a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java index dc89e5ec4c..176f5dbb13 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java @@ -19,6 +19,7 @@ import static com.rabbitmq.stream.impl.TestUtils.CountDownLatchConditions.completed; import static com.rabbitmq.stream.impl.TestUtils.answer; import static com.rabbitmq.stream.impl.TestUtils.metadata; +import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.ArgumentMatchers.any; @@ -79,6 +80,10 @@ static Client.Broker leader() { return new Client.Broker("leader", 5552); } + static Utils.BrokerWrapper leaderWrapper() { + return new Utils.BrokerWrapper(leader(), true); + } + static Client.Broker leader1() { return new Client.Broker("leader-1", 5552); } @@ -91,6 +96,10 @@ static List replicas() { return Arrays.asList(new Client.Broker("replica1", 5552), new Client.Broker("replica2", 5552)); } + static List replicaWrappers() { + return replicas().stream().map(b -> new Utils.BrokerWrapper(b, false)).collect(toList()); + } + @BeforeEach void init() { Client.ClientParameters clientParameters = @@ -125,7 +134,8 @@ public Client.ClientParameters metadataListener( ProducersCoordinator.MAX_PRODUCERS_PER_CLIENT, ProducersCoordinator.MAX_TRACKING_CONSUMERS_PER_CLIENT, type -> "producer-connection", - clientFactory); + clientFactory, + true); when(client.isOpen()).thenReturn(true); when(client.deletePublisher(anyByte())).thenReturn(new Response(Constants.RESPONSE_CODE_OK)); } @@ -194,7 +204,8 @@ void registerShouldAllowPublishing() { ProducersCoordinator.MAX_PRODUCERS_PER_CLIENT, ProducersCoordinator.MAX_TRACKING_CONSUMERS_PER_CLIENT, type -> "producer-connection", - cf); + cf, + true); when(locator.metadata("stream")).thenReturn(metadata(leader(), replicas())); when(clientFactory.client(any())).thenReturn(client); @@ -221,7 +232,8 @@ void shouldGetExactNodeImmediatelyWithAdvertisedHostNameClientFactoryAndExactNod ProducersCoordinator.MAX_PRODUCERS_PER_CLIENT, ProducersCoordinator.MAX_TRACKING_CONSUMERS_PER_CLIENT, type -> "producer-connection", - cf); + cf, + true); when(locator.metadata("stream")).thenReturn(metadata(leader(), replicas())); when(clientFactory.client(any())).thenReturn(client); @@ -563,7 +575,8 @@ void growShrinkResourcesBasedOnProducersAndTrackingConsumersCount(int maxProduce maxProducersByClient, ProducersCoordinator.MAX_TRACKING_CONSUMERS_PER_CLIENT, type -> "producer-connection", - clientFactory); + clientFactory, + true); class ProducerInfo { StreamProducer producer; @@ -721,6 +734,28 @@ void pickSlotTest() { assertThat(pickSlot(map, "257", sequence)).isEqualTo(5); } + @Test + void findCandidateNodesShouldReturnOnlyLeaderWhenForceLeaderIsTrue() { + when(locator.metadata("stream")).thenReturn(metadata(leader(), replicas())); + assertThat(coordinator.findCandidateNodes("stream", true)).containsOnly(leaderWrapper()); + } + + @Test + void findCandidateNodesShouldReturnLeaderAndReplicasWhenForceLeaderIsFalse() { + when(locator.metadata("stream")).thenReturn(metadata(leader(), replicas())); + assertThat(coordinator.findCandidateNodes("stream", false)) + .hasSize(3) + .contains(leaderWrapper()) + .containsAll(replicaWrappers()); + } + + @Test + void findCandidateNodesShouldThrowIfThereIsNoLeader() { + when(locator.metadata("stream")).thenReturn(metadata(null, replicas())); + assertThatThrownBy(() -> coordinator.findCandidateNodes("stream", true)) + .isInstanceOf(IllegalStateException.class); + } + private static ScheduledExecutorService createScheduledExecutorService() { return new ScheduledExecutorServiceWrapper(Executors.newSingleThreadScheduledExecutor()); } diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java index c422d454a3..5724e0f6f9 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -98,7 +98,10 @@ Client.ClientParameters duplicate() { type -> "locator-connection", cf, ObservationCollector.NO_OP, - false); + false, + true, + Duration.ofMillis(100), + Duration.ofMillis(100)); } @AfterEach @@ -163,7 +166,10 @@ void shouldTryUrisOnInitializationFailure() throws Exception { type -> "locator-connection", cf, ObservationCollector.NO_OP, - false); + false, + true, + Duration.ofMillis(100), + Duration.ofMillis(100)); verify(cf, times(3)).apply(any(Client.ClientParameters.class)); } @@ -191,7 +197,10 @@ void shouldNotOpenConnectionWhenLazyInitIsEnabled( type -> "locator-connection", cf, ObservationCollector.NO_OP, - false); + false, + true, + Duration.ofMillis(100), + Duration.ofMillis(100)); verify(cf, times(expectedConnectionCreation)).apply(any(Client.ClientParameters.class)); } From 062a0948964d5209656add5eba83d00be94d8ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 26 Nov 2024 17:55:49 +0100 Subject: [PATCH 279/449] Squash spotbugs warning --- src/main/java/com/rabbitmq/stream/impl/Client.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 0931e2d20b..b09190b3ce 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -2263,6 +2263,7 @@ public Broker getLeader() { return leader; } + @SuppressFBWarnings("EI_EXPOSE_REP2") public List getReplicas() { return replicas; } From 5afeb53864caa20c2d15b6bbc7f7390c6a59d04d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 26 Nov 2024 19:00:16 +0100 Subject: [PATCH 280/449] Return copy of replicas --- src/main/java/com/rabbitmq/stream/impl/Client.java | 7 +++++-- .../com/rabbitmq/stream/impl/ProducersCoordinator.java | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index b09190b3ce..011b784d4d 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -2263,9 +2263,12 @@ public Broker getLeader() { return leader; } - @SuppressFBWarnings("EI_EXPOSE_REP2") public List getReplicas() { - return replicas; + return this.replicas.isEmpty() ? Collections.emptyList() : new ArrayList<>(this.replicas); + } + + boolean hasReplicas() { + return !this.replicas.isEmpty(); } public String getStream() { diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java index 8656f232c1..0cd9038209 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java @@ -224,7 +224,7 @@ List findCandidateNodes(String stream, boolean forceLeader) { } candidates.add(new BrokerWrapper(leader, true)); - if (!forceLeader && !streamMetadata.getReplicas().isEmpty()) { + if (!forceLeader && streamMetadata.hasReplicas()) { candidates.addAll( streamMetadata.getReplicas().stream() .map(b -> new BrokerWrapper(b, false)) From 20f52e0b6c3fcccc504435bbd7a2db8cca328ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 27 Nov 2024 09:48:40 +0100 Subject: [PATCH 281/449] Require at least Java 11 --- .github/workflows/publish-documentation.yml | 2 +- .github/workflows/publish-snapshot.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/sanity-check.yml | 4 +- .github/workflows/test-pr.yml | 2 +- .github/workflows/test-rabbitmq-alphas.yml | 2 +- .../test-supported-java-versions.yml | 2 +- .github/workflows/test.yml | 2 +- README.adoc | 4 +- pom.xml | 38 +------------------ src/docs/asciidoc/building.adoc | 2 +- src/docs/asciidoc/index.adoc | 2 +- src/docs/asciidoc/overview.adoc | 2 +- 13 files changed, 15 insertions(+), 51 deletions(-) diff --git a/.github/workflows/publish-documentation.yml b/.github/workflows/publish-documentation.yml index be6deef8de..33baea4572 100644 --- a/.github/workflows/publish-documentation.yml +++ b/.github/workflows/publish-documentation.yml @@ -11,7 +11,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'zulu' + distribution: 'temurin' java-version: '21' cache: 'maven' - name: Publish Documentation diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index d5bb53d130..8d22f67352 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -11,7 +11,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'zulu' + distribution: 'temurin' java-version: '21' cache: 'maven' server-id: ossrh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0056e9487b..bb1c9f9029 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '8' + java-version: '11' cache: 'maven' server-id: ${{ env.maven_server_id }} server-username: MAVEN_USERNAME diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index 3e56579e7b..b8f9db90b6 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -23,8 +23,8 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'zulu' - java-version: '21' + distribution: 'temurin' + java-version: '11' cache: 'maven' - name: Start broker run: ci/start-broker.sh diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 2019fc656a..380db0602c 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -19,7 +19,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'zulu' + distribution: 'temurin' java-version: '21' cache: 'maven' - name: Start broker diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index 08b7896e3a..b707dc290a 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -25,7 +25,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'zulu' + distribution: 'temurin' java-version: '21' cache: 'maven' - name: Start broker diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index b17b6de1f9..60774e07b4 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: distribution: [ 'temurin' ] - version: [ '8', '11', '17', '21', '23', '24-ea' ] + version: [ '11', '17', '21', '23', '24-ea' ] include: - distribution: 'semeru' version: '17' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index db302fb4bd..523b05cbf9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - distribution: 'zulu' + distribution: 'temurin' java-version: '21' cache: 'maven' server-id: ossrh diff --git a/README.adoc b/README.adoc index 8f9daef7d6..3d514fd899 100644 --- a/README.adoc +++ b/README.adoc @@ -31,7 +31,7 @@ See the https://www.rabbitmq.com/client-libraries/java-versions[RabbitMQ Java li === Pre-requisites -This library requires at least Java 8, but Java 11 or more is recommended. +This library requires at least Java 11, but Java 21 or more is recommended. === Dependencies @@ -66,7 +66,7 @@ Breaking changes between releases can happen but will be kept to a minimum. == Build Instructions -You need JDK 8 or later installed. +You need JDK 11 or later installed. To build the JAR file: diff --git a/pom.xml b/pom.xml index d9e26e1ac0..a86a80da1e 100644 --- a/pom.xml +++ b/pom.xml @@ -348,8 +348,7 @@ maven-compiler-plugin ${maven.compiler.plugin.version} - 1.8 - 1.8 + 11 -Xlint:deprecation -Xlint:unchecked @@ -678,16 +677,6 @@ - - mockito-4-on-java-8 - - 1.8 - - - 4.11.0 - -Xshare:off - - jvm-test-arguments-below-java-21 @@ -707,31 +696,6 @@ - - - - use-release-compiler-argument-on-java-9-or-more - - [9,) - - - - - maven-compiler-plugin - ${maven.compiler.plugin.version} - - 1.8 - 1.8 - 8 - - -Xlint:deprecation - -Xlint:unchecked - - - - - - diff --git a/src/docs/asciidoc/building.adoc b/src/docs/asciidoc/building.adoc index c5feff4f79..cf1935a308 100644 --- a/src/docs/asciidoc/building.adoc +++ b/src/docs/asciidoc/building.adoc @@ -1,6 +1,6 @@ == Building the Client -You need JDK 1.8 or more installed. +You need JDK 11 or more installed. To build the JAR file: diff --git a/src/docs/asciidoc/index.adoc b/src/docs/asciidoc/index.adoc index a28aefcd91..d8f442e779 100644 --- a/src/docs/asciidoc/index.adoc +++ b/src/docs/asciidoc/index.adoc @@ -11,7 +11,7 @@ the https://rabbitmq.com/stream.html[RabbitMQ Stream Plugin]. It allows creating and deleting streams, as well as publishing to and consuming from these streams. Learn more in the <>. -This library requires at least Java 8, but Java 11 or more is recommended. +This library requires at least Java 11, but Java 21 or more is recommended. https://github.com/rabbitmq/rabbitmq-stream-perf-test[Stream PerfTest] is a performance testing tool based on this client library. diff --git a/src/docs/asciidoc/overview.adoc b/src/docs/asciidoc/overview.adoc index 3077bda287..4e1f736a02 100644 --- a/src/docs/asciidoc/overview.adoc +++ b/src/docs/asciidoc/overview.adoc @@ -107,4 +107,4 @@ _These SPI are susceptible to change, but this should have no impact on most app == Pre-requisites -This library requires at least Java 8, but Java 11 or more is recommended (CRC calculation uses methods available as of Java 9). +This library requires at least Java 11, but Java 21 or more is recommended. From bd0e096e360afcdd368a676c573e20a90606b543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 27 Nov 2024 10:03:44 +0100 Subject: [PATCH 282/449] Squash spotbugs warning --- .../java/com/rabbitmq/stream/impl/Client.java | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 011b784d4d..3d042eb6ea 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -506,21 +506,22 @@ void authenticate(CredentialsProvider credentialsProvider) { } else if (saslAuthenticateResponse.isChallenge()) { challenge = saslAuthenticateResponse.challenge; } else if (saslAuthenticateResponse.isAuthenticationFailure()) { - String message = - "Unexpected response code during authentication: " - + formatConstant(saslAuthenticateResponse.getResponseCode()); + StringBuilder message = + new StringBuilder( + "Unexpected response code during authentication: " + + formatConstant(saslAuthenticateResponse.getResponseCode())); if (saslAuthenticateResponse.getResponseCode() == RESPONSE_CODE_AUTHENTICATION_FAILURE_LOOPBACK) { - message += - ". The user is not authorized to connect from a remote host. " - + "If the broker is running locally, make sure the '" - + this.host - + "' hostname is resolved to " - + "the loopback interface (localhost, 127.0.0.1, ::1). " - + "See https://www.rabbitmq.com/access-control.html#loopback-users."; + message + .append(". The user is not authorized to connect from a remote host. ") + .append("If the broker is running locally, make sure the '") + .append(this.host) + .append("' hostname is resolved to ") + .append("the loopback interface (localhost, 127.0.0.1, ::1). ") + .append("See https://www.rabbitmq.com/access-control.html#loopback-users."); } throw new AuthenticationFailureException( - message, saslAuthenticateResponse.getResponseCode()); + message.toString(), saslAuthenticateResponse.getResponseCode()); } else { throw new StreamException( "Unexpected response code during authentication: " From 1b8ab7be6ef52d433c7b384fc7af45ca61128dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 27 Nov 2024 10:27:10 +0100 Subject: [PATCH 283/449] Remove Java 8 code for CRC calculation References #663 --- .../stream/impl/JdkChunkChecksum.java | 90 +------------------ .../stream/impl/JdkChunkChecksumTest.java | 8 +- 2 files changed, 7 insertions(+), 91 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java b/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java index 57160496f9..d54461a976 100644 --- a/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java +++ b/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -16,54 +16,22 @@ import com.rabbitmq.stream.ChunkChecksum; import com.rabbitmq.stream.ChunkChecksumValidationException; -import com.rabbitmq.stream.StreamException; import io.netty.buffer.ByteBuf; -import io.netty.util.ByteProcessor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.nio.ByteBuffer; import java.util.function.Supplier; import java.util.zip.CRC32; import java.util.zip.Checksum; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; class JdkChunkChecksum implements ChunkChecksum { - static final ChunkChecksum CRC32_SINGLETON; - private static final Logger LOGGER = LoggerFactory.getLogger(JdkChunkChecksum.class); private static final Supplier CRC32_SUPPLIER = CRC32::new; - - static { - if (isChecksumUpdateByteBufferAvailable()) { - LOGGER.debug("Checksum#update(ByteBuffer) method available, using it for direct buffers"); - CRC32_SINGLETON = new ByteBufferDirectByteBufChecksum(CRC32_SUPPLIER); - } else { - LOGGER.debug( - "Checksum#update(ByteBuffer) method not available, using byte-by-byte CRC calculation for direct buffers"); - CRC32_SINGLETON = new JdkChunkChecksum(CRC32_SUPPLIER); - } - } + static final ChunkChecksum CRC32_SINGLETON = new JdkChunkChecksum(CRC32_SUPPLIER); private final Supplier checksumSupplier; - JdkChunkChecksum() { - this(CRC32_SUPPLIER); - } - JdkChunkChecksum(Supplier checksumSupplier) { this.checksumSupplier = checksumSupplier; } - private static boolean isChecksumUpdateByteBufferAvailable() { - try { - Checksum.class.getDeclaredMethod("update", ByteBuffer.class); - return true; - } catch (Exception e) { - return false; - } - } - @Override public void checksum(ByteBuf byteBuf, long dataLength, long expected) { Checksum checksum = checksumSupplier.get(); @@ -71,62 +39,10 @@ public void checksum(ByteBuf byteBuf, long dataLength, long expected) { checksum.update( byteBuf.array(), byteBuf.arrayOffset() + byteBuf.readerIndex(), byteBuf.readableBytes()); } else { - byteBuf.forEachByte( - byteBuf.readerIndex(), byteBuf.readableBytes(), new UpdateProcessor(checksum)); + checksum.update(byteBuf.nioBuffer(byteBuf.readerIndex(), byteBuf.readableBytes())); } if (expected != checksum.getValue()) { throw new ChunkChecksumValidationException(expected, checksum.getValue()); } } - - private static final class ByteBufferDirectByteBufChecksum implements ChunkChecksum { - - private final Supplier checksumSupplier; - private final Method updateMethod; - - private ByteBufferDirectByteBufChecksum(Supplier checksumSupplier) { - this.checksumSupplier = checksumSupplier; - try { - this.updateMethod = Checksum.class.getDeclaredMethod("update", ByteBuffer.class); - } catch (NoSuchMethodException e) { - throw new StreamException("Error while looking up Checksum#update(ByteBuffer) method", e); - } - } - - @Override - public void checksum(ByteBuf byteBuf, long dataLength, long expected) { - Checksum checksum = checksumSupplier.get(); - if (byteBuf.hasArray()) { - checksum.update( - byteBuf.array(), - byteBuf.arrayOffset() + byteBuf.readerIndex(), - byteBuf.readableBytes()); - } else { - try { - this.updateMethod.invoke( - checksum, byteBuf.nioBuffer(byteBuf.readerIndex(), byteBuf.readableBytes())); - } catch (IllegalAccessException | InvocationTargetException e) { - throw new StreamException("Error while calculating CRC", e); - } - } - if (expected != checksum.getValue()) { - throw new ChunkChecksumValidationException(expected, checksum.getValue()); - } - } - } - - private static class UpdateProcessor implements ByteProcessor { - - private final Checksum checksum; - - private UpdateProcessor(Checksum checksum) { - this.checksum = checksum; - } - - @Override - public boolean process(byte value) { - checksum.update(value); - return true; - } - } } diff --git a/src/test/java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java b/src/test/java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java index e6016b72d1..1375589100 100644 --- a/src/test/java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -35,10 +35,10 @@ public class JdkChunkChecksumTest { static Charset UTF8 = StandardCharsets.UTF_8; static Map> CHECKSUMS = - new HashMap>() { + new HashMap<>() { { - put("crc32", () -> new CRC32()); - put("adler32", () -> new Adler32()); + put("crc32", CRC32::new); + put("adler32", Adler32::new); } }; From 4739a251c9b71da56ec21639304e2eff3a50c563 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 27 Nov 2024 10:58:15 +0100 Subject: [PATCH 284/449] Use Java 11 utilities to create immutable copies of collections --- .../com/rabbitmq/stream/ByteCapacity.java | 18 ++++++----------- .../java/com/rabbitmq/stream/impl/Client.java | 11 +++++----- .../stream/impl/ClientProperties.java | 20 +++++++------------ .../stream/impl/ConsumersCoordinator.java | 2 +- .../stream/impl/ProducersCoordinator.java | 2 +- .../stream/impl/ServerFrameHandler.java | 9 +++------ .../rabbitmq/stream/impl/StreamConsumer.java | 5 ++--- .../java/com/rabbitmq/stream/impl/Utils.java | 9 +++------ .../stream/sasl/DefaultSaslConfiguration.java | 16 ++++++--------- 9 files changed, 35 insertions(+), 57 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/ByteCapacity.java b/src/main/java/com/rabbitmq/stream/ByteCapacity.java index c9b3609204..d3460e3578 100644 --- a/src/main/java/com/rabbitmq/stream/ByteCapacity.java +++ b/src/main/java/com/rabbitmq/stream/ByteCapacity.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -14,8 +14,6 @@ // info@rabbitmq.com. package com.rabbitmq.stream; -import java.util.Collections; -import java.util.HashMap; import java.util.Map; import java.util.Objects; import java.util.function.BiFunction; @@ -40,15 +38,11 @@ public class ByteCapacity implements Comparable { private static final String UNIT_TB = "tb"; private static final Map> CONSTRUCTORS = - Collections.unmodifiableMap( - new HashMap>() { - { - put(UNIT_KB, (size, input) -> ByteCapacity.kB(size, input)); - put(UNIT_MB, (size, input) -> ByteCapacity.MB(size, input)); - put(UNIT_GB, (size, input) -> ByteCapacity.GB(size, input)); - put(UNIT_TB, (size, input) -> ByteCapacity.TB(size, input)); - } - }); + Map.of( + UNIT_KB, ByteCapacity::kB, + UNIT_MB, ByteCapacity::MB, + UNIT_GB, ByteCapacity::GB, + UNIT_TB, ByteCapacity::TB); private final long bytes; private final String input; diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 3d042eb6ea..8470d6791d 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -444,7 +444,7 @@ private static Map clientProperties(Map fromPara fromParameters = fromParameters == null ? Collections.emptyMap() : fromParameters; Map clientProperties = new HashMap<>(fromParameters); clientProperties.putAll(ClientProperties.DEFAULT_CLIENT_PROPERTIES); - return Collections.unmodifiableMap(clientProperties); + return Map.copyOf(clientProperties); } static void checkMessageFitsInFrame(int maxFrameSize, Codec.EncodedMessage encodedMessage) { @@ -2224,7 +2224,7 @@ static class StreamStatsResponse extends Response { StreamStatsResponse(short responseCode, Map info) { super(responseCode); - this.info = Collections.unmodifiableMap(new HashMap<>(info)); + this.info = Map.copyOf(info); } public Map getInfo() { @@ -2249,7 +2249,7 @@ public StreamMetadata(String stream, short responseCode, Broker leader, List getReplicas() { - return this.replicas.isEmpty() ? Collections.emptyList() : new ArrayList<>(this.replicas); + return this.replicas; } boolean hasReplicas() { @@ -2562,7 +2563,7 @@ int port() { } Map clientProperties() { - return Collections.unmodifiableMap(this.clientProperties); + return Map.copyOf(this.clientProperties); } Codec codec() { diff --git a/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java b/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java index 89af455b0d..e65f872e33 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java +++ b/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -15,8 +15,6 @@ package com.rabbitmq.stream.impl; import java.io.InputStream; -import java.util.Collections; -import java.util.HashMap; import java.util.Map; import java.util.Properties; import org.slf4j.Logger; @@ -39,16 +37,12 @@ public final class ClientProperties { public static final String VERSION = getVersion(); public static final Map DEFAULT_CLIENT_PROPERTIES = - Collections.unmodifiableMap( - new HashMap() { - { - put("product", "RabbitMQ Stream"); - put("version", ClientProperties.VERSION); - put("platform", "Java"); - put("copyright", "Copyright (c) 2020-2024 Broadcom Inc. and/or its subsidiaries."); - put("information", "Licensed under the MPL 2.0. See https://www.rabbitmq.com/"); - } - }); + Map.of( + "product", "RabbitMQ Stream", + "version", ClientProperties.VERSION, + "platform", "Java", + "copyright", "Copyright (c) 2020-2024 Broadcom Inc. and/or its subsidiaries.", + "information", "Licensed under the MPL 2.0. See https://www.rabbitmq.com/"); private static String getVersion() { String version; diff --git a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java index d60f4ff943..4347cadbd1 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java @@ -443,7 +443,7 @@ private SubscriptionTracker( properties.putAll(subscriptionProperties); // we propagate the subscription name, used for monitoring properties.put("name", this.offsetTrackingReference); - this.subscriptionProperties = Collections.unmodifiableMap(properties); + this.subscriptionProperties = Map.copyOf(properties); } } diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java index 0cd9038209..bf9dc9d60e 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java @@ -233,7 +233,7 @@ List findCandidateNodes(String stream, boolean forceLeader) { LOGGER.debug("Candidates to publish to {}: {}", stream, candidates); - return Collections.unmodifiableList(candidates); + return List.copyOf(candidates); } static Broker pickBroker(List candidates) { diff --git a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java index c646803eae..4df596ed83 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java +++ b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -771,14 +771,11 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { } OutstandingRequest> outstandingRequest = - remove( - client.outstandingRequests, - correlationId, - new ParameterizedTypeReference>() {}); + remove(client.outstandingRequests, correlationId, new ParameterizedTypeReference<>() {}); if (outstandingRequest == null) { LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); } else { - outstandingRequest.response().set(Collections.unmodifiableMap(serverProperties)); + outstandingRequest.response().set(Map.copyOf(serverProperties)); outstandingRequest.countDown(); } return read; diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java index b62dad93d6..532ed33189 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -26,7 +26,6 @@ import com.rabbitmq.stream.impl.StreamEnvironment.TrackingConsumerRegistration; import com.rabbitmq.stream.impl.Utils.CompositeConsumerUpdateListener; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import java.util.Collections; import java.util.Map; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -255,7 +254,7 @@ class StreamConsumer implements Consumer { subscriptionListener, trackingClosingCallback, closedAwareMessageHandler, - Collections.unmodifiableMap(subscriptionProperties), + Map.copyOf(subscriptionProperties), flowStrategy); this.status = Status.RUNNING; diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index f63ac5792b..ab03ae71e3 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -15,7 +15,7 @@ package com.rabbitmq.stream.impl; import static java.lang.String.format; -import static java.util.Collections.unmodifiableList; +import static java.util.Map.copyOf; import com.rabbitmq.stream.*; import com.rabbitmq.stream.impl.Client.ClientParameters; @@ -71,7 +71,7 @@ final class Utils { LOGGER.info("Error while trying to access field Constants." + field.getName()); } }); - CONSTANT_LABELS = Collections.unmodifiableMap(labels); + CONSTANT_LABELS = copyOf(labels); } static final AddressResolver DEFAULT_ADDRESS_RESOLVER = address -> address; @@ -358,10 +358,7 @@ static class ClientFactoryContext { ClientParameters parameters, String targetKey, List candidates) { this.parameters = parameters; this.targetKey = targetKey; - this.candidates = - candidates == null - ? Collections.emptyList() - : unmodifiableList(new ArrayList<>(candidates)); + this.candidates = candidates == null ? Collections.emptyList() : List.copyOf(candidates); } ClientParameters parameters() { diff --git a/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java b/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java index 81b8793a31..5e3a7f8b86 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java +++ b/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -17,7 +17,6 @@ import static java.lang.String.format; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -32,14 +31,11 @@ public final class DefaultSaslConfiguration implements SaslConfiguration { new DefaultSaslConfiguration(AnonymousSaslMechanism.INSTANCE.getName()); private final Map mechanisms = - Collections.unmodifiableMap( - new HashMap() { - { - put(PlainSaslMechanism.INSTANCE.getName(), PlainSaslMechanism.INSTANCE); - put(ExternalSaslMechanism.INSTANCE.getName(), ExternalSaslMechanism.INSTANCE); - put(AnonymousSaslMechanism.INSTANCE.getName(), AnonymousSaslMechanism.INSTANCE); - } - }); + Map.of( + PlainSaslMechanism.INSTANCE.getName(), PlainSaslMechanism.INSTANCE, + ExternalSaslMechanism.INSTANCE.getName(), ExternalSaslMechanism.INSTANCE, + AnonymousSaslMechanism.INSTANCE.getName(), AnonymousSaslMechanism.INSTANCE); + private final String mechanism; public DefaultSaslConfiguration() { From dd256140106fbb2c1ae5e9cecdf1c263a7dbab50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 27 Nov 2024 12:04:45 +0100 Subject: [PATCH 285/449] Fix test (wrong ordering of map entries) --- .../java/com/rabbitmq/stream/impl/Client.java | 4 ++-- .../stream/impl/ClientProperties.java | 19 +++++++++++-------- .../stream/impl/ConsumersCoordinator.java | 2 +- .../stream/impl/ServerFrameHandler.java | 2 +- .../stream/sasl/DefaultSaslConfiguration.java | 18 +++++++++++------- .../sasl/DefaultSaslConfigurationTest.java | 4 ++-- 6 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 8470d6791d..00a5931bb3 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -442,9 +442,9 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) private static Map clientProperties(Map fromParameters) { fromParameters = fromParameters == null ? Collections.emptyMap() : fromParameters; - Map clientProperties = new HashMap<>(fromParameters); + Map clientProperties = new LinkedHashMap<>(fromParameters); clientProperties.putAll(ClientProperties.DEFAULT_CLIENT_PROPERTIES); - return Map.copyOf(clientProperties); + return Collections.unmodifiableMap(clientProperties); } static void checkMessageFitsInFrame(int maxFrameSize, Codec.EncodedMessage encodedMessage) { diff --git a/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java b/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java index e65f872e33..c557074df4 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java +++ b/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java @@ -15,8 +15,7 @@ package com.rabbitmq.stream.impl; import java.io.InputStream; -import java.util.Map; -import java.util.Properties; +import java.util.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,12 +36,16 @@ public final class ClientProperties { public static final String VERSION = getVersion(); public static final Map DEFAULT_CLIENT_PROPERTIES = - Map.of( - "product", "RabbitMQ Stream", - "version", ClientProperties.VERSION, - "platform", "Java", - "copyright", "Copyright (c) 2020-2024 Broadcom Inc. and/or its subsidiaries.", - "information", "Licensed under the MPL 2.0. See https://www.rabbitmq.com/"); + Collections.unmodifiableMap( + new LinkedHashMap<>() { + { + put("product", "RabbitMQ Stream"); + put("version", ClientProperties.VERSION); + put("platform", "Java"); + put("copyright", "Copyright (c) 2020-2024 Broadcom Inc. and/or its subsidiaries."); + put("information", "Licensed under the MPL 2.0. See https://www.rabbitmq.com/"); + } + }); private static String getVersion() { String version; diff --git a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java index 4347cadbd1..d60f4ff943 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java @@ -443,7 +443,7 @@ private SubscriptionTracker( properties.putAll(subscriptionProperties); // we propagate the subscription name, used for monitoring properties.put("name", this.offsetTrackingReference); - this.subscriptionProperties = Map.copyOf(properties); + this.subscriptionProperties = Collections.unmodifiableMap(properties); } } diff --git a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java index 4df596ed83..306b1c1dfd 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java +++ b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java @@ -775,7 +775,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { if (outstandingRequest == null) { LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); } else { - outstandingRequest.response().set(Map.copyOf(serverProperties)); + outstandingRequest.response().set(Collections.unmodifiableMap(serverProperties)); outstandingRequest.countDown(); } return read; diff --git a/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java b/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java index 5e3a7f8b86..bae204be18 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java +++ b/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java @@ -16,9 +16,9 @@ import static java.lang.String.format; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; /** {@link SaslConfiguration} that supports our built-in mechanisms. */ public final class DefaultSaslConfiguration implements SaslConfiguration { @@ -31,10 +31,14 @@ public final class DefaultSaslConfiguration implements SaslConfiguration { new DefaultSaslConfiguration(AnonymousSaslMechanism.INSTANCE.getName()); private final Map mechanisms = - Map.of( - PlainSaslMechanism.INSTANCE.getName(), PlainSaslMechanism.INSTANCE, - ExternalSaslMechanism.INSTANCE.getName(), ExternalSaslMechanism.INSTANCE, - AnonymousSaslMechanism.INSTANCE.getName(), AnonymousSaslMechanism.INSTANCE); + Collections.unmodifiableMap( + Stream.of( + PlainSaslMechanism.INSTANCE, + ExternalSaslMechanism.INSTANCE, + AnonymousSaslMechanism.INSTANCE) + .collect( + Collectors.toMap( + SaslMechanism::getName, m -> m, (k1, k2) -> k1, LinkedHashMap::new))); private final String mechanism; diff --git a/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java b/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java index 8a93928420..243d4be3d0 100644 --- a/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java +++ b/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -58,6 +58,6 @@ void getSaslMechanismShouldThrowExceptionIfNoMechanismSpecifiedAndNoMatch() { assertThatThrownBy(() -> configuration.getSaslMechanism(asList("FOO", "BAR"))) .isInstanceOf(IllegalStateException.class) .hasMessage( - "Unable to agree on a SASL mechanism. Client: PLAIN, ANONYMOUS, EXTERNAL / server FOO, BAR."); + "Unable to agree on a SASL mechanism. Client: PLAIN, EXTERNAL, ANONYMOUS / server FOO, BAR."); } } From a11a5db921bfe508610f8adf25849a90c143f51a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:44:11 +0000 Subject: [PATCH 286/449] Bump io.dropwizard.metrics:metrics-core from 4.2.28 to 4.2.29 Bumps [io.dropwizard.metrics:metrics-core](https://github.com/dropwizard/metrics) from 4.2.28 to 4.2.29. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.28...v4.2.29) --- updated-dependencies: - dependency-name: io.dropwizard.metrics:metrics-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a86a80da1e..c59e4fffca 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 1.2.13 4.1.115.Final 0.34.1 - 4.2.28 + 4.2.29 1.14.1 12.2.2 4.7.5 From 93e9ee15ea81b05de8388970d7c737bb04d99e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 27 Nov 2024 20:25:44 +0100 Subject: [PATCH 287/449] Add recovery cluster test --- .../rabbitmq/stream/{Host.java => Cli.java} | 289 +++++++++++------- .../stream/{HostTest.java => CliTest.java} | 8 +- .../com/rabbitmq/stream/impl/AlarmsTest.java | 6 +- .../stream/impl/AuthenticationTest.java | 4 +- .../stream/impl/AuthorisationTest.java | 4 +- .../rabbitmq/stream/impl/MetadataTest.java | 17 +- .../stream/impl/RecoveryClusterTest.java | 218 +++++++++++++ .../stream/impl/RetentionClientTest.java | 8 +- .../rabbitmq/stream/impl/SacClientTest.java | 14 +- .../stream/impl/SacStreamConsumerTest.java | 6 +- .../impl/SacSuperStreamConsumerTest.java | 6 +- .../stream/impl/ShutdownListenerTest.java | 6 +- .../stream/impl/StreamConsumerTest.java | 21 +- .../stream/impl/StreamEnvironmentTest.java | 16 +- .../stream/impl/StreamProducerTest.java | 2 +- .../impl/SuperStreamManagementTest.java | 4 +- .../com/rabbitmq/stream/impl/TestUtils.java | 31 +- .../com/rabbitmq/stream/impl/TlsTest.java | 19 +- src/test/resources/logback-test.xml | 1 + 19 files changed, 474 insertions(+), 206 deletions(-) rename src/test/java/com/rabbitmq/stream/{Host.java => Cli.java} (53%) rename src/test/java/com/rabbitmq/stream/{HostTest.java => CliTest.java} (93%) create mode 100644 src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java diff --git a/src/test/java/com/rabbitmq/stream/Host.java b/src/test/java/com/rabbitmq/stream/Cli.java similarity index 53% rename from src/test/java/com/rabbitmq/stream/Host.java rename to src/test/java/com/rabbitmq/stream/Cli.java index 48c8c0d972..51d3bfdcee 100644 --- a/src/test/java/com/rabbitmq/stream/Host.java +++ b/src/test/java/com/rabbitmq/stream/Cli.java @@ -29,62 +29,58 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class Host { +public class Cli { - private static final Logger LOGGER = LoggerFactory.getLogger(Host.class); + private static final Logger LOGGER = LoggerFactory.getLogger(Cli.class); private static final String DOCKER_PREFIX = "DOCKER:"; private static final Gson GSON = new Gson(); - public static String capture(InputStream is) throws IOException { - BufferedReader br = new BufferedReader(new InputStreamReader(is)); - String line; - StringBuilder buff = new StringBuilder(); - while ((line = br.readLine()) != null) { - buff.append(line).append("\n"); - } - return buff.toString(); - } + private static final Map DOCKER_NODES_TO_CONTAINERS = + Map.of( + "rabbit@node0", "rabbitmq0", + "rabbit@node1", "rabbitmq1", + "rabbit@node2", "rabbitmq2"); - private static Process executeCommand(String command) { + private static ProcessState executeCommand(String command) { return executeCommand(command, false); } - private static Process executeCommand(String command, boolean ignoreError) { - try { - Process pr = executeCommandProcess(command); - - int ev = waitForExitValue(pr); - if (ev != 0 && !ignoreError) { - String stdout = capture(pr.getInputStream()); - String stderr = capture(pr.getErrorStream()); - throw new IOException( - "unexpected command exit value: " - + ev - + "\ncommand: " - + command - + "\n" - + "\nstdout:\n" - + stdout - + "\nstderr:\n" - + stderr - + "\n"); - } - return pr; - } catch (IOException e) { - throw new RuntimeException(e); + private static ProcessState executeCommand(String command, boolean ignoreError) { + Process pr = executeCommandProcess(command); + InputStreamPumpState inputState = new InputStreamPumpState(pr.getInputStream()); + InputStreamPumpState errorState = new InputStreamPumpState(pr.getErrorStream()); + + int ev = waitForExitValue(pr, inputState, errorState); + inputState.pump(); + errorState.pump(); + if (ev != 0 && !ignoreError) { + throw new RuntimeException( + "unexpected command exit value: " + + ev + + "\ncommand: " + + command + + "\n" + + "\nstdout:\n" + + inputState.buffer.toString() + + "\nstderr:\n" + + errorState.buffer.toString() + + "\n"); } + return new ProcessState(inputState); } - public static String hostname() throws IOException { - Process process = executeCommand("hostname"); - return capture(process.getInputStream()).trim(); + public static String hostname() { + return executeCommand("hostname").output(); } - private static int waitForExitValue(Process pr) { + private static int waitForExitValue( + Process pr, InputStreamPumpState inputState, InputStreamPumpState errorState) { while (true) { try { + inputState.pump(); + errorState.pump(); pr.waitFor(); break; } catch (InterruptedException ignored) { @@ -93,7 +89,7 @@ private static int waitForExitValue(Process pr) { return pr.exitValue(); } - private static Process executeCommandProcess(String command) throws IOException { + private static Process executeCommandProcess(String command) { String[] finalCommand; if (System.getProperty("os.name").toLowerCase().contains("windows")) { finalCommand = new String[4]; @@ -107,70 +103,59 @@ private static Process executeCommandProcess(String command) throws IOException finalCommand[1] = "-c"; finalCommand[2] = command; } - return Runtime.getRuntime().exec(finalCommand); + try { + return Runtime.getRuntime().exec(finalCommand); + } catch (IOException e) { + throw new RuntimeException(e); + } } - public static Process rabbitmqctl(String command) throws IOException { + public static ProcessState rabbitmqctl(String command) { return executeCommand(rabbitmqctlCommand() + " " + command); } - static Process rabbitmqStreams(String command) { + static ProcessState rabbitmqStreams(String command) { return executeCommand(rabbitmqStreamsCommand() + " " + command); } - public static Process rabbitmqctlIgnoreError(String command) { + public static ProcessState rabbitmqctlIgnoreError(String command) { return executeCommand(rabbitmqctlCommand() + " " + command, true); } - public static Process killConnection(String connectionName) { - try { - List cs = listConnections(); - if (cs.stream().filter(c -> connectionName.equals(c.clientProvidedName())).count() != 1) { - throw new IllegalArgumentException( - format( - "Could not find 1 connection '%s' in stream connections: %s", - connectionName, - cs.stream() - .map(ConnectionInfo::clientProvidedName) - .collect(Collectors.joining(", ")))); - } - return rabbitmqctl("eval 'rabbit_stream:kill_connection(\"" + connectionName + "\").'"); - } catch (IOException e) { - throw new RuntimeException(e); + public static ProcessState killConnection(String connectionName) { + List cs = listConnections(); + if (cs.stream().filter(c -> connectionName.equals(c.clientProvidedName())).count() != 1) { + throw new IllegalArgumentException( + format( + "Could not find 1 connection '%s' in stream connections: %s", + connectionName, + cs.stream() + .map(ConnectionInfo::clientProvidedName) + .collect(Collectors.joining(", ")))); } + return rabbitmqctl("eval 'rabbit_stream:kill_connection(\"" + connectionName + "\").'"); } public static List listConnections() { - try { - Process process = - rabbitmqctl("list_stream_connections -q --formatter table conn_name,client_properties"); - List connectionInfoList = Collections.emptyList(); - if (process.exitValue() != 0) { - LOGGER.warn( - "Error while trying to list stream connections. Standard output: {}, error output: {}", - capture(process.getInputStream()), - capture(process.getErrorStream())); - return connectionInfoList; - } - String content = capture(process.getInputStream()); - String[] lines = content.split(System.getProperty("line.separator")); - if (lines.length > 1) { - connectionInfoList = new ArrayList<>(lines.length - 1); - for (int i = 1; i < lines.length; i++) { - String line = lines[i]; - String[] fields = line.split("\t"); - String connectionName = fields[0]; - Map clientProperties = Collections.emptyMap(); - if (fields.length > 1 && fields[1].length() > 1) { - clientProperties = buildClientProperties(fields); - } - connectionInfoList.add(new ConnectionInfo(connectionName, clientProperties)); + ProcessState process = + rabbitmqctl("list_stream_connections -q --formatter table conn_name,client_properties"); + List connectionInfoList = Collections.emptyList(); + String content = process.output(); + String[] lines = content.split(System.lineSeparator()); + if (lines.length > 1) { + connectionInfoList = new ArrayList<>(lines.length - 1); + for (int i = 1; i < lines.length; i++) { + String line = lines[i]; + String[] fields = line.split("\t"); + String connectionName = fields[0]; + Map clientProperties = Collections.emptyMap(); + if (fields.length > 1 && fields[1].length() > 1) { + clientProperties = buildClientProperties(fields); } + connectionInfoList.add(new ConnectionInfo(connectionName, clientProperties)); } - return connectionInfoList; - } catch (IOException e) { - throw new RuntimeException(e); } + return connectionInfoList; } private static Map buildClientProperties(String[] fields) { @@ -201,32 +186,26 @@ public static void restartStream(String stream) { rabbitmqStreams(" restart_stream " + stream); } - public static Process killStreamLeaderProcess(String stream) { - try { - return rabbitmqctl( - "eval 'case rabbit_stream_manager:lookup_leader(<<\"/\">>, <<\"" - + stream - + "\">>) of {ok, Pid} -> exit(Pid, kill); Pid -> exit(Pid, kill) end.'"); - } catch (IOException e) { - throw new RuntimeException(e); - } + public static void killStreamLeaderProcess(String stream) { + rabbitmqctl( + "eval 'case rabbit_stream_manager:lookup_leader(<<\"/\">>, <<\"" + + stream + + "\">>) of {ok, Pid} -> exit(Pid, kill); Pid -> exit(Pid, kill) end.'"); } - public static void addUser(String username, String password) throws IOException { + public static void addUser(String username, String password) { rabbitmqctl(format("add_user %s %s", username, password)); } - public static void setPermissions(String username, List permissions) throws IOException { + public static void setPermissions(String username, List permissions) { setPermissions(username, "/", permissions); } - public static void setPermissions(String username, String vhost, String permission) - throws IOException { + public static void setPermissions(String username, String vhost, String permission) { setPermissions(username, vhost, asList(permission, permission, permission)); } - public static void setPermissions(String username, String vhost, List permissions) - throws IOException { + public static void setPermissions(String username, String vhost, List permissions) { if (permissions.size() != 3) { throw new IllegalArgumentException(); } @@ -236,23 +215,23 @@ public static void setPermissions(String username, String vhost, List pe vhost, username, permissions.get(0), permissions.get(1), permissions.get(2))); } - public static void changePassword(String username, String newPassword) throws IOException { + public static void changePassword(String username, String newPassword) { rabbitmqctl(format("change_password %s %s", username, newPassword)); } - public static void deleteUser(String username) throws IOException { + public static void deleteUser(String username) { rabbitmqctl(format("delete_user %s", username)); } - public static void addVhost(String vhost) throws IOException { + public static void addVhost(String vhost) { rabbitmqctl("add_vhost " + vhost); } - public static void deleteVhost(String vhost) throws Exception { + public static void deleteVhost(String vhost) { rabbitmqctl("delete_vhost " + vhost); } - public static void setEnv(String parameter, String value) throws IOException { + public static void setEnv(String parameter, String value) { rabbitmqctl(format("eval 'application:set_env(rabbitmq_stream, %s, %s).'", parameter, value)); } @@ -334,6 +313,68 @@ public static boolean isOnDocker() { return rabbitmqCtl.startsWith(DOCKER_PREFIX); } + public static List nodes() { + List clusterNodes = new ArrayList<>(); + clusterNodes.add(rabbitmqctl("eval 'node().'").output().trim()); + List nodes = + Arrays.stream( + rabbitmqctl("eval 'nodes().'") + .output() + .replace("[", "") + .replace("]", "") + .split(",")) + .map(String::trim) + .collect(Collectors.toList()); + clusterNodes.addAll(nodes); + return List.copyOf(clusterNodes); + } + + public static void restartNode(String node) { + String container = nodeToDockerContainer(node); + String dockerCommand = "docker exec " + container + " "; + String rabbitmqUpgradeCommand = dockerCommand + "rabbitmq-upgrade "; + executeCommand(rabbitmqUpgradeCommand + "await_online_quorum_plus_one -t 300"); + executeCommand(rabbitmqUpgradeCommand + "drain"); + executeCommand("docker stop " + container); + executeCommand("docker start " + container); + String otherContainer = + DOCKER_NODES_TO_CONTAINERS.values().stream() + .filter(c -> !c.endsWith(container)) + .findAny() + .get(); + executeCommand( + "docker exec " + + otherContainer + + " rabbitmqctl await_online_nodes " + + DOCKER_NODES_TO_CONTAINERS.size()); + executeCommand(dockerCommand + "rabbitmqctl status"); + } + + public static void rebalance() { + rabbitmqQueues("rebalance all"); + } + + static ProcessState rabbitmqQueues(String command) { + return executeCommand(rabbitmqQueuesCommand() + " " + command); + } + + private static String rabbitmqQueuesCommand() { + String rabbitmqctl = rabbitmqctlCommand(); + int lastIndex = rabbitmqctl.lastIndexOf("rabbitmqctl"); + if (lastIndex == -1) { + throw new IllegalArgumentException("Not a valid rabbitqmctl command: " + rabbitmqctl); + } + return rabbitmqctl.substring(0, lastIndex) + "rabbitmq-queues"; + } + + private static String nodeToDockerContainer(String node) { + String containerId = DOCKER_NODES_TO_CONTAINERS.get(node); + if (containerId == null) { + throw new IllegalArgumentException("No container for node " + node); + } + return containerId; + } + private static final class CallableAutoCloseable implements AutoCloseable { private final Callable end; @@ -378,4 +419,40 @@ public String toString() { + '}'; } } + + public static class ProcessState { + + private final InputStreamPumpState inputState; + + ProcessState(InputStreamPumpState inputState) { + this.inputState = inputState; + } + + public String output() { + return inputState.buffer.toString(); + } + } + + private static class InputStreamPumpState { + + private final BufferedReader reader; + private final StringBuilder buffer; + + private InputStreamPumpState(InputStream in) { + this.reader = new BufferedReader(new InputStreamReader(in)); + this.buffer = new StringBuilder(); + } + + void pump() { + String line; + while (true) { + try { + if ((line = reader.readLine()) == null) break; + } catch (IOException e) { + throw new RuntimeException(e); + } + buffer.append(line).append("\n"); + } + } + } } diff --git a/src/test/java/com/rabbitmq/stream/HostTest.java b/src/test/java/com/rabbitmq/stream/CliTest.java similarity index 93% rename from src/test/java/com/rabbitmq/stream/HostTest.java rename to src/test/java/com/rabbitmq/stream/CliTest.java index bfe3e81157..0d5b0effb5 100644 --- a/src/test/java/com/rabbitmq/stream/HostTest.java +++ b/src/test/java/com/rabbitmq/stream/CliTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -16,18 +16,18 @@ import static org.assertj.core.api.Assertions.assertThat; -import com.rabbitmq.stream.Host.ConnectionInfo; +import com.rabbitmq.stream.Cli.ConnectionInfo; import java.util.List; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; -public class HostTest { +public class CliTest { @Test @Disabled void deserializeConnectionInfo() { List connections = - Host.toConnectionInfoList(LIST_STREAM_CONNECTIONS_JSON_OUTPUT); + Cli.toConnectionInfoList(LIST_STREAM_CONNECTIONS_JSON_OUTPUT); assertThat(connections).hasSize(3); ConnectionInfo c = connections.get(0); assertThat(c.name()).isEqualTo("127.0.0.1:49214 -> 127.0.1.1:5552"); diff --git a/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java b/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java index 27121f00b2..503d9880a0 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -14,8 +14,8 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; -import static com.rabbitmq.stream.Host.diskAlarm; -import static com.rabbitmq.stream.Host.memoryAlarm; +import static com.rabbitmq.stream.Cli.diskAlarm; +import static com.rabbitmq.stream.Cli.memoryAlarm; import static com.rabbitmq.stream.impl.TestUtils.ExceptionConditions.responseCode; import static com.rabbitmq.stream.impl.TestUtils.latchAssert; import static java.util.concurrent.TimeUnit.SECONDS; diff --git a/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java b/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java index a5950b2919..7fbf4af4c8 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -14,7 +14,7 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; -import static com.rabbitmq.stream.Host.*; +import static com.rabbitmq.stream.Cli.*; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; diff --git a/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java b/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java index f1d679b751..e6fc7bd701 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -14,8 +14,8 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; +import static com.rabbitmq.stream.Cli.*; import static com.rabbitmq.stream.Constants.*; -import static com.rabbitmq.stream.Host.*; import static com.rabbitmq.stream.OffsetSpecification.first; import static com.rabbitmq.stream.impl.TestUtils.*; import static com.rabbitmq.stream.impl.TestUtils.ResponseConditions.ok; diff --git a/src/test/java/com/rabbitmq/stream/impl/MetadataTest.java b/src/test/java/com/rabbitmq/stream/impl/MetadataTest.java index cd7f6266c3..16241f2c25 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MetadataTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/MetadataTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -19,12 +19,11 @@ import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; +import com.rabbitmq.stream.Cli; import com.rabbitmq.stream.Constants; -import com.rabbitmq.stream.Host; import com.rabbitmq.stream.impl.Client.Broker; import com.rabbitmq.stream.impl.TestUtils.BrokerVersion; import com.rabbitmq.stream.impl.TestUtils.BrokerVersionAtLeast; -import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.*; @@ -143,7 +142,7 @@ void metadataExistingNonExistingStreams(int existingCount, int nonExistingCount, } static void checkHost(Broker broker) { - if (!Host.isOnDocker()) { + if (!Cli.isOnDocker()) { assertThat(broker.getHost()).isEqualTo(hostname()); } } @@ -152,11 +151,7 @@ static String hostname() { try { return InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { - try { - return Host.hostname(); - } catch (IOException ex) { - throw new RuntimeException(ex); - } + return Cli.hostname(); } } @@ -166,9 +161,9 @@ void shouldFilterOutNodesInMaintenance() throws Exception { Client client = cf.get(); BooleanSupplier hasLeader = () -> client.metadata(stream).get(stream).getLeader() != null; waitAtMost(() -> hasLeader.getAsBoolean()); - Host.rabbitmqctl("eval 'rabbit_maintenance:drain().'"); + Cli.rabbitmqctl("eval 'rabbit_maintenance:drain().'"); waitAtMost(() -> !hasLeader.getAsBoolean()); - Host.rabbitmqctl("eval 'rabbit_maintenance:revive().'"); + Cli.rabbitmqctl("eval 'rabbit_maintenance:revive().'"); waitAtMost(() -> hasLeader.getAsBoolean()); } } diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java new file mode 100644 index 0000000000..f6863f5d4d --- /dev/null +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -0,0 +1,218 @@ +// Copyright (c) 2024 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.impl; + +import static com.rabbitmq.stream.impl.Assertions.assertThat; +import static com.rabbitmq.stream.impl.TestUtils.sync; +import static java.time.Duration.ofSeconds; +import static java.util.stream.Collectors.toList; + +import com.google.common.util.concurrent.RateLimiter; +import com.rabbitmq.stream.*; +import com.rabbitmq.stream.impl.TestUtils.Sync; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.IntStream; +import org.junit.jupiter.api.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@TestUtils.DisabledIfNotCluster +@StreamTestInfrastructure +public class RecoveryClusterTest { + + private static final Logger LOGGER = LoggerFactory.getLogger(RecoveryClusterTest.class); + + static List nodes; + static final List URIS = + IntStream.range(5552, 5555) + .mapToObj(p -> "rabbitmq-stream://localhost:" + p) + .collect(toList()); + static final BackOffDelayPolicy BACK_OFF_DELAY_POLICY = BackOffDelayPolicy.fixed(ofSeconds(3)); + Environment environment; + TestInfo testInfo; + + @BeforeAll + static void initAll() { + nodes = Cli.nodes(); + } + + @BeforeEach + void init(TestInfo info) { + environment = + Environment.builder() + .uris(URIS) + .recoveryBackOffDelayPolicy(BACK_OFF_DELAY_POLICY) + .topologyUpdateBackOffDelayPolicy(BACK_OFF_DELAY_POLICY) + .build(); + this.testInfo = info; + } + + @AfterEach + void tearDown() { + environment.close(); + } + + @Test + void clusterRestart() { + int streamCount = 10; + List streams = + IntStream.range(0, streamCount) + .mapToObj(i -> TestUtils.streamName(testInfo) + "-" + i) + .collect(toList()); + streams.forEach(s -> environment.streamCreator().stream(s).create()); + try { + List producers = + streams.stream().map(s -> new ProducerState(s, environment)).collect(toList()); + List consumers = + streams.stream().map(s -> new ConsumerState(s, environment)).collect(toList()); + + producers.forEach(ProducerState::start); + + List syncs = producers.stream().map(p -> p.waitForNewMessages(100)).collect(toList()); + syncs.forEach(s -> assertThat(s).completes()); + + syncs = consumers.stream().map(c -> c.waitForNewMessages(100)).collect(toList()); + syncs.forEach(s -> assertThat(s).completes()); + + nodes.forEach( + n -> { + LOGGER.info("Restarting node {}...", n); + Cli.restartNode(n); + LOGGER.info("Restarted node {}.", n); + }); + LOGGER.info("Rebalancing..."); + Cli.rebalance(); + LOGGER.info("Rebalancing over."); + + syncs = producers.stream().map(p -> p.waitForNewMessages(100)).collect(toList()); + syncs.forEach(s -> assertThat(s).completes()); + + syncs = consumers.stream().map(c -> c.waitForNewMessages(100)).collect(toList()); + syncs.forEach(s -> assertThat(s).completes()); + + producers.forEach(ProducerState::close); + consumers.forEach(ConsumerState::close); + } finally { + streams.forEach(s -> environment.deleteStream(s)); + } + } + + private static class ProducerState implements AutoCloseable { + + private static final byte[] BODY = "hello".getBytes(StandardCharsets.UTF_8); + + private final String stream; + private final Producer producer; + final RateLimiter limiter = RateLimiter.create(1000); + Thread task; + final AtomicBoolean stopped = new AtomicBoolean(false); + final AtomicInteger acceptedCount = new AtomicInteger(); + final AtomicReference postConfirmed = new AtomicReference<>(() -> {}); + + private ProducerState(String stream, Environment environment) { + this.stream = stream; + this.producer = environment.producerBuilder().stream(stream).build(); + } + + void start() { + ConfirmationHandler confirmationHandler = + confirmationStatus -> { + if (confirmationStatus.isConfirmed()) { + acceptedCount.incrementAndGet(); + postConfirmed.get().run(); + } + }; + task = + Executors.defaultThreadFactory() + .newThread( + () -> { + while (!stopped.get() && !Thread.currentThread().isInterrupted()) { + try { + this.limiter.acquire(1); + this.producer.send( + producer.messageBuilder().addData(BODY).build(), confirmationHandler); + } catch (Exception e) { + + } + } + }); + task.start(); + } + + Sync waitForNewMessages(int messageCount) { + Sync sync = sync(messageCount); + AtomicInteger count = new AtomicInteger(); + this.postConfirmed.set( + () -> { + if (count.incrementAndGet() == messageCount) { + this.postConfirmed.set(() -> {}); + } + sync.down(); + }); + return sync; + } + + @Override + public void close() { + stopped.set(true); + task.interrupt(); + producer.close(); + } + } + + private static class ConsumerState implements AutoCloseable { + + private final String stream; + private final Consumer consumer; + final AtomicInteger receivedCount = new AtomicInteger(); + final AtomicReference postHandle = new AtomicReference<>(() -> {}); + + private ConsumerState(String stream, Environment environment) { + this.stream = stream; + this.consumer = + environment.consumerBuilder().stream(stream) + .offset(OffsetSpecification.first()) + .messageHandler( + (ctx, m) -> { + receivedCount.incrementAndGet(); + postHandle.get().run(); + }) + .build(); + } + + Sync waitForNewMessages(int messageCount) { + Sync sync = sync(messageCount); + AtomicInteger count = new AtomicInteger(); + this.postHandle.set( + () -> { + if (count.incrementAndGet() == messageCount) { + this.postHandle.set(() -> {}); + } + sync.down(); + }); + return sync; + } + + @Override + public void close() { + this.consumer.close(); + } + } +} diff --git a/src/test/java/com/rabbitmq/stream/impl/RetentionClientTest.java b/src/test/java/com/rabbitmq/stream/impl/RetentionClientTest.java index dc25d4f50a..067106faf8 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RetentionClientTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RetentionClientTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -23,7 +23,7 @@ import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.stream.ByteCapacity; -import com.rabbitmq.stream.Host; +import com.rabbitmq.stream.Cli; import com.rabbitmq.stream.OffsetSpecification; import com.rabbitmq.stream.impl.TestUtils.CallableConsumer; import com.rabbitmq.stream.impl.TestUtils.RunnableWithException; @@ -85,11 +85,11 @@ static RetentionTestConfig[] retention() { + "'{\"max-length-bytes\":%d,\"stream-max-segment-size-bytes\":%d }' " + "--priority 1 --apply-to queues", stream, maxLengthBytes, maxSegmentSizeBytes); - Host.rabbitmqctl(policyCommand); + Cli.rabbitmqctl(policyCommand); }, firstMessageId -> firstMessageId > 0, firstMessageId -> "First message ID should be positive but is " + firstMessageId, - () -> Host.rabbitmqctl("clear_policy stream-retention-test")), + () -> Cli.rabbitmqctl("clear_policy stream-retention-test")), new RetentionTestConfig( "with size helper to specify bytes", context -> { diff --git a/src/test/java/com/rabbitmq/stream/impl/SacClientTest.java b/src/test/java/com/rabbitmq/stream/impl/SacClientTest.java index e0405968fb..46a997fe51 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SacClientTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SacClientTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2022-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2022-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -27,8 +27,8 @@ import static java.util.stream.Collectors.toList; import static org.assertj.core.api.Assertions.assertThat; +import com.rabbitmq.stream.Cli; import com.rabbitmq.stream.Constants; -import com.rabbitmq.stream.Host; import com.rabbitmq.stream.OffsetSpecification; import com.rabbitmq.stream.impl.Client.ClientParameters; import com.rabbitmq.stream.impl.Client.ConsumerUpdateListener; @@ -430,7 +430,7 @@ void killingConnectionsShouldTriggerConsumerUpdateNotification() throws Exceptio Map consumerStates = new ConcurrentHashMap<>(); List consumerNames = IntStream.range(0, 5).mapToObj(i -> "foo-" + i).collect(toList()); - int connectionCount = Host.listConnections().size(); + int connectionCount = Cli.listConnections().size(); for (String consumerName : consumerNames) { Client c0 = @@ -467,10 +467,10 @@ void killingConnectionsShouldTriggerConsumerUpdateNotification() throws Exceptio } int cCount = connectionCount; - waitAtMost(() -> Host.listConnections().size() == cCount); + waitAtMost(() -> Cli.listConnections().size() == cCount); for (String consumerName : consumerNames) { - Host.killConnection(consumerName + "-connection-0"); + Cli.killConnection(consumerName + "-connection-0"); waitAtMost( () -> consumerStates.containsKey(consumerName + "-connection-1") @@ -605,7 +605,7 @@ void singleActiveConsumerMustHaveName() { void connectionShouldBeClosedIfConsumerUpdateTakesTooLong() throws Exception { Duration timeout = Duration.ofSeconds(1); try { - Host.setEnv("request_timeout", String.valueOf(timeout.getSeconds())); + Cli.setEnv("request_timeout", String.valueOf(timeout.getSeconds())); CountDownLatch shutdownLatch = new CountDownLatch(1); Client client = cf.get( @@ -629,7 +629,7 @@ void connectionShouldBeClosedIfConsumerUpdateTakesTooLong() throws Exception { assertThat(latchAssert(shutdownLatch)).completes(timeout.multipliedBy(5)); } finally { - Host.setEnv("request_timeout", "60000"); + Cli.setEnv("request_timeout", "60000"); } } } diff --git a/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java index 698cbc5ede..44ab97e806 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2022-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2022-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -241,8 +241,8 @@ void externalTrackingSecondConsumerShouldTakeOverWhereTheFirstOneLeftOff() throw public static Stream> activeConsumerShouldGetUpdateNotificationAfterDisruption() { return Stream.of( - namedConsumer(consumer -> Host.killConnection(connectionName(consumer)), "kill connection"), - namedConsumer(consumer -> Host.restartStream(stream(consumer)), "restart stream"), + namedConsumer(consumer -> Cli.killConnection(connectionName(consumer)), "kill connection"), + namedConsumer(consumer -> Cli.restartStream(stream(consumer)), "restart stream"), namedConsumer(Consumer::close, "close consumer")); } diff --git a/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java index 3180bbbea6..dab5f9ff47 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -813,8 +813,8 @@ void consumerGroupsOnSameSuperStreamShouldBeIndependent() { public static Stream> activeConsumerShouldGetUpdateNotificationAfterDisruption() { return Stream.of( - namedBiConsumer((s, c) -> Host.killConnection(connectionName(s, c)), "kill connection"), - namedBiConsumer((s, c) -> Host.restartStream(s), "restart stream"), + namedBiConsumer((s, c) -> Cli.killConnection(connectionName(s, c)), "kill connection"), + namedBiConsumer((s, c) -> Cli.restartStream(s), "restart stream"), namedBiConsumer((s, c) -> c.close(), "close consumer")); } diff --git a/src/test/java/com/rabbitmq/stream/impl/ShutdownListenerTest.java b/src/test/java/com/rabbitmq/stream/impl/ShutdownListenerTest.java index d6dc802305..014b5919da 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ShutdownListenerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ShutdownListenerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -16,8 +16,8 @@ import static org.assertj.core.api.Assertions.assertThat; +import com.rabbitmq.stream.Cli; import com.rabbitmq.stream.Constants; -import com.rabbitmq.stream.Host; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.util.UUID; @@ -87,7 +87,7 @@ void shutdownListenerShouldBeCalledWhenConnectionIsKilled() throws Exception { shutdownLatch.countDown(); })); - Host.killConnection(connectionName); + Cli.killConnection(connectionName); assertThat(shutdownLatch.await(10, TimeUnit.SECONDS)).isTrue(); assertThat(reason.get()).isNotNull().isEqualTo(Client.ShutdownContext.ShutdownReason.UNKNOWN); assertThat(client.isOpen()).isFalse(); diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java index f0e1a44108..1feebe6081 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -68,20 +68,19 @@ static Stream> consumerShouldKeepConsumingAf return Stream.of( TestUtils.namedTask( o -> { - Host.killStreamLeaderProcess(o.toString()); + Cli.killStreamLeaderProcess(o.toString()); Thread.sleep(TOPOLOGY_DELAY.toMillis()); }, "stream leader process is killed"), TestUtils.namedTask( - o -> Host.killConnection("rabbitmq-stream-consumer-0"), - "consumer connection is killed"), + o -> Cli.killConnection("rabbitmq-stream-consumer-0"), "consumer connection is killed"), TestUtils.namedTask( o -> { try { - Host.rabbitmqctl("stop_app"); + Cli.rabbitmqctl("stop_app"); Thread.sleep(1000L); } finally { - Host.rabbitmqctl("start_app"); + Cli.rabbitmqctl("start_app"); } Thread.sleep(recoveryInitialDelay.toMillis() * 2); }, @@ -90,7 +89,7 @@ static Stream> consumerShouldKeepConsumingAf @BeforeEach void init() { - if (Host.isOnDocker()) { + if (Cli.isOnDocker()) { // with a containerized broker in bridged network mode, the client should not // reconnect too soon, as it would see the port still open but would not get any response. // This then provokes some cascading timeouts in the test. @@ -510,7 +509,7 @@ void consumerShouldReUseInitialOffsetSpecificationAfterDisruptionIfNoMessagesRec .build(); // killing the consumer connection to trigger an internal restart - Host.killConnection("rabbitmq-stream-consumer-0"); + Cli.killConnection("rabbitmq-stream-consumer-0"); // no messages should have been received assertThat(consumedCount.get()).isZero(); @@ -813,7 +812,7 @@ void externalOffsetTrackingWithSubscriptionListener() throws Exception { waitAtMost(5, () -> receivedMessages.get() == messageCount); assertThat(offsetTracking.get()).isGreaterThanOrEqualTo(messageCount - 1); - Host.killConnection("rabbitmq-stream-consumer-0"); + Cli.killConnection("rabbitmq-stream-consumer-0"); waitAtMost( recoveryInitialDelay.multipliedBy(2), () -> subscriptionListenerCallCount.get() == 2); @@ -858,7 +857,7 @@ void duplicatesWhenResubscribeAfterDisconnectionWithLongFlushInterval() throws E }; publish.accept(storeEvery * 2 - 100); waitAtMost(5, () -> receivedMessages.get() == publishedMessages.get()); - Host.killConnection("rabbitmq-stream-consumer-0"); + Cli.killConnection("rabbitmq-stream-consumer-0"); publish.accept(storeEvery * 2); waitAtMost( @@ -924,7 +923,7 @@ void useSubscriptionListenerToRestartExactlyWhereDesired() throws Exception { }; publish.accept(storeEvery * 2 - 100); waitAtMost(5, () -> receivedMessages.get() == publishedMessages.get()); - Host.killConnection("rabbitmq-stream-consumer-0"); + Cli.killConnection("rabbitmq-stream-consumer-0"); publish.accept(storeEvery * 2); producer.send( diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java index 6ef7e563cd..3b147ed458 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -30,14 +30,14 @@ import com.rabbitmq.stream.Address; import com.rabbitmq.stream.AuthenticationFailureException; import com.rabbitmq.stream.BackOffDelayPolicy; +import com.rabbitmq.stream.Cli; +import com.rabbitmq.stream.Cli.ConnectionInfo; import com.rabbitmq.stream.ConfirmationHandler; import com.rabbitmq.stream.Constants; import com.rabbitmq.stream.Consumer; import com.rabbitmq.stream.ConsumerBuilder; import com.rabbitmq.stream.Environment; import com.rabbitmq.stream.EnvironmentBuilder; -import com.rabbitmq.stream.Host; -import com.rabbitmq.stream.Host.ConnectionInfo; import com.rabbitmq.stream.Message; import com.rabbitmq.stream.NoOffsetException; import com.rabbitmq.stream.OffsetSpecification; @@ -363,12 +363,12 @@ void environmentPublishersConsumersShouldCloseSuccessfullyWhenBrokerIsDown() thr latchAssert(consumeLatch).completes(); try { - Host.rabbitmqctl("stop_app"); + Cli.rabbitmqctl("stop_app"); producer.close(); consumer.close(); environment.close(); } finally { - Host.rabbitmqctl("start_app"); + Cli.rabbitmqctl("start_app"); } waitAtMost( 30, @@ -389,7 +389,7 @@ void locatorShouldReconnectIfConnectionIsLost(TestInfo info) { String s = streamName(info); environment.streamCreator().stream(s).create(); environment.deleteStream(s); - Host.killConnection("rabbitmq-stream-locator-0"); + Cli.killConnection("rabbitmq-stream-locator-0"); environment.streamCreator().stream(s).create(); try { Producer producer = environment.producerBuilder().stream(s).build(); @@ -422,14 +422,14 @@ void shouldHaveSeveralLocatorsWhenSeveralUrisSpecifiedAndShouldRecoverThemIfClos Supplier> locatorConnectionNamesSupplier = () -> - Host.listConnections().stream() + Cli.listConnections().stream() .map(ConnectionInfo::clientProvidedName) .filter(name -> name.contains("-locator-")) .collect(toList()); List locatorConnectionNames = locatorConnectionNamesSupplier.get(); assertThat(locatorConnectionNames).hasSameSizeAs(uris); - locatorConnectionNames.forEach(connectionName -> Host.killConnection(connectionName)); + locatorConnectionNames.forEach(connectionName -> Cli.killConnection(connectionName)); environment.streamCreator().stream(s).create(); try { diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java index e900fb4990..6247e43ecf 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java @@ -280,7 +280,7 @@ void shouldRecoverAfterConnectionIsKilled(int subEntrySize) throws Exception { Thread.sleep(1000L); - Host.killConnection("rabbitmq-stream-producer-0"); + Cli.killConnection("rabbitmq-stream-producer-0"); waitAtMost(() -> ((StreamProducer) producer).status() == Status.NOT_AVAILABLE); canPublish.set(false); diff --git a/src/test/java/com/rabbitmq/stream/impl/SuperStreamManagementTest.java b/src/test/java/com/rabbitmq/stream/impl/SuperStreamManagementTest.java index 1e74973362..9b2e6b9732 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SuperStreamManagementTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SuperStreamManagementTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -14,8 +14,8 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; +import static com.rabbitmq.stream.Cli.*; import static com.rabbitmq.stream.Constants.*; -import static com.rabbitmq.stream.Host.*; import static com.rabbitmq.stream.impl.TestUtils.ResponseConditions.*; import static com.rabbitmq.stream.impl.TestUtils.streamName; import static com.rabbitmq.stream.impl.TestUtils.waitAtMost; diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index 41e4689ef9..5611b5e37b 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -28,8 +28,8 @@ import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.stream.Address; +import com.rabbitmq.stream.Cli; import com.rabbitmq.stream.Constants; -import com.rabbitmq.stream.Host; import com.rabbitmq.stream.Message; import com.rabbitmq.stream.MessageBuilder; import com.rabbitmq.stream.StreamException; @@ -372,28 +372,12 @@ private static String streamName(Class testClass, Method testMethod) { } static boolean tlsAvailable() { - if (Host.rabbitmqctlCommand() == null) { - throw new IllegalStateException( - "rabbitmqctl.bin system property not set, cannot check if TLS is enabled"); - } else { - try { - Process process = Host.rabbitmqctl("status"); - String output = capture(process.getInputStream()); - return output.contains("stream/ssl"); - } catch (Exception e) { - throw new RuntimeException("Error while trying to detect TLS: " + e.getMessage()); - } - } + return Cli.rabbitmqctl("status").output().contains("stream/ssl"); } static boolean isCluster() { - try { - Process process = Host.rabbitmqctl("eval 'nodes().'"); - String content = capture(process.getInputStream()); - return !content.replace("[", "").replace("]", "").trim().isEmpty(); - } catch (IOException e) { - throw new RuntimeException(e); - } + String content = Cli.rabbitmqctl("eval 'nodes().'").output(); + return !content.replace("[", "").replace("]", "").trim().isEmpty(); } private static String capture(InputStream is) throws IOException { @@ -825,7 +809,7 @@ static class DisabledIfRabbitMqCtlNotSetCondition implements ExecutionCondition @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { - if (Host.rabbitmqctlCommand() == null) { + if (Cli.rabbitmqctlCommand() == null) { return ConditionEvaluationResult.disabled("rabbitmqctl.bin system property not set"); } else { return ConditionEvaluationResult.enabled("rabbitmqctl.bin system property is set"); @@ -845,15 +829,14 @@ abstract static class DisabledIfPluginNotEnabledCondition implements ExecutionCo @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { - if (Host.rabbitmqctlCommand() == null) { + if (Cli.rabbitmqctlCommand() == null) { return ConditionEvaluationResult.disabled( format( "rabbitmqctl.bin system property not set, cannot check if %s plugin is enabled", pluginLabel)); } else { try { - Process process = Host.rabbitmqctl("status"); - String output = capture(process.getInputStream()); + String output = Cli.rabbitmqctl("status").output(); if (condition.test(output)) { return ConditionEvaluationResult.enabled(format("%s plugin enabled", pluginLabel)); } else { diff --git a/src/test/java/com/rabbitmq/stream/impl/TlsTest.java b/src/test/java/com/rabbitmq/stream/impl/TlsTest.java index 1b1a88404c..04964069d6 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TlsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/TlsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -36,7 +36,6 @@ import io.netty.handler.ssl.SslHandler; import java.io.File; import java.io.FileInputStream; -import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.charset.Charset; @@ -268,10 +267,10 @@ void saslExternalShouldSucceedWithUserForClientCertificate() throws Exception { .build(); String username = clientCertificate.getSubjectX500Principal().getName(); - Host.rabbitmqctlIgnoreError(format("delete_user %s", username)); - Host.rabbitmqctl(format("add_user %s foo", username)); + Cli.rabbitmqctlIgnoreError(format("delete_user %s", username)); + Cli.rabbitmqctl(format("add_user %s foo", username)); try { - Host.rabbitmqctl(format("set_permissions %s '.*' '.*' '.*'", username)); + Cli.rabbitmqctl(format("set_permissions %s '.*' '.*' '.*'", username)); cf.get( new ClientParameters() @@ -279,7 +278,7 @@ void saslExternalShouldSucceedWithUserForClientCertificate() throws Exception { .sslContext(context) .saslConfiguration(DefaultSaslConfiguration.EXTERNAL)); } finally { - Host.rabbitmqctl(format("delete_user %s", username)); + Cli.rabbitmqctl(format("delete_user %s", username)); } } @@ -295,7 +294,7 @@ void saslExternalShouldFailIfNoUserForClientCertificate() throws Exception { .build(); String username = clientCertificate.getSubjectX500Principal().getName(); - Host.rabbitmqctlIgnoreError(format("delete_user %s", username)); + Cli.rabbitmqctlIgnoreError(format("delete_user %s", username)); assertThatThrownBy( () -> cf.get( @@ -385,11 +384,7 @@ private static String hostname() { try { return InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { - try { - return Host.hostname(); - } catch (IOException ex) { - throw new RuntimeException(ex); - } + return Cli.hostname(); } } diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index d5a75a1ef7..9e989e9e4d 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -8,6 +8,7 @@ + From 0eb471f1b840c624c3d3ea5d880990749302d3cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 28 Nov 2024 15:48:22 +0100 Subject: [PATCH 288/449] Harden candidate lookup for producers --- .../stream/impl/ProducersCoordinator.java | 40 ++++-- .../java/com/rabbitmq/stream/impl/Tuples.java | 43 +++++++ .../stream/impl/LoadBalancerClusterTest.java | 6 +- .../stream/impl/ProducersCoordinatorTest.java | 17 ++- .../stream/impl/RecoveryClusterTest.java | 118 +++++++++++++++--- src/test/resources/logback-test.xml | 1 + 6 files changed, 190 insertions(+), 35 deletions(-) create mode 100644 src/main/java/com/rabbitmq/stream/impl/Tuples.java diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java index bf9dc9d60e..860a924bc2 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java @@ -14,6 +14,7 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; +import static com.rabbitmq.stream.impl.Tuples.pair; import static com.rabbitmq.stream.impl.Utils.*; import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toSet; @@ -30,6 +31,7 @@ import com.rabbitmq.stream.impl.Client.PublishErrorListener; import com.rabbitmq.stream.impl.Client.Response; import com.rabbitmq.stream.impl.Client.ShutdownListener; +import com.rabbitmq.stream.impl.Tuples.Pair; import com.rabbitmq.stream.impl.Utils.ClientConnectionType; import com.rabbitmq.stream.impl.Utils.ClientFactory; import com.rabbitmq.stream.impl.Utils.ClientFactoryContext; @@ -219,10 +221,13 @@ List findCandidateNodes(String stream, boolean forceLeader) { List candidates = new ArrayList<>(); Client.Broker leader = streamMetadata.getLeader(); - if (leader == null && forceLeader) { - throw new IllegalStateException("Not leader available for stream " + stream); + if (leader == null) { + if (forceLeader) { + throw new IllegalStateException("Not leader available for stream " + stream); + } + } else { + candidates.add(new BrokerWrapper(leader, true)); } - candidates.add(new BrokerWrapper(leader, true)); if (!forceLeader && streamMetadata.hasReplicas()) { candidates.addAll( @@ -231,7 +236,11 @@ List findCandidateNodes(String stream, boolean forceLeader) { .collect(toList())); } - LOGGER.debug("Candidates to publish to {}: {}", stream, candidates); + if (candidates.isEmpty()) { + throw new IllegalStateException("No stream member available to publish for stream " + stream); + } else { + LOGGER.debug("Candidates to publish to {}: {}", stream, candidates); + } return List.copyOf(candidates); } @@ -721,15 +730,20 @@ private ClientProducersManager( private void assignProducersToNewManagers( Collection trackers, String stream, BackOffDelayPolicy delayPolicy) { - AsyncRetry.asyncRetry(() -> findCandidateNodes(stream, forceLeader)) + AsyncRetry.asyncRetry( + () -> { + List candidates = findCandidateNodes(stream, forceLeader); + return pair(pickBroker(candidates), candidates); + }) .description("Candidate lookup to publish to " + stream) .scheduler(environment.scheduledExecutorService()) .retry(ex -> !(ex instanceof StreamDoesNotExistException)) .delayPolicy(delayPolicy) .build() .thenAccept( - candidates -> { - Broker broker = pickBroker(candidates); + brokerAndCandidates -> { + Broker broker = brokerAndCandidates.v1(); + List candidates = brokerAndCandidates.v2(); String key = keyForNode(broker); LOGGER.debug( "Assigning {} producer(s) and consumer tracker(s) to {}", trackers.size(), key); @@ -805,15 +819,19 @@ private void recoverAgent(Broker node, List candidates, AgentTrac tracker.identifiable() ? tracker.id() : "N/A", tracker.stream()); // maybe not a good candidate, let's refresh and retry for this one - candidates = - Utils.callAndMaybeRetry( - () -> findCandidateNodes(tracker.stream(), forceLeader), + Pair> brokerAndCandidates = + callAndMaybeRetry( + () -> { + List cs = findCandidateNodes(tracker.stream(), forceLeader); + return pair(pickBroker(cs), cs); + }, ex -> !(ex instanceof StreamDoesNotExistException), environment.recoveryBackOffDelayPolicy(), "Candidate lookup for %s on stream '%s'", tracker.type(), tracker.stream()); - node = pickBroker(candidates); + node = brokerAndCandidates.v1(); + candidates = brokerAndCandidates.v2(); } catch (Exception e) { LOGGER.warn( "Error while re-assigning {} (stream '{}')", tracker.type(), tracker.stream(), e); diff --git a/src/main/java/com/rabbitmq/stream/impl/Tuples.java b/src/main/java/com/rabbitmq/stream/impl/Tuples.java new file mode 100644 index 0000000000..da9088f649 --- /dev/null +++ b/src/main/java/com/rabbitmq/stream/impl/Tuples.java @@ -0,0 +1,43 @@ +// Copyright (c) 2024 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.impl; + +final class Tuples { + + private Tuples() {} + + static Pair pair(A v1, B v2) { + return new Pair<>(v1, v2); + } + + static class Pair { + + private final A v1; + private final B v2; + + private Pair(A v1, B v2) { + this.v1 = v1; + this.v2 = v2; + } + + A v1() { + return this.v1; + } + + B v2() { + return this.v2; + } + } +} diff --git a/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java index 9d63f42fdc..d0688da9c8 100644 --- a/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java @@ -57,7 +57,7 @@ public class LoadBalancerClusterTest { String stream; EventLoopGroup eventLoopGroup; Client locator; - Address loadBalancerAddress = new Address("localhost", LB_PORT); + static final Address LOAD_BALANCER_ADDRESS = new Address("localhost", LB_PORT); @BeforeEach void init() { @@ -66,7 +66,7 @@ void init() { when(environment.locator()).thenReturn(locator); when(environment.clientParametersCopy()) .thenReturn(new Client.ClientParameters().eventLoopGroup(eventLoopGroup).port(LB_PORT)); - when(environment.addressResolver()).thenReturn(address -> loadBalancerAddress); + when(environment.addressResolver()).thenReturn(address -> LOAD_BALANCER_ADDRESS); when(environment.locatorOperation(any())).thenCallRealMethod(); } @@ -175,7 +175,7 @@ void producersConsumersShouldSpreadAccordingToDataLocalitySettings(boolean force .port(LB_PORT) .forceReplicaForConsumers(forceLocality) .forceReplicaForConsumers(forceLocality) - .addressResolver(addr -> loadBalancerAddress) + .addressResolver(addr -> LOAD_BALANCER_ADDRESS) .maxProducersByConnection(maxPerConnection) .maxConsumersByConnection(maxPerConnection) .forceLeaderForProducers(forceLocality) diff --git a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java index 176f5dbb13..88d6d122ce 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java @@ -750,12 +750,27 @@ void findCandidateNodesShouldReturnLeaderAndReplicasWhenForceLeaderIsFalse() { } @Test - void findCandidateNodesShouldThrowIfThereIsNoLeader() { + void findCandidateNodesShouldThrowIfThereIsNoLeaderAndForceLeaderIsTrue() { when(locator.metadata("stream")).thenReturn(metadata(null, replicas())); assertThatThrownBy(() -> coordinator.findCandidateNodes("stream", true)) .isInstanceOf(IllegalStateException.class); } + @Test + void findCandidateNodesShouldThrowIfNoMembersAndForceLeaderIsFalse() { + when(locator.metadata("stream")).thenReturn(metadata(null, List.of())); + assertThatThrownBy(() -> coordinator.findCandidateNodes("stream", false)) + .isInstanceOf(IllegalStateException.class); + } + + @Test + void findCandidateNodesShouldReturnOnlyReplicasIfNoLeaderAndForceLeaderIsFalse() { + when(locator.metadata("stream")).thenReturn(metadata(null, replicas())); + assertThat(coordinator.findCandidateNodes("stream", false)) + .hasSize(2) + .containsAll(replicaWrappers()); + } + private static ScheduledExecutorService createScheduledExecutorService() { return new ScheduledExecutorServiceWrapper(Executors.newSingleThreadScheduledExecutor()); } diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index f6863f5d4d..f7f967350d 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -15,21 +15,31 @@ package com.rabbitmq.stream.impl; import static com.rabbitmq.stream.impl.Assertions.assertThat; +import static com.rabbitmq.stream.impl.LoadBalancerClusterTest.LOAD_BALANCER_ADDRESS; import static com.rabbitmq.stream.impl.TestUtils.sync; +import static io.vavr.Tuple.of; import static java.time.Duration.ofSeconds; import static java.util.stream.Collectors.toList; +import static java.util.stream.IntStream.range; +import static org.assertj.core.api.Assertions.assertThat; import com.google.common.util.concurrent.RateLimiter; import com.rabbitmq.stream.*; import com.rabbitmq.stream.impl.TestUtils.Sync; +import io.netty.channel.EventLoopGroup; +import io.vavr.Tuple2; import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.IntStream; import org.junit.jupiter.api.*; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -41,12 +51,12 @@ public class RecoveryClusterTest { static List nodes; static final List URIS = - IntStream.range(5552, 5555) - .mapToObj(p -> "rabbitmq-stream://localhost:" + p) - .collect(toList()); - static final BackOffDelayPolicy BACK_OFF_DELAY_POLICY = BackOffDelayPolicy.fixed(ofSeconds(3)); + range(5552, 5555).mapToObj(p -> "rabbitmq-stream://localhost:" + p).collect(toList()); + static final BackOffDelayPolicy BACK_OFF_DELAY_POLICY = BackOffDelayPolicy.fixed(ofSeconds(2)); Environment environment; TestInfo testInfo; + EventLoopGroup eventLoopGroup; + EnvironmentBuilder environmentBuilder; @BeforeAll static void initAll() { @@ -55,33 +65,76 @@ static void initAll() { @BeforeEach void init(TestInfo info) { - environment = + environmentBuilder = Environment.builder() - .uris(URIS) .recoveryBackOffDelayPolicy(BACK_OFF_DELAY_POLICY) .topologyUpdateBackOffDelayPolicy(BACK_OFF_DELAY_POLICY) - .build(); + .netty() + .eventLoopGroup(eventLoopGroup) + .environmentBuilder(); this.testInfo = info; } @AfterEach void tearDown() { - environment.close(); + if (environment != null) { + environment.close(); + } } - @Test - void clusterRestart() { + @ParameterizedTest + @CsvSource({ + "false,false", + "true,true", + "true,false", + }) + void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws InterruptedException { int streamCount = 10; + int producerCount = streamCount * 2; + int consumerCount = streamCount * 2; + + if (useLoadBalancer) { + environmentBuilder + .host(LOAD_BALANCER_ADDRESS.host()) + .port(LOAD_BALANCER_ADDRESS.port()) + .addressResolver(addr -> LOAD_BALANCER_ADDRESS); + Duration nodeRetryDelay = Duration.ofMillis(100); + environmentBuilder.forceLeaderForProducers(forceLeader); + // to make the test faster + ((StreamEnvironmentBuilder) environmentBuilder).producerNodeRetryDelay(nodeRetryDelay); + ((StreamEnvironmentBuilder) environmentBuilder).consumerNodeRetryDelay(nodeRetryDelay); + } else { + environmentBuilder.uris(URIS); + } + + environment = + environmentBuilder + .maxProducersByConnection(producerCount / 4) + .maxConsumersByConnection(consumerCount / 4) + .build(); List streams = - IntStream.range(0, streamCount) + range(0, streamCount) .mapToObj(i -> TestUtils.streamName(testInfo) + "-" + i) .collect(toList()); streams.forEach(s -> environment.streamCreator().stream(s).create()); try { List producers = - streams.stream().map(s -> new ProducerState(s, environment)).collect(toList()); + range(0, producerCount) + .mapToObj( + i -> { + String s = streams.get(i % streams.size()); + boolean dynamicBatch = i % 2 == 0; + return new ProducerState(s, dynamicBatch, environment); + }) + .collect(toList()); List consumers = - streams.stream().map(s -> new ConsumerState(s, environment)).collect(toList()); + range(0, consumerCount) + .mapToObj( + i -> { + String s = streams.get(i % streams.size()); + return new ConsumerState(s, environment); + }) + .collect(toList()); producers.forEach(ProducerState::start); @@ -101,12 +154,34 @@ void clusterRestart() { Cli.rebalance(); LOGGER.info("Rebalancing over."); - syncs = producers.stream().map(p -> p.waitForNewMessages(100)).collect(toList()); - syncs.forEach(s -> assertThat(s).completes()); + Thread.sleep(BACK_OFF_DELAY_POLICY.delay(0).multipliedBy(2).toMillis()); + + List> streamsSyncs = + producers.stream().map(p -> of(p.stream(), p.waitForNewMessages(100))).collect(toList()); + streamsSyncs.forEach( + t -> { + LOGGER.info("Checking publisher to {} still publishes", t._1()); + assertThat(t._2()).completes(); + LOGGER.info("Publisher to {} still publishes", t._1()); + }); syncs = consumers.stream().map(c -> c.waitForNewMessages(100)).collect(toList()); syncs.forEach(s -> assertThat(s).completes()); + Map committedChunkIdPerStream = new LinkedHashMap<>(streamCount); + streams.forEach( + s -> + committedChunkIdPerStream.put(s, environment.queryStreamStats(s).committedChunkId())); + + syncs = producers.stream().map(p -> p.waitForNewMessages(100)).collect(toList()); + syncs.forEach(s -> assertThat(s).completes()); + + streams.forEach( + s -> { + assertThat(environment.queryStreamStats(s).committedChunkId()) + .isGreaterThan(committedChunkIdPerStream.get(s)); + }); + producers.forEach(ProducerState::close); consumers.forEach(ConsumerState::close); } finally { @@ -126,9 +201,10 @@ private static class ProducerState implements AutoCloseable { final AtomicInteger acceptedCount = new AtomicInteger(); final AtomicReference postConfirmed = new AtomicReference<>(() -> {}); - private ProducerState(String stream, Environment environment) { + private ProducerState(String stream, boolean dynamicBatch, Environment environment) { this.stream = stream; - this.producer = environment.producerBuilder().stream(stream).build(); + this.producer = + environment.producerBuilder().stream(stream).dynamicBatch(dynamicBatch).build(); } void start() { @@ -169,6 +245,10 @@ Sync waitForNewMessages(int messageCount) { return sync; } + String stream() { + return this.stream; + } + @Override public void close() { stopped.set(true); @@ -179,13 +259,11 @@ public void close() { private static class ConsumerState implements AutoCloseable { - private final String stream; private final Consumer consumer; final AtomicInteger receivedCount = new AtomicInteger(); final AtomicReference postHandle = new AtomicReference<>(() -> {}); private ConsumerState(String stream, Environment environment) { - this.stream = stream; this.consumer = environment.consumerBuilder().stream(stream) .offset(OffsetSpecification.first()) diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 9e989e9e4d..c14927bab8 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -8,6 +8,7 @@ + From 69dd43a42d05013bba2e92a29cbd83a664fc831b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 28 Nov 2024 16:31:33 +0100 Subject: [PATCH 289/449] Add more info to test assertion --- .../java/com/rabbitmq/stream/impl/RecoveryClusterTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index f7f967350d..9f526552ac 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -157,7 +157,7 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru Thread.sleep(BACK_OFF_DELAY_POLICY.delay(0).multipliedBy(2).toMillis()); List> streamsSyncs = - producers.stream().map(p -> of(p.stream(), p.waitForNewMessages(100))).collect(toList()); + producers.stream().map(p -> of(p.stream(), p.waitForNewMessages(1000))).collect(toList()); streamsSyncs.forEach( t -> { LOGGER.info("Checking publisher to {} still publishes", t._1()); @@ -165,7 +165,7 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru LOGGER.info("Publisher to {} still publishes", t._1()); }); - syncs = consumers.stream().map(c -> c.waitForNewMessages(100)).collect(toList()); + syncs = consumers.stream().map(c -> c.waitForNewMessages(1000)).collect(toList()); syncs.forEach(s -> assertThat(s).completes()); Map committedChunkIdPerStream = new LinkedHashMap<>(streamCount); @@ -173,12 +173,13 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru s -> committedChunkIdPerStream.put(s, environment.queryStreamStats(s).committedChunkId())); - syncs = producers.stream().map(p -> p.waitForNewMessages(100)).collect(toList()); + syncs = producers.stream().map(p -> p.waitForNewMessages(1000)).collect(toList()); syncs.forEach(s -> assertThat(s).completes()); streams.forEach( s -> { assertThat(environment.queryStreamStats(s).committedChunkId()) + .as("Committed chunk ID did not increase") .isGreaterThan(committedChunkIdPerStream.get(s)); }); From 9f92f24f423d8b9baf534a62312ffb6d0a0131db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 28 Nov 2024 18:12:59 +0100 Subject: [PATCH 290/449] Increase number of locator lookup attempts --- src/main/java/com/rabbitmq/stream/impl/Client.java | 12 +++++++++++- .../com/rabbitmq/stream/impl/StreamEnvironment.java | 2 +- .../rabbitmq/stream/impl/RecoveryClusterTest.java | 11 +++++++++++ src/test/resources/logback-test.xml | 1 + 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 00a5931bb3..4c4ed887a8 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -2824,7 +2824,17 @@ public void channelInactive(ChannelHandlerContext ctx) { // because it will be handled later anyway. if (shutdownReason == null) { if (closing.compareAndSet(false, true)) { - executorService.submit(() -> closingSequence(ShutdownReason.UNKNOWN)); + if (executorService == null) { + // the TCP connection is closed before the state is initialized + // we do our best the execute the closing sequence + new Thread( + () -> { + closingSequence(ShutdownReason.UNKNOWN); + }) + .start(); + } else { + executorService.submit(() -> closingSequence(ShutdownReason.UNKNOWN)); + } } } } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index 3f7642cbec..ed7f908b65 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -742,7 +742,7 @@ static T locatorOperation( Function operation, Supplier clientSupplier, BackOffDelayPolicy backOffDelayPolicy) { - int maxAttempt = 3; + int maxAttempt = 5; int attempt = 0; boolean executed = false; Exception lastException = null; diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index 9f526552ac..66f3514162 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -23,6 +23,7 @@ import static java.util.stream.IntStream.range; import static org.assertj.core.api.Assertions.assertThat; +import ch.qos.logback.classic.Level; import com.google.common.util.concurrent.RateLimiter; import com.rabbitmq.stream.*; import com.rabbitmq.stream.impl.TestUtils.Sync; @@ -57,10 +58,13 @@ public class RecoveryClusterTest { TestInfo testInfo; EventLoopGroup eventLoopGroup; EnvironmentBuilder environmentBuilder; + static Level producersCoordinatorLogLevel; @BeforeAll static void initAll() { nodes = Cli.nodes(); + producersCoordinatorLogLevel = + TestUtils.newLoggerLevel(ProducersCoordinator.class, Level.DEBUG); } @BeforeEach @@ -82,6 +86,13 @@ void tearDown() { } } + @AfterAll + static void tearDownAll() { + if (producersCoordinatorLogLevel != null) { + TestUtils.newLoggerLevel(ProducersCoordinator.class, producersCoordinatorLogLevel); + } + } + @ParameterizedTest @CsvSource({ "false,false", diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index c14927bab8..0cf733c381 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -7,6 +7,7 @@ + From fdd59fff423b94c1e5384b9b7d1a5bf1fa9f8b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 28 Nov 2024 18:44:50 +0100 Subject: [PATCH 291/449] Fix unit test --- .../com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java index 5724e0f6f9..30b3da30bb 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java @@ -245,7 +245,7 @@ void locatorOperationShouldThrowLocatorExceptionWhenRetryExhausts() { CLIENT_SUPPLIER, BackOffDelayPolicy.fixed(Duration.ofMillis(10)))) .isInstanceOf(LocatorNotAvailableException.class); - assertThat(counter).hasValue(3); + assertThat(counter).hasValue(5); } @Test From c4d0c489c9cfdb98812b71e5a9a73c9f812de14a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 29 Nov 2024 10:43:59 +0100 Subject: [PATCH 292/449] Add log messages to recovery test --- .github/workflows/test-pr.yml | 36 ++++++------- .../stream/impl/StreamEnvironment.java | 2 +- .../stream/impl/RecoveryClusterTest.java | 54 +++++++++++++------ .../impl/StreamEnvironmentUnitTest.java | 2 +- 4 files changed, 57 insertions(+), 37 deletions(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 380db0602c..cd6b55be74 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -22,24 +22,24 @@ jobs: distribution: 'temurin' java-version: '21' cache: 'maven' - - name: Start broker - run: ci/start-broker.sh - - name: Test (no dynamic-batch publishing) - run: | - ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ - -Drabbitmq.stream.producer.dynamic.batch=false \ - -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ - -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ - -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem - - name: Test (dynamic-batch publishing) - run: | - ./mvnw test -Drabbitmqctl.bin=DOCKER:rabbitmq \ - -Drabbitmq.stream.producer.dynamic.batch=true \ - -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ - -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ - -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem - - name: Stop broker - run: docker stop rabbitmq && docker rm rabbitmq +# - name: Start broker +# run: ci/start-broker.sh +# - name: Test (no dynamic-batch publishing) +# run: | +# ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ +# -Drabbitmq.stream.producer.dynamic.batch=false \ +# -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ +# -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ +# -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem +# - name: Test (dynamic-batch publishing) +# run: | +# ./mvnw test -Drabbitmqctl.bin=DOCKER:rabbitmq \ +# -Drabbitmq.stream.producer.dynamic.batch=true \ +# -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ +# -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ +# -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem +# - name: Stop broker +# run: docker stop rabbitmq && docker rm rabbitmq - name: Start cluster run: ci/start-cluster.sh - name: Test against cluster diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index ed7f908b65..3f7642cbec 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -742,7 +742,7 @@ static T locatorOperation( Function operation, Supplier clientSupplier, BackOffDelayPolicy backOffDelayPolicy) { - int maxAttempt = 5; + int maxAttempt = 3; int attempt = 0; boolean executed = false; Exception lastException = null; diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index 66f3514162..44a6a48f15 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -16,19 +16,21 @@ import static com.rabbitmq.stream.impl.Assertions.assertThat; import static com.rabbitmq.stream.impl.LoadBalancerClusterTest.LOAD_BALANCER_ADDRESS; +import static com.rabbitmq.stream.impl.TestUtils.newLoggerLevel; import static com.rabbitmq.stream.impl.TestUtils.sync; -import static io.vavr.Tuple.of; +import static com.rabbitmq.stream.impl.Tuples.pair; import static java.time.Duration.ofSeconds; import static java.util.stream.Collectors.toList; import static java.util.stream.IntStream.range; import static org.assertj.core.api.Assertions.assertThat; import ch.qos.logback.classic.Level; +import com.google.common.collect.Streams; import com.google.common.util.concurrent.RateLimiter; import com.rabbitmq.stream.*; import com.rabbitmq.stream.impl.TestUtils.Sync; +import com.rabbitmq.stream.impl.Tuples.Pair; import io.netty.channel.EventLoopGroup; -import io.vavr.Tuple2; import java.nio.charset.StandardCharsets; import java.time.Duration; import java.util.LinkedHashMap; @@ -58,13 +60,14 @@ public class RecoveryClusterTest { TestInfo testInfo; EventLoopGroup eventLoopGroup; EnvironmentBuilder environmentBuilder; - static Level producersCoordinatorLogLevel; + static List logLevels; + static List> logClasses = + List.of(ProducersCoordinator.class, ConsumersCoordinator.class, StreamEnvironment.class); @BeforeAll static void initAll() { nodes = Cli.nodes(); - producersCoordinatorLogLevel = - TestUtils.newLoggerLevel(ProducersCoordinator.class, Level.DEBUG); + logLevels = logClasses.stream().map(c -> newLoggerLevel(c, Level.DEBUG)).collect(toList()); } @BeforeEach @@ -88,15 +91,16 @@ void tearDown() { @AfterAll static void tearDownAll() { - if (producersCoordinatorLogLevel != null) { - TestUtils.newLoggerLevel(ProducersCoordinator.class, producersCoordinatorLogLevel); + if (logLevels != null) { + Streams.zip(logClasses.stream(), logLevels.stream(), Tuples::pair) + .forEach(t -> newLoggerLevel(t.v1(), t.v2())); } } @ParameterizedTest @CsvSource({ - "false,false", - "true,true", + // "false,false", + // "true,true", "true,false", }) void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws InterruptedException { @@ -167,17 +171,27 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru Thread.sleep(BACK_OFF_DELAY_POLICY.delay(0).multipliedBy(2).toMillis()); - List> streamsSyncs = - producers.stream().map(p -> of(p.stream(), p.waitForNewMessages(1000))).collect(toList()); + List> streamsSyncs = + producers.stream() + .map(p -> pair(p.stream(), p.waitForNewMessages(1000))) + .collect(toList()); streamsSyncs.forEach( - t -> { - LOGGER.info("Checking publisher to {} still publishes", t._1()); - assertThat(t._2()).completes(); - LOGGER.info("Publisher to {} still publishes", t._1()); + p -> { + LOGGER.info("Checking publisher to {} still publishes", p.v1()); + assertThat(p.v2()).completes(); + LOGGER.info("Publisher to {} still publishes", p.v1()); }); - syncs = consumers.stream().map(c -> c.waitForNewMessages(1000)).collect(toList()); - syncs.forEach(s -> assertThat(s).completes()); + streamsSyncs = + consumers.stream() + .map(c -> pair(c.stream(), c.waitForNewMessages(1000))) + .collect(toList()); + streamsSyncs.forEach( + p -> { + LOGGER.info("Checking consumer from {} still consumes", p.v1()); + assertThat(p.v2()).completes(); + LOGGER.info("Consumer from {} still consumes", p.v1()); + }); Map committedChunkIdPerStream = new LinkedHashMap<>(streamCount); streams.forEach( @@ -271,11 +285,13 @@ public void close() { private static class ConsumerState implements AutoCloseable { + private final String stream; private final Consumer consumer; final AtomicInteger receivedCount = new AtomicInteger(); final AtomicReference postHandle = new AtomicReference<>(() -> {}); private ConsumerState(String stream, Environment environment) { + this.stream = stream; this.consumer = environment.consumerBuilder().stream(stream) .offset(OffsetSpecification.first()) @@ -300,6 +316,10 @@ Sync waitForNewMessages(int messageCount) { return sync; } + String stream() { + return this.stream; + } + @Override public void close() { this.consumer.close(); diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java index 30b3da30bb..5724e0f6f9 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java @@ -245,7 +245,7 @@ void locatorOperationShouldThrowLocatorExceptionWhenRetryExhausts() { CLIENT_SUPPLIER, BackOffDelayPolicy.fixed(Duration.ofMillis(10)))) .isInstanceOf(LocatorNotAvailableException.class); - assertThat(counter).hasValue(5); + assertThat(counter).hasValue(3); } @Test From 5d1ecf2efe376afa0c1653ce26c55ac55c5b4f0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 29 Nov 2024 11:15:30 +0100 Subject: [PATCH 293/449] Add locator count setting --- .../stream/impl/StreamEnvironment.java | 23 +++++++++++++++---- .../stream/impl/StreamEnvironmentBuilder.java | 9 +++++++- .../stream/impl/RecoveryClusterTest.java | 1 + .../stream/impl/StreamConsumerTest.java | 3 +-- .../impl/StreamEnvironmentUnitTest.java | 9 +++++--- 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index 3f7642cbec..b8037eae8c 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -18,6 +18,7 @@ import static com.rabbitmq.stream.impl.Utils.*; import static java.lang.String.format; import static java.util.concurrent.TimeUnit.SECONDS; +import static java.util.stream.Collectors.toList; import com.rabbitmq.stream.*; import com.rabbitmq.stream.MessageHandler.Context; @@ -53,6 +54,7 @@ import java.util.function.LongSupplier; import java.util.function.Supplier; import java.util.stream.Collectors; +import java.util.stream.IntStream; import javax.net.ssl.SSLException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -81,7 +83,7 @@ class StreamEnvironment implements Environment { private final ByteBufAllocator byteBufAllocator; private final AtomicBoolean locatorsInitialized = new AtomicBoolean(false); private final Runnable locatorInitializationSequence; - private final List locators = new CopyOnWriteArrayList<>(); + private final List locators; private final ExecutorServiceFactory executorServiceFactory; private final ObservationCollector observationCollector; @@ -105,7 +107,8 @@ class StreamEnvironment implements Environment { boolean forceReplicaForConsumers, boolean forceLeaderForProducers, Duration producerNodeRetryDelay, - Duration consumerNodeRetryDelay) { + Duration consumerNodeRetryDelay, + int expectedLocatorCount) { this.recoveryBackOffDelayPolicy = recoveryBackOffDelayPolicy; this.topologyUpdateBackOffDelayPolicy = topologyBackOffDelayPolicy; this.byteBufAllocator = byteBufAllocator; @@ -147,7 +150,7 @@ class StreamEnvironment implements Environment { new Address( uriItem.getHost() == null ? "localhost" : uriItem.getHost(), uriItem.getPort() == -1 ? defaultPort : uriItem.getPort())) - .collect(Collectors.toList()); + .collect(toList()); } AddressResolver addressResolverToUse = addressResolver; @@ -179,7 +182,19 @@ class StreamEnvironment implements Environment { this.addressResolver = addressResolverToUse; - this.addresses.forEach(address -> this.locators.add(new Locator(address))); + int locatorCount = Math.max(this.addresses.size(), expectedLocatorCount); + LOGGER.debug("Using {} locator connection(s)", locatorCount); + + List lctrs = + IntStream.range(0, locatorCount) + .mapToObj( + i -> { + Address addr = this.addresses.get(i % this.addresses.size()); + return new Locator(addr); + }) + .collect(toList()); + this.locators = List.copyOf(lctrs); + this.executorServiceFactory = new DefaultExecutorServiceFactory( this.addresses.size(), 1, "rabbitmq-stream-locator-connection-"); diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java index 0ec0a9dca2..f17446e985 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java @@ -70,6 +70,7 @@ public class StreamEnvironmentBuilder implements EnvironmentBuilder { private ObservationCollector observationCollector = ObservationCollector.NO_OP; private Duration producerNodeRetryDelay = Duration.ofMillis(500); private Duration consumerNodeRetryDelay = Duration.ofMillis(1000); + private int locatorCount = 1; public StreamEnvironmentBuilder() {} @@ -315,6 +316,11 @@ StreamEnvironmentBuilder consumerNodeRetryDelay(Duration consumerNodeRetryDelay) return this; } + StreamEnvironmentBuilder locatorCount(int locatorCount) { + this.locatorCount = locatorCount; + return this; + } + @Override public Environment build() { if (this.compressionCodecFactory == null) { @@ -349,7 +355,8 @@ public Environment build() { this.forceReplicaForConsumers, this.forceLeaderForProducers, this.producerNodeRetryDelay, - this.consumerNodeRetryDelay); + this.consumerNodeRetryDelay, + this.locatorCount); } static final class DefaultTlsConfiguration implements TlsConfiguration { diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index 44a6a48f15..55767f8c79 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -115,6 +115,7 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru .addressResolver(addr -> LOAD_BALANCER_ADDRESS); Duration nodeRetryDelay = Duration.ofMillis(100); environmentBuilder.forceLeaderForProducers(forceLeader); + ((StreamEnvironmentBuilder) environmentBuilder).locatorCount(URIS.size()); // to make the test faster ((StreamEnvironmentBuilder) environmentBuilder).producerNodeRetryDelay(nodeRetryDelay); ((StreamEnvironmentBuilder) environmentBuilder).consumerNodeRetryDelay(nodeRetryDelay); diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java index 1feebe6081..be2dc4a8c3 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java @@ -475,8 +475,7 @@ void manualTrackingConsumerShouldRestartWhereItLeftOff() throws Exception { @Test @DisabledIfRabbitMqCtlNotSet - void consumerShouldReUseInitialOffsetSpecificationAfterDisruptionIfNoMessagesReceived() - throws Exception { + void consumerShouldReUseInitialOffsetSpecificationAfterDisruptionIfNoMessagesReceived() { int messageCountFirstWave = 10_000; Producer producer = environment.producerBuilder().stream(stream).build(); diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java index 5724e0f6f9..8a136fed46 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java @@ -101,7 +101,8 @@ Client.ClientParameters duplicate() { false, true, Duration.ofMillis(100), - Duration.ofMillis(100)); + Duration.ofMillis(100), + 1); } @AfterEach @@ -169,7 +170,8 @@ void shouldTryUrisOnInitializationFailure() throws Exception { false, true, Duration.ofMillis(100), - Duration.ofMillis(100)); + Duration.ofMillis(100), + 1); verify(cf, times(3)).apply(any(Client.ClientParameters.class)); } @@ -200,7 +202,8 @@ void shouldNotOpenConnectionWhenLazyInitIsEnabled( false, true, Duration.ofMillis(100), - Duration.ofMillis(100)); + Duration.ofMillis(100), + 1); verify(cf, times(expectedConnectionCreation)).apply(any(Client.ClientParameters.class)); } From f93c07cf6c17035a0ee88014f5dbcdd036c59072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 29 Nov 2024 11:52:54 +0100 Subject: [PATCH 294/449] Fix locator initialization --- .../com/rabbitmq/stream/impl/StreamEnvironment.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index b8037eae8c..53df31709a 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -245,8 +245,8 @@ class StreamEnvironment implements Environment { Runnable locatorInitSequence = () -> { RuntimeException lastException = null; - for (int i = 0; i < addresses.size(); i++) { - Address address = addresses.get(i); + for (int i = 0; i < locators.size(); i++) { + Address address = addresses.get(i % addresses.size()); Locator locator = locator(i); address = addressResolver.resolve(address); String connectionName = connectionNamingStrategy.apply(ClientConnectionType.LOCATOR); @@ -305,10 +305,10 @@ private ShutdownListener shutdownListener( Client.ShutdownListener shutdownListener = shutdownContext -> { if (shutdownContext.isShutdownUnexpected()) { + String label = locator.label(); locator.client(null); LOGGER.debug( - "Unexpected locator disconnection for locator on '{}', trying to reconnect", - locator.label()); + "Unexpected locator disconnection for locator on '{}', trying to reconnect", label); try { Client.ClientParameters newLocatorParameters = this.locatorParametersCopy().shutdownListener(shutdownListenerReference.get()); @@ -1006,7 +1006,9 @@ private String label() { if (c == null) { return address.host() + ":" + address.port(); } else { - return c.getHost() + ":" + c.getPort(); + return String.format( + "%s:%d [advertised %s:%d]", + c.getHost(), c.getPort(), c.serverAdvertisedHost(), c.serverAdvertisedPort()); } } From 742300108a14d3ba343bc4b6044f76c23bdeb0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 29 Nov 2024 12:03:07 +0100 Subject: [PATCH 295/449] Re-activate all recovery test cases --- .../java/com/rabbitmq/stream/impl/RecoveryClusterTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index 55767f8c79..b6476670fd 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -99,8 +99,8 @@ static void tearDownAll() { @ParameterizedTest @CsvSource({ - // "false,false", - // "true,true", + "false,false", + "true,true", "true,false", }) void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws InterruptedException { From e07cd048dbd356e0123afcdaad5103aa97fa50fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 29 Nov 2024 13:07:27 +0100 Subject: [PATCH 296/449] Re-activate all tests --- .github/workflows/test-pr.yml | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index cd6b55be74..380db0602c 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -22,24 +22,24 @@ jobs: distribution: 'temurin' java-version: '21' cache: 'maven' -# - name: Start broker -# run: ci/start-broker.sh -# - name: Test (no dynamic-batch publishing) -# run: | -# ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ -# -Drabbitmq.stream.producer.dynamic.batch=false \ -# -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -# -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ -# -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem -# - name: Test (dynamic-batch publishing) -# run: | -# ./mvnw test -Drabbitmqctl.bin=DOCKER:rabbitmq \ -# -Drabbitmq.stream.producer.dynamic.batch=true \ -# -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -# -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ -# -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem -# - name: Stop broker -# run: docker stop rabbitmq && docker rm rabbitmq + - name: Start broker + run: ci/start-broker.sh + - name: Test (no dynamic-batch publishing) + run: | + ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + -Drabbitmq.stream.producer.dynamic.batch=false \ + -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ + -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ + -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem + - name: Test (dynamic-batch publishing) + run: | + ./mvnw test -Drabbitmqctl.bin=DOCKER:rabbitmq \ + -Drabbitmq.stream.producer.dynamic.batch=true \ + -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ + -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ + -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem + - name: Stop broker + run: docker stop rabbitmq && docker rm rabbitmq - name: Start cluster run: ci/start-cluster.sh - name: Test against cluster From 69c14d27f3b9fd4d0ab5b7ba6b0741fbadccd2d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 29 Nov 2024 16:26:49 +0100 Subject: [PATCH 297/449] Document locator connection count setting --- src/docs/asciidoc/api.adoc | 10 ++++++- .../rabbitmq/stream/EnvironmentBuilder.java | 30 +++++++++++++++++-- .../stream/impl/StreamEnvironment.java | 7 ++++- .../stream/impl/StreamEnvironmentBuilder.java | 9 +++--- .../stream/docs/EnvironmentUsage.java | 1 + .../stream/impl/RecoveryClusterTest.java | 6 ++-- 6 files changed, 51 insertions(+), 12 deletions(-) diff --git a/src/docs/asciidoc/api.adoc b/src/docs/asciidoc/api.adoc index 30af7553cd..c075f91453 100644 --- a/src/docs/asciidoc/api.adoc +++ b/src/docs/asciidoc/api.adoc @@ -234,6 +234,10 @@ Used as a prefix for connection names. |Contract to change resolved node address to connect to. |Pass-through (no-op) +|`locatorConnectionCount` +|Number of locator connections to maintain (for metadata search) +|The smaller of the number of URIs and 3. + |`tls` |Configuration helper for TLS. |TLS is enabled if a `rabbitmq-stream+tls` URI is provided. @@ -293,8 +297,12 @@ include::{test-examples}/EnvironmentUsage.java[tag=address-resolver] <1> Set the load balancer address <2> Use load balancer address for initial connection <3> Ignore metadata hints, always use load balancer +<4> Set the number of locator connections to maintain -The blog post covers the https://www.rabbitmq.com/blog/2021/07/23/connecting-to-streams/#client-workaround-with-a-load-balancer[underlying details of this workaround]. +Note the example above sets the number of locator connections the environment maintains. +Locator connections are used to perform infrastructure-related operations (e.g. looking up the topology of a stream to find an appropriate node to connect to). +The environment uses the number of passed-in URIs to choose an appropriate default number and will pick 1 in this case, which may be too low for a cluster deployment. +This is why it is recommended to set the value explicitly, 3 being a good default. ==== Managing Streams diff --git a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java index 64010d4d51..c5c5d3b624 100644 --- a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java @@ -16,6 +16,7 @@ import com.rabbitmq.stream.compression.Compression; import com.rabbitmq.stream.compression.CompressionCodecFactory; +import com.rabbitmq.stream.impl.StreamEnvironmentBuilder; import com.rabbitmq.stream.metrics.MetricsCollector; import com.rabbitmq.stream.sasl.CredentialsProvider; import com.rabbitmq.stream.sasl.SaslConfiguration; @@ -62,14 +63,15 @@ public interface EnvironmentBuilder { * An {@link AddressResolver} to potentially change resolved node address to connect to. * *

Applications can use this abstraction to make sure connection attempts ignore metadata hints - * and always go to a single point like a load balancer. + * and always go to a single point like a load balancer. Consider setting {@link + * #locatorConnectionCount(int)} when using a load balancer. * *

The default implementation does not perform any logic, it just returns the passed-in * address. * *

The default implementation is overridden automatically if the following conditions are * met: the host to connect to is localhost, the user is guest, and no - * address resolver has been provided. The client will then always tries to connect to + * address resolver has been provided. The client will then always try to connect to * localhost to facilitate local development. Just provide a pass-through address resolver * to avoid this behavior, e.g.: * @@ -79,10 +81,11 @@ public interface EnvironmentBuilder { * .build(); * * - * @param addressResolver + * @param addressResolver the address resolver * @return this builder instance * @see "Connecting to * Streams" blog post + * @see #locatorConnectionCount(int) */ EnvironmentBuilder addressResolver(AddressResolver addressResolver); @@ -395,6 +398,27 @@ EnvironmentBuilder topologyUpdateBackOffDelayPolicy( */ EnvironmentBuilder forceLeaderForProducers(boolean forceLeader); + /** + * Set the expected number of "locator" connections to maintain. + * + *

Locator connections are used to perform infrastructure-related operations (e.g. looking up + * the topology of a stream to find an appropriate node to connect to). + * + *

It is recommended to maintain 2 to 3 locator connections. The environment uses the smaller + * of the number of passed-in URIs and 3 by default (see {@link #uris(List)}). + * + *

The number of locator connections should be explicitly set when a load balancer is used, as + * the environment cannot know the number of cluster nodes in this case (the only URI set is the + * one of the load balancer). + * + * @param locatorConnectionCount number of expected locator connections + * @return this builder instance + * @see #uris(List) + * @see #addressResolver(AddressResolver) + * @since 0.21.0 + */ + StreamEnvironmentBuilder locatorConnectionCount(int locatorConnectionCount); + /** * Create the {@link Environment} instance. * diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index 53df31709a..c817b1c33d 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -182,7 +182,12 @@ class StreamEnvironment implements Environment { this.addressResolver = addressResolverToUse; - int locatorCount = Math.max(this.addresses.size(), expectedLocatorCount); + int locatorCount; + if (expectedLocatorCount > 0) { + locatorCount = expectedLocatorCount; + } else { + locatorCount = Math.min(this.addresses.size(), 3); + } LOGGER.debug("Using {} locator connection(s)", locatorCount); List lctrs = diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java index f17446e985..0386ec79cd 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java @@ -70,7 +70,7 @@ public class StreamEnvironmentBuilder implements EnvironmentBuilder { private ObservationCollector observationCollector = ObservationCollector.NO_OP; private Duration producerNodeRetryDelay = Duration.ofMillis(500); private Duration consumerNodeRetryDelay = Duration.ofMillis(1000); - private int locatorCount = 1; + private int locatorConnectionCount = -1; public StreamEnvironmentBuilder() {} @@ -316,8 +316,9 @@ StreamEnvironmentBuilder consumerNodeRetryDelay(Duration consumerNodeRetryDelay) return this; } - StreamEnvironmentBuilder locatorCount(int locatorCount) { - this.locatorCount = locatorCount; + @Override + public StreamEnvironmentBuilder locatorConnectionCount(int locatorCount) { + this.locatorConnectionCount = locatorCount; return this; } @@ -356,7 +357,7 @@ public Environment build() { this.forceLeaderForProducers, this.producerNodeRetryDelay, this.consumerNodeRetryDelay, - this.locatorCount); + this.locatorConnectionCount); } static final class DefaultTlsConfiguration implements TlsConfiguration { diff --git a/src/test/java/com/rabbitmq/stream/docs/EnvironmentUsage.java b/src/test/java/com/rabbitmq/stream/docs/EnvironmentUsage.java index 72a32daa10..d42e6662e4 100644 --- a/src/test/java/com/rabbitmq/stream/docs/EnvironmentUsage.java +++ b/src/test/java/com/rabbitmq/stream/docs/EnvironmentUsage.java @@ -97,6 +97,7 @@ void addressResolver() throws Exception { .host(entryPoint.host()) // <2> .port(entryPoint.port()) // <2> .addressResolver(address -> entryPoint) // <3> + .locatorConnectionCount(3) // <4> .build(); // end::address-resolver[] } diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index b6476670fd..da098188c5 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -112,10 +112,10 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru environmentBuilder .host(LOAD_BALANCER_ADDRESS.host()) .port(LOAD_BALANCER_ADDRESS.port()) - .addressResolver(addr -> LOAD_BALANCER_ADDRESS); + .addressResolver(addr -> LOAD_BALANCER_ADDRESS) + .forceLeaderForProducers(forceLeader) + .locatorConnectionCount(URIS.size()); Duration nodeRetryDelay = Duration.ofMillis(100); - environmentBuilder.forceLeaderForProducers(forceLeader); - ((StreamEnvironmentBuilder) environmentBuilder).locatorCount(URIS.size()); // to make the test faster ((StreamEnvironmentBuilder) environmentBuilder).producerNodeRetryDelay(nodeRetryDelay); ((StreamEnvironmentBuilder) environmentBuilder).consumerNodeRetryDelay(nodeRetryDelay); From 3784060f349a554be977bdaaffe9e813b1d4e972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 29 Nov 2024 16:44:40 +0100 Subject: [PATCH 298/449] Fix test --- .../com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java index 8a136fed46..6052e1fee8 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java @@ -102,7 +102,7 @@ Client.ClientParameters duplicate() { true, Duration.ofMillis(100), Duration.ofMillis(100), - 1); + -1); } @AfterEach @@ -171,7 +171,7 @@ void shouldTryUrisOnInitializationFailure() throws Exception { true, Duration.ofMillis(100), Duration.ofMillis(100), - 1); + -1); verify(cf, times(3)).apply(any(Client.ClientParameters.class)); } @@ -203,7 +203,7 @@ void shouldNotOpenConnectionWhenLazyInitIsEnabled( true, Duration.ofMillis(100), Duration.ofMillis(100), - 1); + -1); verify(cf, times(expectedConnectionCreation)).apply(any(Client.ClientParameters.class)); } From 3a0056a9663a186495b47769189df7251b266d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 29 Nov 2024 16:59:28 +0100 Subject: [PATCH 299/449] Improve deduplication Javadoc --- src/main/java/com/rabbitmq/stream/Message.java | 14 +++++++++++--- .../java/com/rabbitmq/stream/MessageBuilder.java | 8 ++++++-- .../java/com/rabbitmq/stream/ProducerBuilder.java | 10 ++++++++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/Message.java b/src/main/java/com/rabbitmq/stream/Message.java index 06757f4755..1c7a851b24 100644 --- a/src/main/java/com/rabbitmq/stream/Message.java +++ b/src/main/java/com/rabbitmq/stream/Message.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -32,18 +32,26 @@ public interface Message { /** * Does this message has a publishing ID? * - *

Publishing IDs are used for de-duplication of outbound messages. They are not persisted. + *

Publishing IDs are used for deduplication of outbound messages. They are not persisted. * * @return true if the message has a publishing ID, false otherwise + * @see ProducerBuilder#name(String) + * @see Deduplication + * documentation */ boolean hasPublishingId(); /** * Get the publishing ID for the message. * - *

Publishing IDs are used for de-duplication of outbound messages. They are not persisted. + *

Publishing IDs are used for deduplication of outbound messages. They are not persisted. * * @return the publishing ID of the message + * @see ProducerBuilder#name(String) + * @see Deduplication + * documentation */ long getPublishingId(); diff --git a/src/main/java/com/rabbitmq/stream/MessageBuilder.java b/src/main/java/com/rabbitmq/stream/MessageBuilder.java index 908cc78534..5528a1f1d2 100644 --- a/src/main/java/com/rabbitmq/stream/MessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/MessageBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -38,12 +38,16 @@ public interface MessageBuilder { Message build(); /** - * Set the publishing ID (for de-duplication). + * Set the publishing ID (for deduplication). * *

This is value is used only for outbound messages and is not persisted. * * @param publishingId * @return this builder instance + * @see ProducerBuilder#name(String) + * @see Deduplication + * documentation */ MessageBuilder publishingId(long publishingId); diff --git a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java index 02d6f48274..dca01baf9f 100644 --- a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java @@ -23,12 +23,18 @@ public interface ProducerBuilder { /** - * The logical name of the producer. + * The producer name for deduplication (read the documentation + * before use). * - *

Set a value to enable de-duplication. + *

There must be only one producer instance at the same time using a given name. * * @param name * @return this builder instance + * @see MessageBuilder#publishingId(long) + * @see Deduplication + * documentation */ ProducerBuilder name(String name); From f8619f0dbb724c7a16882c901444fa48fadf44d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 9 Dec 2024 09:49:23 +0100 Subject: [PATCH 300/449] Increase number of scheduling threads in test --- .../stream/impl/RecoveryClusterTest.java | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index da098188c5..c85311bb70 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -37,6 +37,8 @@ import java.util.List; import java.util.Map; import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; @@ -62,7 +64,12 @@ public class RecoveryClusterTest { EnvironmentBuilder environmentBuilder; static List logLevels; static List> logClasses = - List.of(ProducersCoordinator.class, ConsumersCoordinator.class, StreamEnvironment.class); + List.of( + ProducersCoordinator.class, + ConsumersCoordinator.class, + StreamEnvironment.class, + AsyncRetry.class); + ScheduledExecutorService scheduledExecutorService; @BeforeAll static void initAll() { @@ -72,10 +79,17 @@ static void initAll() { @BeforeEach void init(TestInfo info) { + int availableProcessors = Runtime.getRuntime().availableProcessors(); + LOGGER.info("Available processors: {}", availableProcessors); + ThreadFactory threadFactory = + new Utils.NamedThreadFactory("rabbitmq-stream-environment-scheduler-"); + scheduledExecutorService = + Executors.newScheduledThreadPool(availableProcessors * 2, threadFactory); environmentBuilder = Environment.builder() .recoveryBackOffDelayPolicy(BACK_OFF_DELAY_POLICY) .topologyUpdateBackOffDelayPolicy(BACK_OFF_DELAY_POLICY) + .scheduledExecutorService(scheduledExecutorService) .netty() .eventLoopGroup(eventLoopGroup) .environmentBuilder(); @@ -87,6 +101,9 @@ void tearDown() { if (environment != null) { environment.close(); } + if (scheduledExecutorService != null) { + scheduledExecutorService.shutdownNow(); + } } @AfterAll @@ -104,6 +121,10 @@ static void tearDownAll() { "true,false", }) void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws InterruptedException { + LOGGER.info( + "Cluster restart test, use load balancer {}, force leader {}", + useLoadBalancer, + forceLeader); int streamCount = 10; int producerCount = streamCount * 2; int consumerCount = streamCount * 2; From 4a723fa1232f4fe9b2310de72bc7d2b8bdbbeea0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 16:24:00 +0000 Subject: [PATCH 301/449] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.1 to 3.11.2 Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.11.1 to 3.11.2. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.11.1...maven-javadoc-plugin-3.11.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c59e4fffca..d5b1fcb1cf 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 3.2.1 3.3.1 3.3.1 - 3.11.1 + 3.11.2 3.4.2 3.4.0 3.1.1 From cca3b4326fbe5499bde65aec5e5a9a57730cf899 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:28:02 +0000 Subject: [PATCH 302/449] Bump com.google.googlejavaformat:google-java-format Bumps [com.google.googlejavaformat:google-java-format](https://github.com/google/google-java-format) from 1.25.0 to 1.25.1. - [Release notes](https://github.com/google/google-java-format/releases) - [Commits](https://github.com/google/google-java-format/compare/v1.25.0...v1.25.1) --- updated-dependencies: - dependency-name: com.google.googlejavaformat:google-java-format dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d5b1fcb1cf..3c1e24d1c3 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 3.2.1 1.37 2.43.0 - 1.25.0 + 1.25.1 0.8.12 4.8.6.6 4.8.6 From 86b49e4a2e65fa50504194c550470106fbcb911c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:28:11 +0000 Subject: [PATCH 303/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.4.0 to 1.4.1. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.4.0...v1.4.1) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d5b1fcb1cf..119d0c07ce 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.11.0 0.10.5 1.2.5 - 1.4.0 + 1.4.1 1.0.4 3.13.0 3.5.2 From bba57edd3da85ad9de99a7f8ddd8a0cb1f6b7b1a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 16:28:19 +0000 Subject: [PATCH 304/449] Bump io.micrometer:micrometer-core from 1.14.1 to 1.14.2 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.14.1 to 1.14.2. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.14.1...v1.14.2) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d5b1fcb1cf..429e395c97 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.115.Final 0.34.1 4.2.29 - 1.14.1 + 1.14.2 12.2.2 4.7.5 1.27.1 From b8e6d81706f1b7d1f14c4261774e7979b84a53ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 11 Dec 2024 14:37:02 +0100 Subject: [PATCH 305/449] Check null for exception cause References #630 --- .../com/rabbitmq/stream/impl/ThreadUtils.java | 140 ++++++++++++++++++ .../java/com/rabbitmq/stream/impl/Utils.java | 44 ++---- 2 files changed, 155 insertions(+), 29 deletions(-) create mode 100644 src/main/java/com/rabbitmq/stream/impl/ThreadUtils.java diff --git a/src/main/java/com/rabbitmq/stream/impl/ThreadUtils.java b/src/main/java/com/rabbitmq/stream/impl/ThreadUtils.java new file mode 100644 index 0000000000..813daf8365 --- /dev/null +++ b/src/main/java/com/rabbitmq/stream/impl/ThreadUtils.java @@ -0,0 +1,140 @@ +// Copyright (c) 2024 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.impl; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicLong; +import java.util.function.Function; +import java.util.function.Predicate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +final class ThreadUtils { + + private static final Logger LOGGER = LoggerFactory.getLogger(ThreadUtils.class); + + private static final ThreadFactory THREAD_FACTORY; + private static final Function EXECUTOR_SERVICE_FACTORY; + private static final Predicate IS_VIRTUAL; + + static { + if (isJava21OrMore()) { + LOGGER.debug("Running Java 21 or more, using virtual threads"); + Class builderClass = + Arrays.stream(Thread.class.getDeclaredClasses()) + .filter(c -> "Builder".equals(c.getSimpleName())) + .findFirst() + .get(); + // Reflection code is the same as: + // Thread.ofVirtual().factory(); + try { + Object builder = Thread.class.getDeclaredMethod("ofVirtual").invoke(null); + THREAD_FACTORY = (ThreadFactory) builderClass.getDeclaredMethod("factory").invoke(builder); + } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { + throw new RuntimeException(e); + } + EXECUTOR_SERVICE_FACTORY = + prefix -> { + try { + // Reflection code is the same as the 2 following lines: + // ThreadFactory factory = Thread.ofVirtual().name(prefix, 0).factory(); + // Executors.newThreadPerTaskExecutor(factory); + Object builder = Thread.class.getDeclaredMethod("ofVirtual").invoke(null); + if (prefix != null) { + builder = + builderClass + .getDeclaredMethod("name", String.class, Long.TYPE) + .invoke(builder, prefix, 0L); + } + ThreadFactory factory = + (ThreadFactory) builderClass.getDeclaredMethod("factory").invoke(builder); + return (ExecutorService) + Executors.class + .getDeclaredMethod("newThreadPerTaskExecutor", ThreadFactory.class) + .invoke(null, factory); + } catch (IllegalAccessException | InvocationTargetException | NoSuchMethodException e) { + throw new RuntimeException(e); + } + }; + IS_VIRTUAL = + thread -> { + Method method = null; + try { + method = Thread.class.getDeclaredMethod("isVirtual"); + return (boolean) method.invoke(thread); + } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { + LOGGER.info("Error while checking if a thread is virtual: {}", e.getMessage()); + return false; + } + }; + } else { + THREAD_FACTORY = Executors.defaultThreadFactory(); + EXECUTOR_SERVICE_FACTORY = prefix -> Executors.newCachedThreadPool(threadFactory(prefix)); + IS_VIRTUAL = ignored -> false; + } + } + + private ThreadUtils() {} + + static ThreadFactory threadFactory(String prefix) { + if (prefix == null) { + return Executors.defaultThreadFactory(); + } else { + return new NamedThreadFactory(prefix); + } + } + + static ThreadFactory internalThreadFactory(String prefix) { + return new NamedThreadFactory(THREAD_FACTORY, prefix); + } + + static boolean isVirtual(Thread thread) { + return IS_VIRTUAL.test(thread); + } + + private static boolean isJava21OrMore() { + return Runtime.version().compareTo(Runtime.Version.parse("21")) >= 0; + } + + private static class NamedThreadFactory implements ThreadFactory { + + private final ThreadFactory backingThreadFactory; + + private final String prefix; + + private final AtomicLong count = new AtomicLong(0); + + private NamedThreadFactory(String prefix) { + this(Executors.defaultThreadFactory(), prefix); + } + + private NamedThreadFactory(ThreadFactory backingThreadFactory, String prefix) { + this.backingThreadFactory = backingThreadFactory; + this.prefix = prefix; + } + + @Override + public Thread newThread(Runnable r) { + Thread thread = this.backingThreadFactory.newThread(r); + thread.setName(prefix + count.getAndIncrement()); + return thread; + } + } +} diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index ab03ae71e3..92c6338ab8 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -28,9 +28,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; import java.util.concurrent.Future; -import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; @@ -160,8 +158,12 @@ static ClientFactory coordinatorClientFactory( return Utils.connectToAdvertisedNodeClientFactory(delegate, retryInterval) .client(clientFactoryContext); } catch (TimeoutStreamException e) { - throw new TimeoutStreamException( - format(messageFormat, e.getMessage(), e.getCause().getMessage(), e.getCause())); + if (e.getCause() == null) { + throw new TimeoutStreamException(format(messageFormat, e.getMessage(), "No root cause")); + } else { + throw new TimeoutStreamException( + format(messageFormat, e.getMessage(), e.getCause().getMessage()), e.getCause()); + } } catch (StreamException e) { if (e.getCause() != null && (e.getCause() instanceof UnknownHostException @@ -552,31 +554,6 @@ static String jsonField(String name, String value) { return quote(name) + " : " + quote(value); } - static class NamedThreadFactory implements ThreadFactory { - - private final ThreadFactory backingThreaFactory; - - private final String prefix; - - private final AtomicLong count = new AtomicLong(0); - - public NamedThreadFactory(String prefix) { - this(Executors.defaultThreadFactory(), prefix); - } - - public NamedThreadFactory(ThreadFactory backingThreadFactory, String prefix) { - this.backingThreaFactory = backingThreadFactory; - this.prefix = prefix; - } - - @Override - public Thread newThread(Runnable r) { - Thread thread = this.backingThreaFactory.newThread(r); - thread.setName(prefix + count.getAndIncrement()); - return thread; - } - } - static final ExecutorServiceFactory NO_OP_EXECUTOR_SERVICE_FACTORY = new NoOpExecutorServiceFactory(); @@ -678,6 +655,15 @@ boolean get() { } } + static void lock(Lock lock, Runnable action) { + lock( + lock, + () -> { + action.run(); + return null; + }); + } + static T lock(Lock lock, Supplier action) { lock.lock(); try { From ad12fd82f5608d63aec6da9ecf8c9024794ef7eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 11 Dec 2024 14:37:40 +0100 Subject: [PATCH 306/449] Improve recovery Extra debug logging, adapt recovery delay for cluster tests. --- ci/start-broker.sh | 1 + pom.xml | 8 +- .../com/rabbitmq/stream/impl/AsyncRetry.java | 11 +- .../java/com/rabbitmq/stream/impl/Client.java | 13 +- .../stream/impl/ConsumersCoordinator.java | 473 ++++++++++-------- .../impl/DefaultExecutorServiceFactory.java | 7 +- .../impl/ScheduledExecutorServiceWrapper.java | 9 +- .../rabbitmq/stream/impl/StreamConsumer.java | 19 +- .../stream/impl/StreamEnvironment.java | 168 ++++--- src/test/java/com/rabbitmq/stream/Cli.java | 4 + .../com/rabbitmq/stream/impl/Assertions.java | 4 +- .../rabbitmq/stream/impl/AsyncRetryTest.java | 48 +- .../com/rabbitmq/stream/impl/ClientTest.java | 9 +- .../stream/impl/ConsumersCoordinatorTest.java | 4 +- .../stream/impl/LoadBalancerClusterTest.java | 4 +- .../stream/impl/ProducersCoordinatorTest.java | 5 +- .../stream/impl/RecoveryClusterTest.java | 80 ++- .../impl/StreamEnvironmentUnitTest.java | 9 +- .../com/rabbitmq/stream/impl/TestUtils.java | 14 + 19 files changed, 546 insertions(+), 344 deletions(-) diff --git a/ci/start-broker.sh b/ci/start-broker.sh index d2887c4f81..c13c83ce3f 100755 --- a/ci/start-broker.sh +++ b/ci/start-broker.sh @@ -14,6 +14,7 @@ wait_for_message() { make -C "${PWD}"/tls-gen/basic +rm -rf rabbitmq-configuration mkdir -p rabbitmq-configuration/tls cp -R "${PWD}"/tls-gen/basic/result/* rabbitmq-configuration/tls chmod o+r rabbitmq-configuration/tls/* diff --git a/pom.xml b/pom.xml index c69622eac0..9401c07fc3 100644 --- a/pom.xml +++ b/pom.xml @@ -78,6 +78,7 @@ 3.2.7 3.2.1 3.3.1 + 3.4.0 3.3.1 3.11.2 3.4.2 @@ -100,7 +101,6 @@ UTF-8 0.0.6 1.7.0 - true true @@ -356,6 +356,12 @@ + + org.apache.maven.plugins + maven-clean-plugin + ${maven-clean-plugin.version} + + org.apache.maven.plugins maven-dependency-plugin diff --git a/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java b/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java index 0354988996..bd8a862e41 100644 --- a/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java +++ b/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -14,6 +14,7 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; +import static com.rabbitmq.stream.impl.ThreadUtils.isVirtual; import static com.rabbitmq.stream.impl.Utils.namedRunnable; import com.rabbitmq.stream.BackOffDelayPolicy; @@ -53,11 +54,19 @@ private AsyncRetry( return; } try { + LOGGER.debug( + "Running task '{}' (virtual threads: {})", + description, + isVirtual(Thread.currentThread())); V result = task.call(); LOGGER.debug("Task '{}' succeeded, completing future", description); completableFuture.complete(result); } catch (Exception e) { int attemptCount = attempts.getAndIncrement(); + LOGGER.debug( + "Attempt {} for task '{}' failed, checking retry policy", + attemptCount, + description); if (retry.test(e)) { if (delayPolicy.delay(attemptCount).equals(BackOffDelayPolicy.TIMEOUT)) { LOGGER.debug( diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 4c4ed887a8..c239f15cd1 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -15,6 +15,7 @@ package com.rabbitmq.stream.impl; import static com.rabbitmq.stream.Constants.*; +import static com.rabbitmq.stream.impl.ThreadUtils.threadFactory; import static com.rabbitmq.stream.impl.Utils.DEFAULT_USERNAME; import static com.rabbitmq.stream.impl.Utils.encodeRequestCode; import static com.rabbitmq.stream.impl.Utils.encodeResponseCode; @@ -45,7 +46,6 @@ import com.rabbitmq.stream.impl.Client.ShutdownContext.ShutdownReason; import com.rabbitmq.stream.impl.ServerFrameHandler.FrameHandler; import com.rabbitmq.stream.impl.ServerFrameHandler.FrameHandlerInfo; -import com.rabbitmq.stream.impl.Utils.NamedThreadFactory; import com.rabbitmq.stream.metrics.MetricsCollector; import com.rabbitmq.stream.metrics.NoOpMetricsCollector; import com.rabbitmq.stream.sasl.CredentialsProvider; @@ -164,7 +164,7 @@ public class Client implements AutoCloseable { final CompressionCodecFactory compressionCodecFactory; private final Consumer shutdownListenerCallback; private final ToLongFunction publishSequenceFunction = - new ToLongFunction() { + new ToLongFunction<>() { private final AtomicLong publishSequence = new AtomicLong(0); @Override @@ -302,6 +302,7 @@ public void initChannel(SocketChannel ch) { } }); + this.nettyClosing = Utils.makeIdempotent(this::closeNetty); ChannelFuture f; String clientConnectionName = parameters.clientProperties.getOrDefault("connection_name", ""); try { @@ -326,13 +327,11 @@ public void initChannel(SocketChannel ch) { throw new StreamException(message, e); } } - this.channel = f.channel(); - this.nettyClosing = Utils.makeIdempotent(this::closeNetty); ExecutorServiceFactory executorServiceFactory = parameters.executorServiceFactory; if (executorServiceFactory == null) { this.executorService = - Executors.newSingleThreadExecutor(new NamedThreadFactory(clientConnectionName + "-")); + Executors.newSingleThreadExecutor(threadFactory(clientConnectionName + "-")); } else { this.executorService = executorServiceFactory.get(); } @@ -341,7 +340,7 @@ public void initChannel(SocketChannel ch) { if (dispatchingExecutorServiceFactory == null) { this.dispatchingExecutorService = Executors.newSingleThreadExecutor( - new NamedThreadFactory("dispatching-" + clientConnectionName + "-")); + threadFactory("dispatching-" + clientConnectionName + "-")); } else { this.dispatchingExecutorService = dispatchingExecutorServiceFactory.get(); } @@ -1443,7 +1442,7 @@ void closingSequence(ShutdownContext.ShutdownReason reason) { private void closeNetty() { try { - if (this.channel.isOpen()) { + if (this.channel != null && this.channel.isOpen()) { LOGGER.debug("Closing Netty channel"); this.channel.close().get(10, TimeUnit.SECONDS); } diff --git a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java index d60f4ff943..fbbf2918fe 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java @@ -196,9 +196,8 @@ private void addToManager( try { pickedManager.add(tracker, offsetSpecification, isInitialSubscription); LOGGER.debug( - "Assigned tracker {} (stream '{}') to manager {} (node {}), subscription ID {}", - tracker.id, - tracker.stream, + "Assigned tracker {} to manager {} (node {}), subscription ID {}", + tracker.label(), pickedManager.id, pickedManager.name, tracker.subscriptionIdInClient); @@ -351,6 +350,7 @@ public String toString() { t -> { StringBuilder trackerBuilder = new StringBuilder("{"); trackerBuilder.append(jsonField("stream", t.stream)).append(","); + trackerBuilder.append(jsonField("id", t.id)).append(","); trackerBuilder.append( jsonField("subscription_id", t.subscriptionIdInClient)); return trackerBuilder.append("}").toString(); @@ -415,6 +415,7 @@ private static class SubscriptionTracker { private volatile AtomicReference state = new AtomicReference<>(SubscriptionState.OPENING); private final ConsumerFlowStrategy flowStrategy; + private final Lock subscriptionTrackerLock = new ReentrantLock(); private SubscriptionTracker( long id, @@ -447,36 +448,49 @@ private SubscriptionTracker( } } - synchronized void cancel() { - // the flow of messages in the user message handler should stop, we can call the tracking - // closing callback - // with automatic offset tracking, it will store the last dispatched offset - LOGGER.debug("Calling tracking consumer closing callback (may be no-op)"); - this.trackingClosingCallback.run(); - if (this.manager != null) { - LOGGER.debug("Removing consumer from manager " + this.consumer); - this.manager.remove(this); - } else { - LOGGER.debug("No manager to remove consumer from"); - } - this.state(SubscriptionState.CLOSED); + void cancel() { + lock( + this.subscriptionTrackerLock, + () -> { + // the flow of messages in the user message handler should stop, we can call the + // tracking + // closing callback + // with automatic offset tracking, it will store the last dispatched offset + LOGGER.debug("Calling tracking consumer closing callback (may be no-op)"); + this.trackingClosingCallback.run(); + if (this.manager != null) { + LOGGER.debug("Removing tracker {} from manager", this.label()); + this.manager.remove(this); + } else { + LOGGER.debug("No manager to remove consumer from"); + } + this.state(SubscriptionState.CLOSED); + }); } - synchronized void assign(byte subscriptionIdInClient, ClientSubscriptionsManager manager) { - this.subscriptionIdInClient = subscriptionIdInClient; - this.manager = manager; - if (this.manager == null) { - if (consumer != null) { - this.consumer.setSubscriptionClient(null); - } - } else { - this.consumer.setSubscriptionClient(this.manager.client); - } + void assign(byte subscriptionIdInClient, ClientSubscriptionsManager manager) { + lock( + this.subscriptionTrackerLock, + () -> { + this.subscriptionIdInClient = subscriptionIdInClient; + this.manager = manager; + if (this.manager == null) { + if (consumer != null) { + this.consumer.setSubscriptionClient(null); + } + } else { + this.consumer.setSubscriptionClient(this.manager.client); + } + }); } - synchronized void detachFromManager() { - this.manager = null; - this.consumer.setSubscriptionClient(null); + void detachFromManager() { + lock( + this.subscriptionTrackerLock, + () -> { + this.manager = null; + this.consumer.setSubscriptionClient(null); + }); } void state(SubscriptionState state) { @@ -490,6 +504,11 @@ boolean compareAndSet(SubscriptionState expected, SubscriptionState newValue) { SubscriptionState state() { return this.state.get(); } + + String label() { + return String.format( + "[id=%d, stream=%s, consumer=%d]", this.id, this.stream, this.consumer.id()); + } } private enum SubscriptionState { @@ -577,6 +596,7 @@ private class ClientSubscriptionsManager implements Comparable affectedSubscriptions; - synchronized (this) { + + this.subscriptionManagerLock.lock(); + try { Set subscriptions = streamToStreamSubscriptions.remove(stream); if (subscriptions != null && !subscriptions.isEmpty()) { List newSubscriptions = createSubscriptionTrackerList(); @@ -734,8 +756,9 @@ private ClientSubscriptionsManager( } for (SubscriptionTracker subscription : subscriptions) { LOGGER.debug( - "Subscription {} was at offset {} (received something? {})", + "Subscription {} ({}) was at offset {} (received something? {})", subscription.subscriptionIdInClient, + subscription.label(), subscription.offset, subscription.hasReceivedSomething); newSubscriptions.set(subscription.subscriptionIdInClient & 0xFF, null); @@ -744,6 +767,8 @@ private ClientSubscriptionsManager( this.setSubscriptionTrackers(newSubscriptions); } affectedSubscriptions = subscriptions; + } finally { + this.subscriptionManagerLock.unlock(); } if (affectedSubscriptions != null && !affectedSubscriptions.isEmpty()) { @@ -880,16 +905,14 @@ private void maybeRecoverSubscription( recoverSubscription(candidates, tracker); } catch (Exception e) { LOGGER.warn( - "Error while recovering consumer {} from stream '{}'. Reason: {}", - tracker.consumer.id(), - tracker.stream, + "Error while recovering consumer tracker {}. Reason: {}", + tracker.label(), Utils.exceptionMessage(e)); } } else { LOGGER.debug( - "Not recovering consumer {} from stream {}, state is {}, expected is {}", - tracker.consumer.id(), - tracker.stream, + "Not recovering consumer tracker {}, state is {}, expected is {}", + tracker.label(), tracker.state(), SubscriptionState.ACTIVE); } @@ -902,7 +925,8 @@ private void recoverSubscription(List candidates, SubscriptionTra if (tracker.consumer.isOpen()) { Broker broker = pickBroker(brokerPicker, candidates); LOGGER.debug("Using {} to resume consuming from {}", broker, tracker.stream); - synchronized (tracker.consumer) { + tracker.consumer.lock(); + try { if (tracker.consumer.isOpen()) { OffsetSpecification offsetSpecification; if (tracker.hasReceivedSomething) { @@ -912,6 +936,8 @@ private void recoverSubscription(List candidates, SubscriptionTra } addToManager(broker, candidates, tracker, offsetSpecification, false); } + } finally { + tracker.consumer.unlock(); } } else { LOGGER.debug( @@ -949,125 +975,132 @@ private void checkNotClosed() { } } - synchronized void add( + void add( SubscriptionTracker subscriptionTracker, OffsetSpecification offsetSpecification, boolean isInitialSubscription) { - if (this.isFull()) { - LOGGER.debug( - "Cannot add subscription tracker for stream '{}', manager is full", - subscriptionTracker.stream); - throw new IllegalStateException("Cannot add subscription tracker, the manager is full"); - } - if (this.isClosed()) { - LOGGER.debug( - "Cannot add subscription tracker for stream '{}', manager is closed", - subscriptionTracker.stream); - throw new IllegalStateException("Cannot add subscription tracker, the manager is closed"); - } + this.subscriptionManagerLock.lock(); + try { + if (this.isFull()) { + LOGGER.debug( + "Cannot add subscription tracker for stream '{}', manager is full", + subscriptionTracker.stream); + throw new IllegalStateException("Cannot add subscription tracker, the manager is full"); + } + if (this.isClosed()) { + LOGGER.debug( + "Cannot add subscription tracker for stream '{}', manager is closed", + subscriptionTracker.stream); + throw new IllegalStateException("Cannot add subscription tracker, the manager is closed"); + } - checkNotClosed(); + checkNotClosed(); - byte subscriptionId = (byte) pickSlot(this.subscriptionTrackers, this.consumerIndexSequence); + byte subscriptionId = + (byte) pickSlot(this.subscriptionTrackers, this.consumerIndexSequence); - List previousSubscriptions = this.subscriptionTrackers; + List previousSubscriptions = this.subscriptionTrackers; - LOGGER.debug( - "Subscribing to {}, requested offset specification is {}, offset tracking reference is {}, properties are {}", - subscriptionTracker.stream, - offsetSpecification == null ? DEFAULT_OFFSET_SPECIFICATION : offsetSpecification, - subscriptionTracker.offsetTrackingReference, - subscriptionTracker.subscriptionProperties); - try { - // updating data structures before subscribing - // (to make sure they are up-to-date in case message would arrive super fast) - subscriptionTracker.assign(subscriptionId, this); - streamToStreamSubscriptions - .computeIfAbsent(subscriptionTracker.stream, s -> ConcurrentHashMap.newKeySet()) - .add(subscriptionTracker); - this.setSubscriptionTrackers( - update(previousSubscriptions, subscriptionId, subscriptionTracker)); - - String offsetTrackingReference = subscriptionTracker.offsetTrackingReference; - if (offsetTrackingReference != null) { - checkNotClosed(); - QueryOffsetResponse queryOffsetResponse = - Utils.callAndMaybeRetry( - () -> client.queryOffset(offsetTrackingReference, subscriptionTracker.stream), - RETRY_ON_TIMEOUT, - "Offset query for consumer %s on stream '%s' (reference %s)", - subscriptionTracker.consumer.id(), + LOGGER.debug( + "Subscribing to {}, requested offset specification is {}, offset tracking reference is {}, properties are {}", + subscriptionTracker.stream, + offsetSpecification == null ? DEFAULT_OFFSET_SPECIFICATION : offsetSpecification, + subscriptionTracker.offsetTrackingReference, + subscriptionTracker.subscriptionProperties); + try { + // updating data structures before subscribing + // (to make sure they are up-to-date in case message would arrive super fast) + subscriptionTracker.assign(subscriptionId, this); + streamToStreamSubscriptions + .computeIfAbsent(subscriptionTracker.stream, s -> ConcurrentHashMap.newKeySet()) + .add(subscriptionTracker); + this.setSubscriptionTrackers( + update(previousSubscriptions, subscriptionId, subscriptionTracker)); + + String offsetTrackingReference = subscriptionTracker.offsetTrackingReference; + if (offsetTrackingReference != null) { + checkNotClosed(); + QueryOffsetResponse queryOffsetResponse = + Utils.callAndMaybeRetry( + () -> client.queryOffset(offsetTrackingReference, subscriptionTracker.stream), + RETRY_ON_TIMEOUT, + "Offset query for consumer %s on stream '%s' (reference %s)", + subscriptionTracker.consumer.id(), + subscriptionTracker.stream, + offsetTrackingReference); + if (queryOffsetResponse.isOk() && queryOffsetResponse.getOffset() != 0) { + if (offsetSpecification != null && isInitialSubscription) { + // subscription call (not recovery), so telling the user their offset specification + // is + // ignored + LOGGER.info( + "Requested offset specification {} not used in favor of stored offset found for reference {}", + offsetSpecification, + offsetTrackingReference); + } + LOGGER.debug( + "Using offset {} to start consuming from {} with consumer {} " + + "(instead of {})", + queryOffsetResponse.getOffset(), subscriptionTracker.stream, - offsetTrackingReference); - if (queryOffsetResponse.isOk() && queryOffsetResponse.getOffset() != 0) { - if (offsetSpecification != null && isInitialSubscription) { - // subscription call (not recovery), so telling the user their offset specification - // is - // ignored - LOGGER.info( - "Requested offset specification {} not used in favor of stored offset found for reference {}", - offsetSpecification, - offsetTrackingReference); + offsetTrackingReference, + offsetSpecification); + offsetSpecification = OffsetSpecification.offset(queryOffsetResponse.getOffset() + 1); } - LOGGER.debug( - "Using offset {} to start consuming from {} with consumer {} " + "(instead of {})", - queryOffsetResponse.getOffset(), - subscriptionTracker.stream, - offsetTrackingReference, - offsetSpecification); - offsetSpecification = OffsetSpecification.offset(queryOffsetResponse.getOffset() + 1); } - } - offsetSpecification = - offsetSpecification == null ? DEFAULT_OFFSET_SPECIFICATION : offsetSpecification; + offsetSpecification = + offsetSpecification == null ? DEFAULT_OFFSET_SPECIFICATION : offsetSpecification; - // TODO consider using/emulating ConsumerUpdateListener, to have only one API, not 2 - // even when the consumer is not a SAC. - SubscriptionContext subscriptionContext = - new DefaultSubscriptionContext(offsetSpecification, subscriptionTracker.stream); - subscriptionTracker.subscriptionListener.preSubscribe(subscriptionContext); - LOGGER.info( - "Computed offset specification {}, offset specification used after subscription listener {}", - offsetSpecification, - subscriptionContext.offsetSpecification()); + // TODO consider using/emulating ConsumerUpdateListener, to have only one API, not 2 + // even when the consumer is not a SAC. + SubscriptionContext subscriptionContext = + new DefaultSubscriptionContext(offsetSpecification, subscriptionTracker.stream); + subscriptionTracker.subscriptionListener.preSubscribe(subscriptionContext); + LOGGER.info( + "Computed offset specification {}, offset specification used after subscription listener {}", + offsetSpecification, + subscriptionContext.offsetSpecification()); - checkNotClosed(); - byte subId = subscriptionId; - Client.Response subscribeResponse = - Utils.callAndMaybeRetry( - () -> - client.subscribe( - subId, - subscriptionTracker.stream, - subscriptionContext.offsetSpecification(), - subscriptionTracker.flowStrategy.initialCredits(), - subscriptionTracker.subscriptionProperties), - RETRY_ON_TIMEOUT, - "Subscribe request for consumer %s on stream '%s'", - subscriptionTracker.consumer.id(), - subscriptionTracker.stream); - if (!subscribeResponse.isOk()) { - String message = - "Subscription to stream " - + subscriptionTracker.stream - + " failed with code " - + formatConstant(subscribeResponse.getResponseCode()); - LOGGER.debug(message); - throw convertCodeToException( - subscribeResponse.getResponseCode(), subscriptionTracker.stream, () -> message); + checkNotClosed(); + byte subId = subscriptionId; + Client.Response subscribeResponse = + Utils.callAndMaybeRetry( + () -> + client.subscribe( + subId, + subscriptionTracker.stream, + subscriptionContext.offsetSpecification(), + subscriptionTracker.flowStrategy.initialCredits(), + subscriptionTracker.subscriptionProperties), + RETRY_ON_TIMEOUT, + "Subscribe request for consumer %s on stream '%s'", + subscriptionTracker.consumer.id(), + subscriptionTracker.stream); + if (!subscribeResponse.isOk()) { + String message = + "Subscription to stream " + + subscriptionTracker.stream + + " failed with code " + + formatConstant(subscribeResponse.getResponseCode()); + LOGGER.debug(message); + throw convertCodeToException( + subscribeResponse.getResponseCode(), subscriptionTracker.stream, () -> message); + } + } catch (RuntimeException e) { + subscriptionTracker.assign((byte) -1, null); + this.setSubscriptionTrackers(previousSubscriptions); + streamToStreamSubscriptions + .computeIfAbsent(subscriptionTracker.stream, s -> ConcurrentHashMap.newKeySet()) + .remove(subscriptionTracker); + maybeCleanStreamToStreamSubscriptions(subscriptionTracker.stream); + throw e; } - } catch (RuntimeException e) { - subscriptionTracker.assign((byte) -1, null); - this.setSubscriptionTrackers(previousSubscriptions); - streamToStreamSubscriptions - .computeIfAbsent(subscriptionTracker.stream, s -> ConcurrentHashMap.newKeySet()) - .remove(subscriptionTracker); - maybeCleanStreamToStreamSubscriptions(subscriptionTracker.stream); - throw e; + subscriptionTracker.state(SubscriptionState.ACTIVE); + LOGGER.debug("Subscribed to '{}'", subscriptionTracker.stream); + } finally { + this.subscriptionManagerLock.unlock(); } - subscriptionTracker.state(SubscriptionState.ACTIVE); - LOGGER.debug("Subscribed to '{}'", subscriptionTracker.stream); } private void maybeCleanStreamToStreamSubscriptions(String stream) { @@ -1082,49 +1115,54 @@ private void maybeCleanStreamToStreamSubscriptions(String stream) { }); } - synchronized void remove(SubscriptionTracker subscriptionTracker) { - byte subscriptionIdInClient = subscriptionTracker.subscriptionIdInClient; - try { - Client.Response unsubscribeResponse = - Utils.callAndMaybeRetry( - () -> { - if (client.isOpen()) { - return client.unsubscribe(subscriptionIdInClient); + void remove(SubscriptionTracker subscriptionTracker) { + Utils.lock( + this.subscriptionManagerLock, + () -> { + byte subscriptionIdInClient = subscriptionTracker.subscriptionIdInClient; + try { + Client.Response unsubscribeResponse = + Utils.callAndMaybeRetry( + () -> { + if (client.isOpen()) { + return client.unsubscribe(subscriptionIdInClient); + } else { + return Client.responseOk(); + } + }, + RETRY_ON_TIMEOUT, + "Unsubscribe request for consumer %d on stream '%s'", + subscriptionTracker.consumer.id(), + subscriptionTracker.stream); + if (!unsubscribeResponse.isOk()) { + LOGGER.warn( + "Unexpected response code when unsubscribing from {}: {} (subscription ID {})", + subscriptionTracker.stream, + formatConstant(unsubscribeResponse.getResponseCode()), + subscriptionIdInClient); + } + } catch (TimeoutStreamException e) { + LOGGER.debug( + "Reached timeout when trying to unsubscribe consumer {} from stream '{}'", + subscriptionTracker.consumer.id(), + subscriptionTracker.stream); + } + + this.setSubscriptionTrackers( + update(this.subscriptionTrackers, subscriptionIdInClient, null)); + streamToStreamSubscriptions.compute( + subscriptionTracker.stream, + (stream, subscriptionsForThisStream) -> { + if (subscriptionsForThisStream == null || subscriptionsForThisStream.isEmpty()) { + // should not happen + return null; } else { - return Client.responseOk(); + subscriptionsForThisStream.remove(subscriptionTracker); + return subscriptionsForThisStream.isEmpty() ? null : subscriptionsForThisStream; } - }, - RETRY_ON_TIMEOUT, - "Unsubscribe request for consumer %d on stream '%s'", - subscriptionTracker.consumer.id(), - subscriptionTracker.stream); - if (!unsubscribeResponse.isOk()) { - LOGGER.warn( - "Unexpected response code when unsubscribing from {}: {} (subscription ID {})", - subscriptionTracker.stream, - formatConstant(unsubscribeResponse.getResponseCode()), - subscriptionIdInClient); - } - } catch (TimeoutStreamException e) { - LOGGER.debug( - "Reached timeout when trying to unsubscribe consumer {} from stream '{}'", - subscriptionTracker.consumer.id(), - subscriptionTracker.stream); - } - - this.setSubscriptionTrackers(update(this.subscriptionTrackers, subscriptionIdInClient, null)); - streamToStreamSubscriptions.compute( - subscriptionTracker.stream, - (stream, subscriptionsForThisStream) -> { - if (subscriptionsForThisStream == null || subscriptionsForThisStream.isEmpty()) { - // should not happen - return null; - } else { - subscriptionsForThisStream.remove(subscriptionTracker); - return subscriptionsForThisStream.isEmpty() ? null : subscriptionsForThisStream; - } + }); + closeIfEmpty(); }); - closeIfEmpty(); } private List update( @@ -1157,42 +1195,51 @@ boolean isClosed() { return this.closed.get(); } - synchronized void closeIfEmpty() { - if (this.isEmpty()) { - this.close(); - } + void closeIfEmpty() { + Utils.lock( + this.subscriptionManagerLock, + () -> { + if (this.isEmpty()) { + this.close(); + } + }); } - synchronized void close() { - if (this.closed.compareAndSet(false, true)) { - managers.remove(this); - LOGGER.debug("Closing consumer subscription manager on {}, id {}", this.name, this.id); - if (this.client != null && this.client.isOpen()) { - for (int i = 0; i < this.subscriptionTrackers.size(); i++) { - SubscriptionTracker tracker = this.subscriptionTrackers.get(i); - if (tracker != null) { - try { - if (this.client.isOpen() && tracker.consumer.isOpen()) { - this.client.unsubscribe(tracker.subscriptionIdInClient); + void close() { + Utils.lock( + this.subscriptionManagerLock, + () -> { + if (this.closed.compareAndSet(false, true)) { + managers.remove(this); + LOGGER.debug( + "Closing consumer subscription manager on {}, id {}", this.name, this.id); + if (this.client != null && this.client.isOpen()) { + for (int i = 0; i < this.subscriptionTrackers.size(); i++) { + SubscriptionTracker tracker = this.subscriptionTrackers.get(i); + if (tracker != null) { + try { + if (this.client.isOpen() && tracker.consumer.isOpen()) { + this.client.unsubscribe(tracker.subscriptionIdInClient); + } + } catch (Exception e) { + // OK, moving on + LOGGER.debug( + "Error while unsubscribing from {}, registration {}", + tracker.stream, + tracker.subscriptionIdInClient); + } + this.subscriptionTrackers.set(i, null); + } } - } catch (Exception e) { - // OK, moving on - LOGGER.debug( - "Error while unsubscribing from {}, registration {}", - tracker.stream, - tracker.subscriptionIdInClient); - } - this.subscriptionTrackers.set(i, null); - } - } - streamToStreamSubscriptions.clear(); + streamToStreamSubscriptions.clear(); - if (this.client.isOpen()) { - this.client.close(); - } - } - } + if (this.client.isOpen()) { + this.client.close(); + } + } + } + }); } @Override diff --git a/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java b/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java index 2eb494a260..c1e0a6f515 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java +++ b/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -14,7 +14,8 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; -import com.rabbitmq.stream.impl.Utils.NamedThreadFactory; +import static com.rabbitmq.stream.impl.ThreadUtils.threadFactory; + import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -45,7 +46,7 @@ class DefaultExecutorServiceFactory implements ExecutorServiceFactory { DefaultExecutorServiceFactory(int minSize, int clientPerExecutor, String prefix) { this.minSize = minSize; this.clientPerExecutor = clientPerExecutor; - this.threadFactory = new NamedThreadFactory(prefix); + this.threadFactory = threadFactory(prefix); this.executorFactory = () -> newExecutor(); List l = new ArrayList<>(this.minSize); IntStream.range(0, this.minSize).forEach(ignored -> l.add(this.executorFactory.get())); diff --git a/src/main/java/com/rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java b/src/main/java/com/rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java index 94652f5afb..35c9071594 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java +++ b/src/main/java/com/rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -14,7 +14,8 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; -import com.rabbitmq.stream.impl.Utils.NamedThreadFactory; +import static com.rabbitmq.stream.impl.ThreadUtils.threadFactory; + import java.time.Duration; import java.util.ArrayList; import java.util.Collection; @@ -39,7 +40,7 @@ class ScheduledExecutorServiceWrapper implements ScheduledExecutorService { private final Set tasks = ConcurrentHashMap.newKeySet(); private final ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor( - new NamedThreadFactory("rabbitmq-stream-scheduled-executor-service-wrapper-")); + threadFactory("rabbitmq-stream-scheduled-executor-service-wrapper-")); ScheduledExecutorServiceWrapper(ScheduledExecutorService delegate) { this.delegate = delegate; @@ -122,10 +123,12 @@ public ScheduledFuture scheduleWithFixedDelay( @Override public void shutdown() { this.delegate.shutdown(); + this.scheduler.shutdown(); } @Override public List shutdownNow() { + this.delegate.shutdownNow(); return this.delegate.shutdownNow(); } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java index 532ed33189..296ae02677 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java @@ -35,6 +35,8 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import java.util.function.LongConsumer; import java.util.function.LongSupplier; import java.util.function.Supplier; @@ -63,6 +65,7 @@ class StreamConsumer implements Consumer { private volatile boolean sacActive; private final boolean sac; private final OffsetSpecification initialOffsetSpecification; + private final Lock lock = new ReentrantLock(); @SuppressFBWarnings("CT_CONSTRUCTOR_THROW") StreamConsumer( @@ -525,8 +528,20 @@ private void maybeNotifyActiveToInactiveSac() { } synchronized void unavailable() { - this.status = Status.NOT_AVAILABLE; - this.trackingClient = null; + Utils.lock( + this.lock, + () -> { + this.status = Status.NOT_AVAILABLE; + this.trackingClient = null; + }); + } + + void lock() { + this.lock.lock(); + } + + void unlock() { + this.lock.unlock(); } void running() { diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index c817b1c33d..f526041a66 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -15,6 +15,7 @@ package com.rabbitmq.stream.impl; import static com.rabbitmq.stream.impl.AsyncRetry.asyncRetry; +import static com.rabbitmq.stream.impl.ThreadUtils.threadFactory; import static com.rabbitmq.stream.impl.Utils.*; import static java.lang.String.format; import static java.util.concurrent.TimeUnit.SECONDS; @@ -195,7 +196,7 @@ class StreamEnvironment implements Environment { .mapToObj( i -> { Address addr = this.addresses.get(i % this.addresses.size()); - return new Locator(addr); + return new Locator(i, addr); }) .collect(toList()); this.locators = List.copyOf(lctrs); @@ -219,8 +220,7 @@ class StreamEnvironment implements Environment { if (scheduledExecutorService == null) { int threads = Runtime.getRuntime().availableProcessors(); LOGGER.debug("Creating scheduled executor service with {} thread(s)", threads); - ThreadFactory threadFactory = - new Utils.NamedThreadFactory("rabbitmq-stream-environment-scheduler-"); + ThreadFactory threadFactory = threadFactory("rabbitmq-stream-environment-scheduler-"); executorService = Executors.newScheduledThreadPool(threads, threadFactory); this.privateScheduleExecutorService = true; } else { @@ -281,7 +281,19 @@ class StreamEnvironment implements Environment { this.locators.forEach( l -> { if (l.isNotSet()) { - scheduleLocatorConnection(l, connectionNamingStrategy, clientFactory); + ShutdownListener shutdownListener = + shutdownListener(l, connectionNamingStrategy, clientFactory); + Client.ClientParameters newLocatorParameters = + this.locatorParametersCopy().shutdownListener(shutdownListener); + scheduleLocatorConnection( + newLocatorParameters, + this.addressResolver, + l, + connectionNamingStrategy, + clientFactory, + this.scheduledExecutorService, + this.recoveryBackOffDelayPolicy, + l.label()); } }); } @@ -309,64 +321,46 @@ private ShutdownListener shutdownListener( AtomicReference shutdownListenerReference = new AtomicReference<>(); Client.ShutdownListener shutdownListener = shutdownContext -> { + String label = locator.label(); + LOGGER.debug("Locator {} disconnected", label); if (shutdownContext.isShutdownUnexpected()) { - String label = locator.label(); locator.client(null); + BackOffDelayPolicy delayPolicy = recoveryBackOffDelayPolicy; LOGGER.debug( - "Unexpected locator disconnection for locator on '{}', trying to reconnect", label); - try { - Client.ClientParameters newLocatorParameters = - this.locatorParametersCopy().shutdownListener(shutdownListenerReference.get()); - asyncRetry( - () -> { - LOGGER.debug("Locator reconnection..."); - Address resolvedAddress = addressResolver.resolve(locator.address()); - String connectionName = - connectionNamingStrategy.apply(ClientConnectionType.LOCATOR); - LOGGER.debug( - "Trying to reconnect locator on {}, with client connection name '{}'", - resolvedAddress, - connectionName); - Client newLocator = - clientFactory.apply( - newLocatorParameters - .host(resolvedAddress.host()) - .port(resolvedAddress.port()) - .clientProperty("connection_name", connectionName)); - LOGGER.debug("Created locator connection '{}'", connectionName); - LOGGER.debug("Locator connected on {}", resolvedAddress); - return newLocator; - }) - .description("Locator recovery") - .scheduler(this.scheduledExecutorService) - .delayPolicy(recoveryBackOffDelayPolicy) - .build() - .thenAccept(locator::client) - .exceptionally( - ex -> { - LOGGER.debug("Locator recovery failed", ex); - return null; - }); - } catch (Exception e) { - LOGGER.debug("Error while scheduling locator reconnection", e); - } + "Unexpected locator disconnection for on '{}', scheduling recovery with {}", + label, + delayPolicy); + Client.ClientParameters newLocatorParameters = + this.locatorParametersCopy().shutdownListener(shutdownListenerReference.get()); + scheduleLocatorConnection( + newLocatorParameters, + this.addressResolver, + locator, + connectionNamingStrategy, + clientFactory, + this.scheduledExecutorService, + delayPolicy, + label); } else { - LOGGER.debug("Locator connection '{}' closing normally", locator.label()); + LOGGER.debug("Locator connection '{}' closing normally", label); } }; shutdownListenerReference.set(shutdownListener); return shutdownListener; } - private void scheduleLocatorConnection( + private static void scheduleLocatorConnection( + ClientParameters newLocatorParameters, + AddressResolver addressResolver, Locator locator, Function connectionNamingStrategy, - Function clientFactory) { - ShutdownListener shutdownListener = - shutdownListener(locator, connectionNamingStrategy, clientFactory); + Function clientFactory, + ScheduledExecutorService scheduler, + BackOffDelayPolicy delayPolicy, + String locatorLabel) { + LOGGER.debug( + "Scheduling locator '{}' connection with delay policy {}", locatorLabel, delayPolicy); try { - Client.ClientParameters newLocatorParameters = - this.locatorParametersCopy().shutdownListener(shutdownListener); asyncRetry( () -> { LOGGER.debug("Locator reconnection..."); @@ -387,18 +381,18 @@ private void scheduleLocatorConnection( LOGGER.debug("Locator connected on {}", resolvedAddress); return newLocator; }) - .description("Locator recovery") - .scheduler(this.scheduledExecutorService) - .delayPolicy(recoveryBackOffDelayPolicy) + .description("Locator '%s' connection", locatorLabel) + .scheduler(scheduler) + .delayPolicy(delayPolicy) .build() .thenAccept(locator::client) .exceptionally( ex -> { - LOGGER.debug("Locator recovery failed", ex); + LOGGER.debug("Locator connection failed", ex); return null; }); } catch (Exception e) { - LOGGER.debug("Error while scheduling locator reconnection", e); + LOGGER.debug("Error while scheduling locator '{}' reconnection", locatorLabel, e); } } @@ -482,7 +476,7 @@ public StreamCreator streamCreator() { public void deleteStream(String stream) { checkNotClosed(); this.maybeInitializeLocator(); - Client.Response response = this.locator().delete(stream); + Client.Response response = this.locator().client().delete(stream); if (!response.isOk()) { throw new StreamException( "Error while deleting stream " @@ -498,7 +492,7 @@ public void deleteStream(String stream) { public void deleteSuperStream(String superStream) { checkNotClosed(); this.maybeInitializeLocator(); - Client.Response response = this.locator().deleteSuperStream(superStream); + Client.Response response = this.locator().client().deleteSuperStream(superStream); if (!response.isOk()) { throw new StreamException( "Error while deleting super stream " @@ -605,6 +599,16 @@ public long firstOffset() { public long committedChunkId() { return committedOffsetSupplier.getAsLong(); } + + @Override + public String toString() { + return "StreamStats{" + + "firstOffset=" + + firstOffset() + + ", committedOffset=" + + committedChunkId() + + '}'; + } } @Override @@ -746,12 +750,22 @@ Runnable registerProducer(StreamProducer producer, String reference, String stre return producersCoordinator.registerProducer(producer, reference, stream); } - Client locator() { + Locator locator() { + if (LOGGER.isDebugEnabled()) { + try { + LOGGER.debug( + "Locators: {}", + this.locators.stream() + .map(l -> l.label() + " is set " + l.isSet()) + .collect(Collectors.joining(", "))); + } catch (Exception e) { + // OK + } + } return this.locators.stream() .filter(Locator::isSet) .findAny() - .orElseThrow(LocatorNotAvailableException::new) - .client(); + .orElseThrow(LocatorNotAvailableException::new); } T locatorOperation(Function operation) { @@ -760,7 +774,7 @@ T locatorOperation(Function operation) { static T locatorOperation( Function operation, - Supplier clientSupplier, + Supplier locatorSupplier, BackOffDelayPolicy backOffDelayPolicy) { int maxAttempt = 3; int attempt = 0; @@ -771,9 +785,11 @@ static T locatorOperation( long start = System.nanoTime(); while (attempt < maxAttempt) { try { - Client client = clientSupplier.get(); + Locator locator = locatorSupplier.get(); + Client client = locator.client(); LOGGER.debug( - "Using locator on {}:{} to run operation '{}'", + "Using locator {} on {}:{} to run operation '{}'", + locator.id(), client.getHost(), client.getPort(), operation); @@ -892,7 +908,7 @@ public String toString() { .map( l -> { Client c = l.nullableClient(); - return c == null ? "null" : ("\"" + c.connectionName() + "\""); + return c == null ? "null" : ("\"" + l.label() + "\""); }) .collect(Collectors.joining(",")) + "], " @@ -949,6 +965,10 @@ static class LocatorNotAvailableException extends StreamException { public LocatorNotAvailableException() { super("Locator not available"); } + + public LocatorNotAvailableException(long id) { + super(String.format("Locator %d not available", id)); + } } private void checkNotClosed() { @@ -957,13 +977,15 @@ private void checkNotClosed() { } } - private static class Locator { + static class Locator { + private final long id; private final Address address; private volatile Optional client; private volatile LocalDateTime lastChanged; - private Locator(Address address) { + Locator(long id, Address address) { + this.id = id; this.address = address; this.client = Optional.empty(); lastChanged = LocalDateTime.now(); @@ -986,6 +1008,10 @@ Locator client(Client client) { return this; } + private long id() { + return this.id; + } + private boolean isNotSet() { return !this.isSet(); } @@ -995,7 +1021,7 @@ private boolean isSet() { } private Client client() { - return this.client.orElseThrow(LocatorNotAvailableException::new); + return this.client.orElseThrow(() -> new LocatorNotAvailableException(id)); } private Client nullableClient() { @@ -1009,11 +1035,15 @@ private Address address() { private String label() { Client c = this.nullableClient(); if (c == null) { - return address.host() + ":" + address.port(); + return String.format("%s:%d (id %d)", address.host(), address.port(), this.id); } else { return String.format( - "%s:%d [advertised %s:%d]", - c.getHost(), c.getPort(), c.serverAdvertisedHost(), c.serverAdvertisedPort()); + "%s:%d [id %d, advertised %s:%d]", + c.getHost(), + c.getPort(), + this.id(), + c.serverAdvertisedHost(), + c.serverAdvertisedPort()); } } diff --git a/src/test/java/com/rabbitmq/stream/Cli.java b/src/test/java/com/rabbitmq/stream/Cli.java index 51d3bfdcee..e532cd508b 100644 --- a/src/test/java/com/rabbitmq/stream/Cli.java +++ b/src/test/java/com/rabbitmq/stream/Cli.java @@ -186,6 +186,10 @@ public static void restartStream(String stream) { rabbitmqStreams(" restart_stream " + stream); } + public static String streamStatus(String stream) { + return rabbitmqStreams(" stream_status --formatter table " + stream).output(); + } + public static void killStreamLeaderProcess(String stream) { rabbitmqctl( "eval 'case rabbit_stream_manager:lookup_leader(<<\"/\">>, <<\"" diff --git a/src/test/java/com/rabbitmq/stream/impl/Assertions.java b/src/test/java/com/rabbitmq/stream/impl/Assertions.java index b6f884d622..cfec3df5fb 100644 --- a/src/test/java/com/rabbitmq/stream/impl/Assertions.java +++ b/src/test/java/com/rabbitmq/stream/impl/Assertions.java @@ -40,7 +40,9 @@ SyncAssert completes() { SyncAssert completes(Duration timeout) { boolean completed = actual.await(timeout); if (!completed) { - fail("Sync timed out after %d ms", timeout.toMillis()); + fail( + "Sync timed out after %d ms (current count is %d)", + timeout.toMillis(), actual.currentCount()); } return this; } diff --git a/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java b/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java index fb6db57bc7..d1f13838de 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -19,35 +19,36 @@ import com.rabbitmq.stream.BackOffDelayPolicy; import java.time.Duration; +import java.util.List; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Mock; import org.mockito.MockitoAnnotations; public class AsyncRetryTest { - ScheduledExecutorService scheduler; @Mock Callable task; AutoCloseable mocks; @BeforeEach - void init() { + void init(TestInfo info) { mocks = MockitoAnnotations.openMocks(this); - this.scheduler = Executors.newSingleThreadScheduledExecutor(); } @AfterEach void tearDown() throws Exception { - this.scheduler.shutdownNow(); mocks.close(); } - @Test - void callbackCalledIfCompletedImmediately() throws Exception { + @ParameterizedTest + @MethodSource("schedulers") + void callbackCalledIfCompletedImmediately(ScheduledExecutorService scheduler) throws Exception { when(task.call()).thenReturn(42); CompletableFuture completableFuture = AsyncRetry.asyncRetry(task) @@ -61,8 +62,9 @@ void callbackCalledIfCompletedImmediately() throws Exception { verify(task, times(1)).call(); } - @Test - void shouldRetryWhenExecutionFails() throws Exception { + @ParameterizedTest + @MethodSource("schedulers") + void shouldRetryWhenExecutionFails(ScheduledExecutorService scheduler) throws Exception { when(task.call()) .thenThrow(new RuntimeException()) .thenThrow(new RuntimeException()) @@ -81,12 +83,14 @@ void shouldRetryWhenExecutionFails() throws Exception { verify(task, times(3)).call(); } - @Test - void shouldTimeoutWhenExecutionFailsForTooLong() throws Exception { + @ParameterizedTest + @MethodSource("schedulers") + void shouldTimeoutWhenExecutionFailsForTooLong(ScheduledExecutorService scheduler) + throws Exception { when(task.call()).thenThrow(new RuntimeException()); CompletableFuture completableFuture = AsyncRetry.asyncRetry(task) - .scheduler(this.scheduler) + .scheduler(scheduler) .delayPolicy( BackOffDelayPolicy.fixedWithInitialDelay( Duration.ofMillis(50), Duration.ofMillis(50), Duration.ofMillis(500))) @@ -111,8 +115,9 @@ void shouldTimeoutWhenExecutionFailsForTooLong() throws Exception { verify(task, atLeast(5)).call(); } - @Test - void shouldRetryWhenPredicateAllowsIt() throws Exception { + @ParameterizedTest + @MethodSource("schedulers") + void shouldRetryWhenPredicateAllowsIt(ScheduledExecutorService scheduler) throws Exception { when(task.call()) .thenThrow(new IllegalStateException()) .thenThrow(new IllegalStateException()) @@ -135,8 +140,10 @@ void shouldRetryWhenPredicateAllowsIt() throws Exception { verify(task, times(3)).call(); } - @Test - void shouldFailWhenPredicateDoesNotAllowRetry() throws Exception { + @ParameterizedTest + @MethodSource("schedulers") + void shouldFailWhenPredicateDoesNotAllowRetry(ScheduledExecutorService scheduler) + throws Exception { when(task.call()) .thenThrow(new IllegalStateException()) .thenThrow(new IllegalStateException()) @@ -166,4 +173,11 @@ void shouldFailWhenPredicateDoesNotAllowRetry() throws Exception { assertThat(exceptionallyCalled.get()).isTrue(); verify(task, times(3)).call(); } + + static List schedulers() { + return List.of( + Executors.newSingleThreadScheduledExecutor(), + Executors.newScheduledThreadPool( + 0, ThreadUtils.internalThreadFactory("async-retry-test-"))); + } } diff --git a/src/test/java/com/rabbitmq/stream/impl/ClientTest.java b/src/test/java/com/rabbitmq/stream/impl/ClientTest.java index d3320153d8..ffc44b0704 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ClientTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ClientTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -23,13 +23,8 @@ import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; -import com.rabbitmq.stream.Codec; -import com.rabbitmq.stream.Constants; -import com.rabbitmq.stream.Message; -import com.rabbitmq.stream.MessageBuilder; -import com.rabbitmq.stream.OffsetSpecification; +import com.rabbitmq.stream.*; import com.rabbitmq.stream.Properties; -import com.rabbitmq.stream.StreamException; import com.rabbitmq.stream.codec.QpidProtonCodec; import com.rabbitmq.stream.codec.SimpleCodec; import com.rabbitmq.stream.codec.SwiftMqCodec; diff --git a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java index acb40d7314..3777d7e7d9 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java @@ -147,7 +147,9 @@ public Client.ClientParameters shutdownListener( } }; mocks = MockitoAnnotations.openMocks(this); - when(environment.locator()).thenReturn(locator); + StreamEnvironment.Locator l = new StreamEnvironment.Locator(-1, new Address("localhost", 5555)); + l.client(locator); + when(environment.locator()).thenReturn(l); when(environment.locatorOperation(any())).thenCallRealMethod(); when(environment.clientParametersCopy()).thenReturn(clientParameters); when(environment.addressResolver()).thenReturn(address -> address); diff --git a/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java index d0688da9c8..08cb66a474 100644 --- a/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java @@ -63,7 +63,9 @@ public class LoadBalancerClusterTest { void init() { mocks = MockitoAnnotations.openMocks(this); locator = cf.get(new Client.ClientParameters().port(LB_PORT)); - when(environment.locator()).thenReturn(locator); + StreamEnvironment.Locator l = new StreamEnvironment.Locator(-1, new Address("localhost", 5555)); + l.client(locator); + when(environment.locator()).thenReturn(l); when(environment.clientParametersCopy()) .thenReturn(new Client.ClientParameters().eventLoopGroup(eventLoopGroup).port(LB_PORT)); when(environment.addressResolver()).thenReturn(address -> LOAD_BALANCER_ADDRESS); diff --git a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java index 88d6d122ce..173f951857 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java @@ -33,6 +33,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import com.rabbitmq.stream.Address; import com.rabbitmq.stream.BackOffDelayPolicy; import com.rabbitmq.stream.Constants; import com.rabbitmq.stream.StreamDoesNotExistException; @@ -119,7 +120,9 @@ public Client.ClientParameters metadataListener( } }; mocks = MockitoAnnotations.openMocks(this); - when(environment.locator()).thenReturn(locator); + StreamEnvironment.Locator l = new StreamEnvironment.Locator(-1, new Address("localhost", 5555)); + l.client(locator); + when(environment.locator()).thenReturn(l); when(environment.locatorOperation(any())).thenCallRealMethod(); when(environment.clientParametersCopy()).thenReturn(clientParameters); when(environment.addressResolver()).thenReturn(address -> address); diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index c85311bb70..d67787a610 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -18,8 +18,8 @@ import static com.rabbitmq.stream.impl.LoadBalancerClusterTest.LOAD_BALANCER_ADDRESS; import static com.rabbitmq.stream.impl.TestUtils.newLoggerLevel; import static com.rabbitmq.stream.impl.TestUtils.sync; +import static com.rabbitmq.stream.impl.ThreadUtils.threadFactory; import static com.rabbitmq.stream.impl.Tuples.pair; -import static java.time.Duration.ofSeconds; import static java.util.stream.Collectors.toList; import static java.util.stream.IntStream.range; import static org.assertj.core.api.Assertions.assertThat; @@ -30,9 +30,11 @@ import com.rabbitmq.stream.*; import com.rabbitmq.stream.impl.TestUtils.Sync; import com.rabbitmq.stream.impl.Tuples.Pair; +import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; import java.nio.charset.StandardCharsets; import java.time.Duration; +import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -54,10 +56,15 @@ public class RecoveryClusterTest { private static final Logger LOGGER = LoggerFactory.getLogger(RecoveryClusterTest.class); + private static final Duration ASSERTION_TIMEOUT = Duration.ofSeconds(20); + // give some slack before first recovery attempt, especially on Docker + static final Duration RECOVERY_INITIAL_DELAY = Duration.ofSeconds(10); + static final Duration RECOVERY_DELAY = Duration.ofSeconds(2); static List nodes; static final List URIS = range(5552, 5555).mapToObj(p -> "rabbitmq-stream://localhost:" + p).collect(toList()); - static final BackOffDelayPolicy BACK_OFF_DELAY_POLICY = BackOffDelayPolicy.fixed(ofSeconds(2)); + static final BackOffDelayPolicy BACK_OFF_DELAY_POLICY = + BackOffDelayPolicy.fixedWithInitialDelay(RECOVERY_INITIAL_DELAY, RECOVERY_DELAY); Environment environment; TestInfo testInfo; EventLoopGroup eventLoopGroup; @@ -68,7 +75,9 @@ public class RecoveryClusterTest { ProducersCoordinator.class, ConsumersCoordinator.class, StreamEnvironment.class, - AsyncRetry.class); + AsyncRetry.class, + StreamEnvironment.class, + ScheduledExecutorServiceWrapper.class); ScheduledExecutorService scheduledExecutorService; @BeforeAll @@ -81,15 +90,16 @@ static void initAll() { void init(TestInfo info) { int availableProcessors = Runtime.getRuntime().availableProcessors(); LOGGER.info("Available processors: {}", availableProcessors); - ThreadFactory threadFactory = - new Utils.NamedThreadFactory("rabbitmq-stream-environment-scheduler-"); - scheduledExecutorService = - Executors.newScheduledThreadPool(availableProcessors * 2, threadFactory); + ThreadFactory threadFactory = threadFactory("rabbitmq-stream-environment-scheduler-"); + scheduledExecutorService = Executors.newScheduledThreadPool(availableProcessors, threadFactory); + // add some debug log messages + scheduledExecutorService = new ScheduledExecutorServiceWrapper(scheduledExecutorService); environmentBuilder = Environment.builder() .recoveryBackOffDelayPolicy(BACK_OFF_DELAY_POLICY) .topologyUpdateBackOffDelayPolicy(BACK_OFF_DELAY_POLICY) .scheduledExecutorService(scheduledExecutorService) + .requestedHeartbeat(Duration.ofSeconds(3)) .netty() .eventLoopGroup(eventLoopGroup) .environmentBuilder(); @@ -146,6 +156,14 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru environment = environmentBuilder + .netty() + .bootstrapCustomizer( + b -> { + b.option( + ChannelOption.CONNECT_TIMEOUT_MILLIS, + (int) BACK_OFF_DELAY_POLICY.delay(0).toMillis()); + }) + .environmentBuilder() .maxProducersByConnection(producerCount / 4) .maxConsumersByConnection(consumerCount / 4) .build(); @@ -154,8 +172,10 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru .mapToObj(i -> TestUtils.streamName(testInfo) + "-" + i) .collect(toList()); streams.forEach(s -> environment.streamCreator().stream(s).create()); + List producers = Collections.emptyList(); + List consumers = Collections.emptyList(); try { - List producers = + producers = range(0, producerCount) .mapToObj( i -> { @@ -164,7 +184,7 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru return new ProducerState(s, dynamicBatch, environment); }) .collect(toList()); - List consumers = + consumers = range(0, consumerCount) .mapToObj( i -> { @@ -191,7 +211,7 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru Cli.rebalance(); LOGGER.info("Rebalancing over."); - Thread.sleep(BACK_OFF_DELAY_POLICY.delay(0).multipliedBy(2).toMillis()); + Thread.sleep(BACK_OFF_DELAY_POLICY.delay(0).toMillis()); List> streamsSyncs = producers.stream() @@ -200,7 +220,7 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru streamsSyncs.forEach( p -> { LOGGER.info("Checking publisher to {} still publishes", p.v1()); - assertThat(p.v2()).completes(); + assertThat(p.v2()).completes(ASSERTION_TIMEOUT); LOGGER.info("Publisher to {} still publishes", p.v1()); }); @@ -211,7 +231,7 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru streamsSyncs.forEach( p -> { LOGGER.info("Checking consumer from {} still consumes", p.v1()); - assertThat(p.v2()).completes(); + assertThat(p.v2()).completes(ASSERTION_TIMEOUT); LOGGER.info("Consumer from {} still consumes", p.v1()); }); @@ -221,7 +241,7 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru committedChunkIdPerStream.put(s, environment.queryStreamStats(s).committedChunkId())); syncs = producers.stream().map(p -> p.waitForNewMessages(1000)).collect(toList()); - syncs.forEach(s -> assertThat(s).completes()); + syncs.forEach(s -> assertThat(s).completes(ASSERTION_TIMEOUT)); streams.forEach( s -> { @@ -230,10 +250,38 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru .isGreaterThan(committedChunkIdPerStream.get(s)); }); - producers.forEach(ProducerState::close); - consumers.forEach(ConsumerState::close); } finally { - streams.forEach(s -> environment.deleteStream(s)); + LOGGER.info("Environment information:"); + System.out.println(TestUtils.jsonPrettyPrint(environment.toString())); + + LOGGER.info("Closing producers"); + producers.forEach( + p -> { + try { + p.close(); + } catch (Exception e) { + LOGGER.info("Error while closing producer to '{}': {}", p.stream(), e.getMessage()); + } + }); + + LOGGER.info("Stream status..."); + streams.forEach(s -> System.out.println(Cli.streamStatus(s))); + + consumers.forEach( + c -> { + try { + c.close(); + } catch (Exception e) { + LOGGER.info("Error while closing from '{}': {}", c.stream(), e.getMessage()); + } + }); + + LOGGER.info("Deleting streams after test"); + try { + streams.forEach(s -> environment.deleteStream(s)); + } catch (Exception e) { + LOGGER.info("Error while deleting streams: {}", e.getMessage()); + } } } diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java index 6052e1fee8..383a1190d7 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java @@ -20,6 +20,7 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.*; +import com.rabbitmq.stream.Address; import com.rabbitmq.stream.BackOffDelayPolicy; import com.rabbitmq.stream.ObservationCollector; import com.rabbitmq.stream.StreamException; @@ -297,5 +298,11 @@ void locatorOperationShouldNotRetryAndReThrowUnexpectedException() { assertThat(counter).hasValue(1); } - private static final Supplier CLIENT_SUPPLIER = () -> mock(Client.class); + private static final Supplier CLIENT_SUPPLIER = + () -> { + StreamEnvironment.Locator locator = + new StreamEnvironment.Locator(-1, new Address("localhost", 5555)); + locator.client(mock(Client.class)); + return locator; + }; } diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index 5611b5e37b..b38a82da76 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -23,6 +23,10 @@ import static org.junit.jupiter.api.Assertions.fail; import ch.qos.logback.classic.Level; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; import com.rabbitmq.client.BuiltinExchangeType; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; @@ -1052,6 +1056,12 @@ static void waitMs(long waitTime) { } } + static String jsonPrettyPrint(String in) { + Gson gson = new GsonBuilder().setPrettyPrinting().create(); + JsonElement element = JsonParser.parseString(in); + return gson.toJson(element); + } + @Target({ElementType.TYPE, ElementType.METHOD}) @Retention(RetentionPolicy.RUNTIME) @Tag("single-active-consumer") @@ -1166,6 +1176,10 @@ boolean await(Duration timeout) { } } + long currentCount() { + return this.latch.get().getCount(); + } + void reset(int count) { this.latch.set(new CountDownLatch(count)); } From 02cd6e5bff92ccd01cf23404513ae2b8a26dba6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 11 Dec 2024 14:57:59 +0100 Subject: [PATCH 307/449] Squash spotbugs warning --- src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index f526041a66..e9744f19f7 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -759,7 +759,7 @@ Locator locator() { .map(l -> l.label() + " is set " + l.isSet()) .collect(Collectors.joining(", "))); } catch (Exception e) { - // OK + LOGGER.debug("Error while listing locators: {}", e.getMessage()); } } return this.locators.stream() From ff4e2cbb62c13a77751c72ae1ebec08d92f11d3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 11 Dec 2024 15:26:30 +0100 Subject: [PATCH 308/449] Use locks instead of synchronized blocks in producer coordinator --- .../stream/impl/ProducersCoordinator.java | 210 ++++++++++-------- 1 file changed, 117 insertions(+), 93 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java index 860a924bc2..62c98434fb 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java @@ -410,6 +410,7 @@ private static class ProducerTracker implements AgentTracker { private volatile byte publisherId; private volatile ClientProducersManager clientProducersManager; private final AtomicBoolean recovering = new AtomicBoolean(false); + private final Lock trackerLock = new ReentrantLock(); private ProducerTracker( long uniqueId, String reference, String stream, StreamProducer producer) { @@ -421,10 +422,12 @@ private ProducerTracker( @Override public void assign(byte producerId, Client client, ClientProducersManager manager) { - synchronized (ProducerTracker.this) { - this.publisherId = producerId; - this.clientProducersManager = manager; - } + lock( + this.trackerLock, + () -> { + this.publisherId = producerId; + this.clientProducersManager = manager; + }); this.producer.setPublisherId(producerId); this.producer.setClient(client); } @@ -451,9 +454,7 @@ public String stream() { @Override public void unavailable() { - synchronized (ProducerTracker.this) { - this.clientProducersManager = null; - } + lock(this.trackerLock, () -> this.clientProducersManager = null); this.producer.unavailable(); } @@ -464,10 +465,14 @@ public void running() { } @Override - public synchronized void cancel() { - if (this.clientProducersManager != null) { - this.clientProducersManager.unregister(this); - } + public void cancel() { + lock( + this.trackerLock, + () -> { + if (this.clientProducersManager != null) { + this.clientProducersManager.unregister(this); + } + }); } @Override @@ -503,6 +508,7 @@ private static class TrackingConsumerTracker implements AgentTracker { private final StreamConsumer consumer; private volatile ClientProducersManager clientProducersManager; private final AtomicBoolean recovering = new AtomicBoolean(false); + private final Lock trackerLock = new ReentrantLock(); private TrackingConsumerTracker(long uniqueId, String stream, StreamConsumer consumer) { this.uniqueId = uniqueId; @@ -512,9 +518,7 @@ private TrackingConsumerTracker(long uniqueId, String stream, StreamConsumer con @Override public void assign(byte producerId, Client client, ClientProducersManager manager) { - synchronized (TrackingConsumerTracker.this) { - this.clientProducersManager = manager; - } + lock(this.trackerLock, () -> this.clientProducersManager = manager); this.consumer.setTrackingClient(client); } @@ -540,9 +544,7 @@ public String stream() { @Override public void unavailable() { - synchronized (TrackingConsumerTracker.this) { - this.clientProducersManager = null; - } + lock(this.trackerLock, () -> this.clientProducersManager = null); this.consumer.unavailable(); } @@ -553,10 +555,8 @@ public void running() { } @Override - public synchronized void cancel() { - if (this.clientProducersManager != null) { - this.clientProducersManager.unregister(this); - } + public void cancel() { + lock(this.trackerLock, () -> this.clientProducersManager.unregister(this)); } @Override @@ -599,6 +599,7 @@ private class ClientProducersManager implements Comparable> streamToTrackers = new ConcurrentHashMap<>(); private final Client client; private final AtomicBoolean closed = new AtomicBoolean(false); + private final Lock managerLock = new ReentrantLock(); private ClientProducersManager( Broker targetNode, @@ -670,7 +671,8 @@ private ClientProducersManager( "Received metadata notification for '{}', stream is likely to have become unavailable", stream); Set affectedTrackers; - synchronized (ClientProducersManager.this) { + this.managerLock.lock(); + try { affectedTrackers = streamToTrackers.remove(stream); LOGGER.debug( "Affected publishers and consumer trackers after metadata update: {}", @@ -686,6 +688,8 @@ private ClientProducersManager( } }); } + } finally { + this.managerLock.unlock(); } if (affectedTrackers != null && !affectedTrackers.isEmpty()) { environment @@ -840,79 +844,97 @@ private void recoverAgent(Broker node, List candidates, AgentTrac } } - private synchronized void register(AgentTracker tracker) { - if (this.isFullFor(tracker)) { - throw new IllegalStateException("Cannot add subscription tracker, the manager is full"); - } - if (this.isClosed()) { - throw new IllegalStateException("Cannot add subscription tracker, the manager is closed"); - } - checkNotClosed(); - if (tracker.identifiable()) { - ProducerTracker producerTracker = (ProducerTracker) tracker; - int index = pickSlot(this.producers, producerTracker, this.producerIndexSequence); - this.checkNotClosed(); - Response response = - callAndMaybeRetry( - () -> - this.client.declarePublisher( - (byte) index, tracker.reference(), tracker.stream()), - RETRY_ON_TIMEOUT, - "Declare publisher request for publisher %d on stream '%s'", - producerTracker.uniqueId(), - producerTracker.stream()); - if (response.isOk()) { - tracker.assign((byte) index, this.client, this); - } else { - String message = - "Error while declaring publisher: " - + formatConstant(response.getResponseCode()) - + ". Could not assign producer to client."; - LOGGER.info(message); - throw new StreamException(message, response.getResponseCode()); - } - producers.put(tracker.id(), producerTracker); - } else { - tracker.assign((byte) 0, this.client, this); - trackingConsumerTrackers.add(tracker); - } - streamToTrackers - .computeIfAbsent(tracker.stream(), s -> ConcurrentHashMap.newKeySet()) - .add(tracker); + private void register(AgentTracker tracker) { + lock( + this.managerLock, + () -> { + if (this.isFullFor(tracker)) { + throw new IllegalStateException( + "Cannot add subscription tracker, the manager is full"); + } + if (this.isClosed()) { + throw new IllegalStateException( + "Cannot add subscription tracker, the manager is closed"); + } + checkNotClosed(); + if (tracker.identifiable()) { + ProducerTracker producerTracker = (ProducerTracker) tracker; + int index = pickSlot(this.producers, producerTracker, this.producerIndexSequence); + this.checkNotClosed(); + Response response = + callAndMaybeRetry( + () -> + this.client.declarePublisher( + (byte) index, tracker.reference(), tracker.stream()), + RETRY_ON_TIMEOUT, + "Declare publisher request for publisher %d on stream '%s'", + producerTracker.uniqueId(), + producerTracker.stream()); + if (response.isOk()) { + tracker.assign((byte) index, this.client, this); + } else { + String message = + "Error while declaring publisher: " + + formatConstant(response.getResponseCode()) + + ". Could not assign producer to client."; + LOGGER.info(message); + throw new StreamException(message, response.getResponseCode()); + } + producers.put(tracker.id(), producerTracker); + } else { + tracker.assign((byte) 0, this.client, this); + trackingConsumerTrackers.add(tracker); + } + streamToTrackers + .computeIfAbsent(tracker.stream(), s -> ConcurrentHashMap.newKeySet()) + .add(tracker); + }); } - private synchronized void unregister(AgentTracker tracker) { - LOGGER.debug( - "Unregistering {} {} from manager on {}", tracker.type(), tracker.uniqueId(), this.name); - if (tracker.identifiable()) { - producers.remove(tracker.id()); - } else { - trackingConsumerTrackers.remove(tracker); - } - streamToTrackers.compute( - tracker.stream(), - (s, trackersForThisStream) -> { - if (s == null || trackersForThisStream == null) { - // should not happen - return null; + private void unregister(AgentTracker tracker) { + lock( + this.managerLock, + () -> { + LOGGER.debug( + "Unregistering {} {} from manager on {}", + tracker.type(), + tracker.uniqueId(), + this.name); + if (tracker.identifiable()) { + producers.remove(tracker.id()); } else { - trackersForThisStream.remove(tracker); - return trackersForThisStream.isEmpty() ? null : trackersForThisStream; + trackingConsumerTrackers.remove(tracker); } + streamToTrackers.compute( + tracker.stream(), + (s, trackersForThisStream) -> { + if (s == null || trackersForThisStream == null) { + // should not happen + return null; + } else { + trackersForThisStream.remove(tracker); + return trackersForThisStream.isEmpty() ? null : trackersForThisStream; + } + }); + closeIfEmpty(); }); - closeIfEmpty(); } - synchronized boolean isFullFor(AgentTracker tracker) { - if (tracker.identifiable()) { - return producers.size() == maxProducersByClient; - } else { - return trackingConsumerTrackers.size() == maxTrackingConsumersByClient; - } + boolean isFullFor(AgentTracker tracker) { + return lock( + this.managerLock, + () -> { + if (tracker.identifiable()) { + return producers.size() == maxProducersByClient; + } else { + return trackingConsumerTrackers.size() == maxTrackingConsumersByClient; + } + }); } - synchronized boolean isEmpty() { - return producers.isEmpty() && trackingConsumerTrackers.isEmpty(); + boolean isEmpty() { + return lock( + this.managerLock, () -> producers.isEmpty() && trackingConsumerTrackers.isEmpty()); } private void checkNotClosed() { @@ -930,13 +952,15 @@ boolean isClosed() { private void closeIfEmpty() { if (!closed.get()) { - synchronized (this) { - if (this.isEmpty()) { - this.close(); - } else { - LOGGER.debug("Not closing producer manager {} because it is not empty", this.id); - } - } + lock( + this.managerLock, + () -> { + if (this.isEmpty()) { + this.close(); + } else { + LOGGER.debug("Not closing producer manager {} because it is not empty", this.id); + } + }); } } From fbdd7f2d4dce0d8df1b71515855c2bbbdf511290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 11 Dec 2024 15:08:43 +0100 Subject: [PATCH 309/449] Use dynamic batch publishing by default And set initial credits to 10 by default, as dynamic batching creates smaller chunks for low ingress. --- src/docs/asciidoc/api.adoc | 6 +++--- .../com/rabbitmq/stream/ConsumerBuilder.java | 8 ++++++-- .../rabbitmq/stream/ConsumerFlowStrategy.java | 8 +++++--- .../com/rabbitmq/stream/ProducerBuilder.java | 16 ++++++++++------ .../stream/impl/StreamConsumerBuilder.java | 4 ++-- .../stream/impl/StreamProducerBuilder.java | 2 +- .../stream/impl/ConsumersCoordinatorTest.java | 2 +- .../MessageCountConsumerFlowStrategyTest.java | 4 ++-- 8 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/docs/asciidoc/api.adoc b/src/docs/asciidoc/api.adoc index c075f91453..d490a5d12b 100644 --- a/src/docs/asciidoc/api.adoc +++ b/src/docs/asciidoc/api.adoc @@ -470,7 +470,7 @@ blocking when the limit is reached. |`dynamicBatch` |Adapt batch size depending on ingress rate. -|false +|true |`confirmTimeout` |[[producer-confirm-timeout-configuration-entry]]Time before the client calls the confirm callback to signal @@ -897,11 +897,11 @@ Useful when using an external store for offset tracking. |`flow#initialCredits` |Number of credits when the subscription is created. Increase for higher throughput at the expense of memory usage. -|1 +|10 |`flow#strategy` |The `ConsumerFlowStrategy` to use. -|`ConsumerFlowStrategy#creditOnChunkArrival(1)` +|`ConsumerFlowStrategy#creditOnChunkArrival(10)` |=== [NOTE] diff --git a/src/main/java/com/rabbitmq/stream/ConsumerBuilder.java b/src/main/java/com/rabbitmq/stream/ConsumerBuilder.java index 9e391d525c..2579548c01 100644 --- a/src/main/java/com/rabbitmq/stream/ConsumerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ConsumerBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -245,10 +245,14 @@ interface FlowConfiguration { /** * The number of initial credits for the subscription. * - *

Default is 1. + *

Default is 10. * *

This calls uses {@link ConsumerFlowStrategy#creditOnChunkArrival(int)}. * + *

Use a small value like 1 for streams with large chunks (several hundreds of messages per + * chunk) and higher values (5 or more) for streams with small chunks (1 or a few messages per + * chunk). + * * @param initialCredits the number of initial credits * @return this configuration instance * @see ConsumerFlowStrategy#creditOnChunkArrival(int) diff --git a/src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java b/src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java index 3d6b6e94b1..9f32a2f9fd 100644 --- a/src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java +++ b/src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -120,13 +120,14 @@ static ConsumerFlowStrategy creditOnChunkArrival() { * * @param initialCredits number of initial credits * @return flow strategy + * @see com.rabbitmq.stream.ConsumerBuilder.FlowConfiguration#initialCredits(int) */ static ConsumerFlowStrategy creditOnChunkArrival(int initialCredits) { return new CreditOnChunkArrivalConsumerFlowStrategy(initialCredits); } /** - * Strategy that provides 1 initial credit and a credit when half of the chunk messages are + * Strategy that provides 10 initial credits and a credit when half of the chunk messages are * processed. * *

Make sure to call {@link MessageHandler.Context#processed()} on every message when using @@ -135,7 +136,7 @@ static ConsumerFlowStrategy creditOnChunkArrival(int initialCredits) { * @return flow strategy */ static ConsumerFlowStrategy creditWhenHalfMessagesProcessed() { - return creditOnProcessedMessageCount(1, 0.5); + return creditOnProcessedMessageCount(10, 0.5); } /** @@ -147,6 +148,7 @@ static ConsumerFlowStrategy creditWhenHalfMessagesProcessed() { * * @param initialCredits number of initial credits * @return flow strategy + * @see com.rabbitmq.stream.ConsumerBuilder.FlowConfiguration#initialCredits(int) */ static ConsumerFlowStrategy creditWhenHalfMessagesProcessed(int initialCredits) { return creditOnProcessedMessageCount(initialCredits, 0.5); diff --git a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java index dca01baf9f..a445dc2fb4 100644 --- a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java @@ -106,22 +106,26 @@ public interface ProducerBuilder { /** * Adapt batch size depending on ingress rate. * - *

A dynamic-batch approach improves latency for low ingress rates. It can be counterproductive - * for sustained high ingress rates. + *

A dynamic-batch approach improves latency for low ingress rates. * *

Set this flag to true if you want as little delay as possible between calling * {@link Producer#send(Message, ConfirmationHandler)} and the message being sent to the broker. + * Consumers should provide enough initial credits (between 5 and 10, depending on the workload), + * see {@link ConsumerBuilder#flow()} and {@link + * ConsumerBuilder.FlowConfiguration#initialCredits(int)}. * *

Set this flag to false if latency is not critical for your use case and you - * want the highest throughput possible for both publishing and consuming. + * want the highest throughput possible for both publishing and consuming. Consumers can provide 1 + * initial credit (depending on the workload), see {@link ConsumerBuilder#flow()} and {@link + * ConsumerBuilder.FlowConfiguration#initialCredits(int)}. * - *

Dynamic batch is not activated by default (dynamicBatch = false). - * - *

Dynamic batch is experimental. + *

Dynamic batch is activated by default (dynamicBatch = true). * * @param dynamicBatch * @return this builder instance * @since 0.20.0 + * @see ConsumerBuilder#flow() + * @see com.rabbitmq.stream.ConsumerBuilder.FlowConfiguration#initialCredits(int) */ ProducerBuilder dynamicBatch(boolean dynamicBatch); diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java index c6364d1aa3..ce8660c6a5 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -428,7 +428,7 @@ private DefaultFlowConfiguration(ConsumerBuilder consumerBuilder) { this.consumerBuilder = consumerBuilder; } - private ConsumerFlowStrategy strategy = ConsumerFlowStrategy.creditOnChunkArrival(); + private ConsumerFlowStrategy strategy = ConsumerFlowStrategy.creditOnChunkArrival(10); @Override public FlowConfiguration initialCredits(int initialCredits) { diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java index 54807489e2..244b2b1746 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java @@ -29,7 +29,7 @@ class StreamProducerBuilder implements ProducerBuilder { static final boolean DEFAULT_DYNAMIC_BATCH = - Boolean.parseBoolean(System.getProperty("rabbitmq.stream.producer.dynamic.batch", "false")); + Boolean.parseBoolean(System.getProperty("rabbitmq.stream.producer.dynamic.batch", "true")); private final StreamEnvironment environment; diff --git a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java index 3777d7e7d9..7dd5e8da48 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java @@ -665,7 +665,7 @@ void ignoredMessageShouldTriggerMessageProcessing() { new ConsumerFlowStrategy() { @Override public int initialCredits() { - return 1; + return 10; } @Override diff --git a/src/test/java/com/rabbitmq/stream/impl/MessageCountConsumerFlowStrategyTest.java b/src/test/java/com/rabbitmq/stream/impl/MessageCountConsumerFlowStrategyTest.java index 34166a8f2e..90ec80ae1c 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MessageCountConsumerFlowStrategyTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/MessageCountConsumerFlowStrategyTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -55,7 +55,7 @@ void smallChunksAndSmallRatiosShouldCredit() { } ConsumerFlowStrategy build(double ratio) { - return creditOnProcessedMessageCount(1, ratio); + return creditOnProcessedMessageCount(10, ratio); } ConsumerFlowStrategy.Context context(long messageCount) { From 3d6b1dc1d573c219c30b15c645d842a90c6ab05e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 11 Dec 2024 15:34:35 +0100 Subject: [PATCH 310/449] Use 1 initial credit in test --- .../com/rabbitmq/stream/impl/StreamConsumerTest.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java index be2dc4a8c3..b97ba4ba69 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java @@ -203,7 +203,7 @@ void consumeWithAsyncConsumerFlowControl() throws Exception { environment.consumerBuilder().stream(stream) .offset(OffsetSpecification.first()) .flow() - .strategy(creditWhenHalfMessagesProcessed()) + .strategy(creditWhenHalfMessagesProcessed(1)) .builder(); List messageContexts = synchronizedList(new ArrayList<>()); @@ -244,14 +244,13 @@ void asynchronousProcessingWithFlowControl() { int messageCount = 100_000; publishAndWaitForConfirms(cf, messageCount, stream); - ExecutorService executorService = - Executors.newFixedThreadPool(getRuntime().availableProcessors()); - try { + try (ExecutorService executorService = + Executors.newFixedThreadPool(getRuntime().availableProcessors())) { CountDownLatch latch = new CountDownLatch(messageCount); environment.consumerBuilder().stream(stream) .offset(OffsetSpecification.first()) .flow() - .strategy(creditWhenHalfMessagesProcessed()) + .strategy(creditWhenHalfMessagesProcessed(1)) .builder() .messageHandler( (ctx, message) -> @@ -262,8 +261,6 @@ void asynchronousProcessingWithFlowControl() { })) .build(); assertThat(latch).is(completed()); - } finally { - executorService.shutdownNow(); } } From dfd94df11017b76218af74497bf20b4678412ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 11 Dec 2024 15:42:51 +0100 Subject: [PATCH 311/449] Fix test --- .../java/com/rabbitmq/stream/impl/StreamConsumerTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java index b97ba4ba69..0f439df0b8 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java @@ -243,9 +243,9 @@ void consumeWithAsyncConsumerFlowControl() throws Exception { void asynchronousProcessingWithFlowControl() { int messageCount = 100_000; publishAndWaitForConfirms(cf, messageCount, stream); - - try (ExecutorService executorService = - Executors.newFixedThreadPool(getRuntime().availableProcessors())) { + ExecutorService executorService = + Executors.newFixedThreadPool(getRuntime().availableProcessors()); + try { CountDownLatch latch = new CountDownLatch(messageCount); environment.consumerBuilder().stream(stream) .offset(OffsetSpecification.first()) @@ -261,6 +261,8 @@ void asynchronousProcessingWithFlowControl() { })) .build(); assertThat(latch).is(completed()); + } finally { + executorService.shutdownNow(); } } From 0b92a794e4efc49f7c4dbe5f53c61ea4ec6d0192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 12 Dec 2024 15:15:41 +0100 Subject: [PATCH 312/449] Run only recovery tests --- .github/workflows/test-pr.yml | 48 +++++++++---------- .../stream/impl/StreamEnvironment.java | 6 +-- .../stream/impl/RecoveryClusterTest.java | 9 ++-- 3 files changed, 29 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index 380db0602c..f0e0b72e09 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -11,38 +11,38 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Checkout tls-gen - uses: actions/checkout@v4 - with: - repository: rabbitmq/tls-gen - path: './tls-gen' +# - name: Checkout tls-gen +# uses: actions/checkout@v4 +# with: +# repository: rabbitmq/tls-gen +# path: './tls-gen' - name: Set up JDK uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '21' cache: 'maven' - - name: Start broker - run: ci/start-broker.sh - - name: Test (no dynamic-batch publishing) - run: | - ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ - -Drabbitmq.stream.producer.dynamic.batch=false \ - -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ - -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ - -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem - - name: Test (dynamic-batch publishing) - run: | - ./mvnw test -Drabbitmqctl.bin=DOCKER:rabbitmq \ - -Drabbitmq.stream.producer.dynamic.batch=true \ - -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ - -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ - -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem - - name: Stop broker - run: docker stop rabbitmq && docker rm rabbitmq +# - name: Start broker +# run: ci/start-broker.sh +# - name: Test (no dynamic-batch publishing) +# run: | +# ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ +# -Drabbitmq.stream.producer.dynamic.batch=false \ +# -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ +# -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ +# -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem +# - name: Test (dynamic-batch publishing) +# run: | +# ./mvnw test -Drabbitmqctl.bin=DOCKER:rabbitmq \ +# -Drabbitmq.stream.producer.dynamic.batch=true \ +# -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ +# -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ +# -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem +# - name: Stop broker +# run: docker stop rabbitmq && docker rm rabbitmq - name: Start cluster run: ci/start-cluster.sh - name: Test against cluster - run: ./mvnw test -Dtest="*ClusterTest" -Drabbitmqctl.bin=DOCKER:rabbitmq0 + run: ./mvnw test -Dtest="RecoveryClusterTest" -Drabbitmqctl.bin=DOCKER:rabbitmq0 - name: Stop cluster run: docker compose --file ci/cluster/docker-compose.yml down diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index e9744f19f7..a4c6eaaba4 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -905,11 +905,7 @@ TrackingConsumerRegistration registerTrackingConsumer( public String toString() { return "{ \"locators\" : [" + this.locators.stream() - .map( - l -> { - Client c = l.nullableClient(); - return c == null ? "null" : ("\"" + l.label() + "\""); - }) + .map(l -> quote(l.label())) .collect(Collectors.joining(",")) + "], " + Utils.jsonField("producer_client_count", this.producersCoordinator.clientCount()) diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index d67787a610..f714e5ff6e 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -72,9 +72,8 @@ public class RecoveryClusterTest { static List logLevels; static List> logClasses = List.of( - ProducersCoordinator.class, - ConsumersCoordinator.class, - StreamEnvironment.class, +// ProducersCoordinator.class, +// ConsumersCoordinator.class, AsyncRetry.class, StreamEnvironment.class, ScheduledExecutorServiceWrapper.class); @@ -126,9 +125,9 @@ static void tearDownAll() { @ParameterizedTest @CsvSource({ - "false,false", +// "false,false", "true,true", - "true,false", +// "true,false", }) void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws InterruptedException { LOGGER.info( From bedf745bb540f3b453eb2c20feb1871ae658be60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 12 Dec 2024 17:00:54 +0100 Subject: [PATCH 313/449] Use dedicated scheduler for locator recovery --- .github/workflows/test-pr.yml | 48 +++++++++---------- .../stream/impl/StreamEnvironment.java | 21 +++++--- src/test/java/com/rabbitmq/stream/Cli.java | 15 ++++++ .../stream/impl/RecoveryClusterTest.java | 12 ++--- .../stream/impl/StreamEnvironmentTest.java | 20 +------- .../com/rabbitmq/stream/impl/TlsTest.java | 22 --------- 6 files changed, 60 insertions(+), 78 deletions(-) diff --git a/.github/workflows/test-pr.yml b/.github/workflows/test-pr.yml index f0e0b72e09..380db0602c 100644 --- a/.github/workflows/test-pr.yml +++ b/.github/workflows/test-pr.yml @@ -11,38 +11,38 @@ jobs: steps: - uses: actions/checkout@v4 -# - name: Checkout tls-gen -# uses: actions/checkout@v4 -# with: -# repository: rabbitmq/tls-gen -# path: './tls-gen' + - name: Checkout tls-gen + uses: actions/checkout@v4 + with: + repository: rabbitmq/tls-gen + path: './tls-gen' - name: Set up JDK uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '21' cache: 'maven' -# - name: Start broker -# run: ci/start-broker.sh -# - name: Test (no dynamic-batch publishing) -# run: | -# ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ -# -Drabbitmq.stream.producer.dynamic.batch=false \ -# -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -# -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ -# -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem -# - name: Test (dynamic-batch publishing) -# run: | -# ./mvnw test -Drabbitmqctl.bin=DOCKER:rabbitmq \ -# -Drabbitmq.stream.producer.dynamic.batch=true \ -# -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ -# -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ -# -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem -# - name: Stop broker -# run: docker stop rabbitmq && docker rm rabbitmq + - name: Start broker + run: ci/start-broker.sh + - name: Test (no dynamic-batch publishing) + run: | + ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ + -Drabbitmq.stream.producer.dynamic.batch=false \ + -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ + -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ + -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem + - name: Test (dynamic-batch publishing) + run: | + ./mvnw test -Drabbitmqctl.bin=DOCKER:rabbitmq \ + -Drabbitmq.stream.producer.dynamic.batch=true \ + -Dca.certificate=./tls-gen/basic/result/ca_certificate.pem \ + -Dclient.certificate=./tls-gen/basic/result/client_$(hostname)_certificate.pem \ + -Dclient.key=./tls-gen/basic/result/client_$(hostname)_key.pem + - name: Stop broker + run: docker stop rabbitmq && docker rm rabbitmq - name: Start cluster run: ci/start-cluster.sh - name: Test against cluster - run: ./mvnw test -Dtest="RecoveryClusterTest" -Drabbitmqctl.bin=DOCKER:rabbitmq0 + run: ./mvnw test -Dtest="*ClusterTest" -Drabbitmqctl.bin=DOCKER:rabbitmq0 - name: Stop cluster run: docker compose --file ci/cluster/docker-compose.yml down diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index a4c6eaaba4..4345da5caa 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -66,6 +66,7 @@ class StreamEnvironment implements Environment { private final EventLoopGroup eventLoopGroup; private final ScheduledExecutorService scheduledExecutorService; + private final ScheduledExecutorService locatorReconnectionScheduledExecutorService; private final boolean privateScheduleExecutorService; private final Client.ClientParameters clientParametersPrototype; private final List

addresses; @@ -235,17 +236,22 @@ class StreamEnvironment implements Environment { maxProducersByConnection, maxTrackingConsumersByConnection, connectionNamingStrategy, - Utils.coordinatorClientFactory(this, producerNodeRetryDelay), + coordinatorClientFactory(this, producerNodeRetryDelay), forceLeaderForProducers); this.consumersCoordinator = new ConsumersCoordinator( this, maxConsumersByConnection, connectionNamingStrategy, - Utils.coordinatorClientFactory(this, consumerNodeRetryDelay), + coordinatorClientFactory(this, consumerNodeRetryDelay), forceReplicaForConsumers, Utils.brokerPicker()); this.offsetTrackingCoordinator = new OffsetTrackingCoordinator(this); + + ThreadFactory threadFactory = threadFactory("rabbitmq-stream-environment-locator-scheduler-"); + this.locatorReconnectionScheduledExecutorService = + Executors.newScheduledThreadPool(this.locators.size(), threadFactory); + ClientParameters clientParametersForInit = locatorParametersCopy(); Runnable locatorInitSequence = () -> { @@ -291,7 +297,7 @@ class StreamEnvironment implements Environment { l, connectionNamingStrategy, clientFactory, - this.scheduledExecutorService, + this.locatorReconnectionScheduledExecutorService, this.recoveryBackOffDelayPolicy, l.label()); } @@ -338,7 +344,7 @@ private ShutdownListener shutdownListener( locator, connectionNamingStrategy, clientFactory, - this.scheduledExecutorService, + this.locatorReconnectionScheduledExecutorService, delayPolicy, label); } else { @@ -683,6 +689,9 @@ public void close() { if (privateScheduleExecutorService) { this.scheduledExecutorService.shutdownNow(); } + if (this.locatorReconnectionScheduledExecutorService != null) { + this.locatorReconnectionScheduledExecutorService.shutdownNow(); + } try { if (this.eventLoopGroup != null && (!this.eventLoopGroup.isShuttingDown() || !this.eventLoopGroup.isShutdown())) { @@ -904,9 +913,7 @@ TrackingConsumerRegistration registerTrackingConsumer( @Override public String toString() { return "{ \"locators\" : [" - + this.locators.stream() - .map(l -> quote(l.label())) - .collect(Collectors.joining(",")) + + this.locators.stream().map(l -> quote(l.label())).collect(Collectors.joining(",")) + "], " + Utils.jsonField("producer_client_count", this.producersCoordinator.clientCount()) + "," diff --git a/src/test/java/com/rabbitmq/stream/Cli.java b/src/test/java/com/rabbitmq/stream/Cli.java index e532cd508b..b02f9b8349 100644 --- a/src/test/java/com/rabbitmq/stream/Cli.java +++ b/src/test/java/com/rabbitmq/stream/Cli.java @@ -252,6 +252,15 @@ public static String rabbitmqctlCommand() { } } + private static String dockerContainer() { + if (rabbitmqctlCommand().startsWith("docker")) { + String rabbitmqCtl = System.getProperty("rabbitmqctl.bin"); + return rabbitmqCtl.split(":")[1]; + } else { + throw new IllegalStateException("Broker does not run on broker"); + } + } + private static String rabbitmqStreamsCommand() { String rabbitmqctl = rabbitmqctlCommand(); int lastIndex = rabbitmqctl.lastIndexOf("rabbitmqctl"); @@ -354,6 +363,12 @@ public static void restartNode(String node) { executeCommand(dockerCommand + "rabbitmqctl status"); } + public static void restartBrokerContainer() { + String container = dockerContainer(); + executeCommand("docker stop " + container); + executeCommand("docker start " + container); + } + public static void rebalance() { rabbitmqQueues("rebalance all"); } diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index f714e5ff6e..753d5d229d 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -72,11 +72,9 @@ public class RecoveryClusterTest { static List logLevels; static List> logClasses = List.of( -// ProducersCoordinator.class, -// ConsumersCoordinator.class, - AsyncRetry.class, - StreamEnvironment.class, - ScheduledExecutorServiceWrapper.class); + // ProducersCoordinator.class, + // ConsumersCoordinator.class, + AsyncRetry.class, StreamEnvironment.class, ScheduledExecutorServiceWrapper.class); ScheduledExecutorService scheduledExecutorService; @BeforeAll @@ -125,9 +123,9 @@ static void tearDownAll() { @ParameterizedTest @CsvSource({ -// "false,false", + "false,false", "true,true", -// "true,false", + "true,false", }) void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws InterruptedException { LOGGER.info( diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java index 3b147ed458..2e99dc438f 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java @@ -14,13 +14,9 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; +import static com.rabbitmq.stream.impl.TestUtils.*; import static com.rabbitmq.stream.impl.TestUtils.CountDownLatchConditions.completed; import static com.rabbitmq.stream.impl.TestUtils.ExceptionConditions.responseCode; -import static com.rabbitmq.stream.impl.TestUtils.latchAssert; -import static com.rabbitmq.stream.impl.TestUtils.localhost; -import static com.rabbitmq.stream.impl.TestUtils.localhostTls; -import static com.rabbitmq.stream.impl.TestUtils.streamName; -import static com.rabbitmq.stream.impl.TestUtils.waitAtMost; import static java.util.concurrent.TimeUnit.SECONDS; import static java.util.stream.Collectors.toList; import static java.util.stream.IntStream.range; @@ -57,7 +53,6 @@ import io.netty.channel.EventLoopGroup; import io.netty.channel.epoll.EpollEventLoopGroup; import io.netty.channel.epoll.EpollSocketChannel; -import io.netty.channel.nio.NioEventLoopGroup; import io.netty.handler.ssl.SslHandler; import java.net.ConnectException; import java.nio.charset.StandardCharsets; @@ -92,22 +87,11 @@ @ExtendWith(TestUtils.StreamTestInfrastructureExtension.class) public class StreamEnvironmentTest { - static EventLoopGroup eventLoopGroup; - EnvironmentBuilder environmentBuilder; String stream; TestUtils.ClientFactory cf; - - @BeforeAll - static void initAll() { - eventLoopGroup = new NioEventLoopGroup(); - } - - @AfterAll - static void afterAll() throws Exception { - eventLoopGroup.shutdownGracefully(1, 10, SECONDS).get(10, SECONDS); - } + EventLoopGroup eventLoopGroup; @BeforeEach void init() { diff --git a/src/test/java/com/rabbitmq/stream/impl/TlsTest.java b/src/test/java/com/rabbitmq/stream/impl/TlsTest.java index 04964069d6..78e4b4e8de 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TlsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/TlsTest.java @@ -56,8 +56,6 @@ import javax.net.ssl.SSLException; import javax.net.ssl.SSLHandshakeException; import javax.net.ssl.SSLParameters; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -65,26 +63,6 @@ @ExtendWith(TestUtils.StreamTestInfrastructureExtension.class) public class TlsTest { - static boolean isJava13() { - String javaVersion = System.getProperty("java.version"); - return javaVersion != null && javaVersion.startsWith("13."); - } - - @BeforeEach - public void init() { - if (isJava13()) { - // for Java 13.0.7, see https://github.com/bcgit/bc-java/issues/941 - System.setProperty("keystore.pkcs12.keyProtectionAlgorithm", "PBEWithHmacSHA256AndAES_256"); - } - } - - @AfterEach - public void tearDown() throws Exception { - if (isJava13()) { - System.setProperty("keystore.pkcs12.keyProtectionAlgorithm", ""); - } - } - String stream; TestUtils.ClientFactory cf; From fd43ad66df6a4f8b60b9ffe6c15f721d26248cd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:12:48 +0000 Subject: [PATCH 314/449] Bump com.google.googlejavaformat:google-java-format Bumps [com.google.googlejavaformat:google-java-format](https://github.com/google/google-java-format) from 1.25.1 to 1.25.2. - [Release notes](https://github.com/google/google-java-format/releases) - [Commits](https://github.com/google/google-java-format/compare/v1.25.1...v1.25.2) --- updated-dependencies: - dependency-name: com.google.googlejavaformat:google-java-format dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9401c07fc3..35fe87d4b6 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ 3.2.1 1.37 2.43.0 - 1.25.1 + 1.25.2 0.8.12 4.8.6.6 4.8.6 From 16065a198c4d6a50d4870f94573c21780d5a1c93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 12 Dec 2024 18:38:41 +0100 Subject: [PATCH 315/449] Schedule CI run on every hour Temporary. --- .github/workflows/test-rabbitmq-alphas.yml | 2 +- .github/workflows/test-supported-java-versions.yml | 2 +- .github/workflows/test.yml | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index b707dc290a..7ff23285f2 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -2,7 +2,7 @@ name: Test against RabbitMQ alphas on: schedule: - - cron: '0 4 * * *' + - cron: '0 * * * *' push: branches: - main diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index 60774e07b4..07ab78ba71 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -2,7 +2,7 @@ name: Test against supported Java versions on: schedule: - - cron: '0 4 * * *' + - cron: '0 * * * *' workflow_dispatch: jobs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 523b05cbf9..a013a00145 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,6 +5,8 @@ on: branches: - main workflow_dispatch: + schedule: + - cron: '0 * * * *' env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From daf56e3add8020f70b26de703b90e5cceb7a2aa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 13 Dec 2024 10:33:29 +0100 Subject: [PATCH 316/449] Make sure stream has replicas in test --- src/test/java/com/rabbitmq/stream/Cli.java | 21 +------------------ .../stream/impl/LoadBalancerClusterTest.java | 7 ++++++- .../com/rabbitmq/stream/impl/TestUtils.java | 18 +++++----------- 3 files changed, 12 insertions(+), 34 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/Cli.java b/src/test/java/com/rabbitmq/stream/Cli.java index b02f9b8349..97908eb08f 100644 --- a/src/test/java/com/rabbitmq/stream/Cli.java +++ b/src/test/java/com/rabbitmq/stream/Cli.java @@ -26,13 +26,9 @@ import java.util.*; import java.util.concurrent.Callable; import java.util.stream.Collectors; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class Cli { - private static final Logger LOGGER = LoggerFactory.getLogger(Cli.class); - private static final String DOCKER_PREFIX = "DOCKER:"; private static final Gson GSON = new Gson(); @@ -252,15 +248,6 @@ public static String rabbitmqctlCommand() { } } - private static String dockerContainer() { - if (rabbitmqctlCommand().startsWith("docker")) { - String rabbitmqCtl = System.getProperty("rabbitmqctl.bin"); - return rabbitmqCtl.split(":")[1]; - } else { - throw new IllegalStateException("Broker does not run on broker"); - } - } - private static String rabbitmqStreamsCommand() { String rabbitmqctl = rabbitmqctlCommand(); int lastIndex = rabbitmqctl.lastIndexOf("rabbitmqctl"); @@ -314,7 +301,7 @@ private static void setResourceAlarm(String source) throws IOException { rabbitmqctl("eval 'rabbit_alarm:set_alarm({{resource_limit, " + source + ", node()}, []}).'"); } - private static void clearResourceAlarm(String source) throws IOException { + private static void clearResourceAlarm(String source) { rabbitmqctl("eval 'rabbit_alarm:clear_alarm({resource_limit, " + source + ", node()}).'"); } @@ -363,12 +350,6 @@ public static void restartNode(String node) { executeCommand(dockerCommand + "rabbitmqctl status"); } - public static void restartBrokerContainer() { - String container = dockerContainer(); - executeCommand("docker stop " + container); - executeCommand("docker start " + container); - } - public static void rebalance() { rabbitmqQueues("rebalance all"); } diff --git a/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java index 08cb66a474..09f43baee8 100644 --- a/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java @@ -15,6 +15,7 @@ package com.rabbitmq.stream.impl; import static com.rabbitmq.stream.impl.Assertions.assertThat; +import static com.rabbitmq.stream.impl.TestUtils.waitAtMost; import static java.lang.Integer.parseInt; import static java.util.stream.Collectors.toSet; import static java.util.stream.IntStream.range; @@ -79,7 +80,7 @@ void tearDown() throws Exception { @ParameterizedTest @ValueSource(booleans = {false, true}) - void pickConsumersAmongCandidates(boolean forceReplica) { + void pickConsumersAmongCandidates(boolean forceReplica) throws Exception { int maxSubscriptionsPerClient = 2; int subscriptionCount = maxSubscriptionsPerClient * 10; try (ConsumersCoordinator c = @@ -91,6 +92,10 @@ void pickConsumersAmongCandidates(boolean forceReplica) { forceReplica, Utils.brokerPicker())) { + waitAtMost( + () -> locator.metadata(stream).get(stream).hasReplicas(), + "Stream '%s' should have replicas"); + range(0, subscriptionCount) .forEach( ignored -> { diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index b38a82da76..19fc9c7f2d 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -44,10 +44,7 @@ import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.vavr.Tuple2; -import java.io.BufferedReader; import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -97,6 +94,11 @@ public static Duration waitAtMost(CallableBooleanSupplier condition) throws Exce return waitAtMost(DEFAULT_CONDITION_TIMEOUT, condition, null); } + public static Duration waitAtMost( + CallableBooleanSupplier condition, String format, Object... args) throws Exception { + return waitAtMost(DEFAULT_CONDITION_TIMEOUT, condition, () -> String.format(format, args)); + } + public static Duration waitAtMost(CallableBooleanSupplier condition, Supplier message) throws Exception { return waitAtMost(DEFAULT_CONDITION_TIMEOUT, condition, message); @@ -384,16 +386,6 @@ static boolean isCluster() { return !content.replace("[", "").replace("]", "").trim().isEmpty(); } - private static String capture(InputStream is) throws IOException { - BufferedReader br = new BufferedReader(new InputStreamReader(is)); - String line; - StringBuilder buff = new StringBuilder(); - while ((line = br.readLine()) != null) { - buff.append(line).append("\n"); - } - return buff.toString(); - } - static void forEach(Collection in, CallableIndexConsumer consumer) throws Exception { int count = 0; for (T t : in) { From 03b7869c4882390892ffdaedd26823d17bbd41b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 13 Dec 2024 10:36:09 +0100 Subject: [PATCH 317/449] Run CI workflows at night --- .github/workflows/test-rabbitmq-alphas.yml | 2 +- .github/workflows/test-supported-java-versions.yml | 2 +- .github/workflows/test.yml | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index 7ff23285f2..b707dc290a 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -2,7 +2,7 @@ name: Test against RabbitMQ alphas on: schedule: - - cron: '0 * * * *' + - cron: '0 4 * * *' push: branches: - main diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index 07ab78ba71..05834c9d78 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -2,7 +2,7 @@ name: Test against supported Java versions on: schedule: - - cron: '0 * * * *' + - cron: '0 3 * * *' workflow_dispatch: jobs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a013a00145..523b05cbf9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,8 +5,6 @@ on: branches: - main workflow_dispatch: - schedule: - - cron: '0 * * * *' env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 468c02f4b0a11a1f39935bdce9ce58c0c51e5959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 13 Dec 2024 11:09:44 +0100 Subject: [PATCH 318/449] Bump Java client to 5.24.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 35fe87d4b6..0e97ec53cf 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 5.11.3 3.26.3 5.14.2 - 5.23.0 + 5.24.0 3.17.0 1.17.1 2.11.0 From d5375b09e3cd2eb9880095d96b5309cc4e18def2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 13 Dec 2024 11:37:19 +0100 Subject: [PATCH 319/449] Prepare for 0.21.0 release --- .github/workflows/sanity-check.yml | 6 +++--- release-versions.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sanity-check.yml b/.github/workflows/sanity-check.yml index b8f9db90b6..26112a1d5f 100644 --- a/.github/workflows/sanity-check.yml +++ b/.github/workflows/sanity-check.yml @@ -4,10 +4,10 @@ on: workflow_dispatch: inputs: library_version: - description: 'Library version (e.g. 0.15.0)' + description: 'Library version (e.g. 0.21.0)' required: true type: string - default: '0.15.0' + default: '0.21.0' jobs: build: @@ -34,4 +34,4 @@ jobs: env: RABBITMQ_LIBRARY_VERSION: ${{ inputs.library_version }} - name: Stop broker - run: docker stop rabbitmq && docker rm rabbitmq \ No newline at end of file + run: docker stop rabbitmq && docker rm rabbitmq diff --git a/release-versions.txt b/release-versions.txt index 4dc23ed6f3..f724bf031a 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,5 +1,5 @@ RELEASE_VERSION="0.21.0" -DEVELOPMENT_VERSION="0.21.0-SNAPSHOT" +DEVELOPMENT_VERSION="0.22.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 3834630c6aa6d9d24931ec590fbfe7c7ea2a940a Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Fri, 13 Dec 2024 10:39:44 +0000 Subject: [PATCH 320/449] [maven-release-plugin] prepare release v0.21.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0e97ec53cf..324f2bfa12 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.21.0-SNAPSHOT + 0.21.0 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.21.0 From da8d40d67a9e6eff50c28e7ec9a6d3f3ca5e052a Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Fri, 13 Dec 2024 10:39:46 +0000 Subject: [PATCH 321/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 324f2bfa12..c1bd7ccda0 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.21.0 + 0.22.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.21.0 + HEAD From 963c3aef54bba2a58bb9498cd15c452e5c583e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 13 Dec 2024 11:57:55 +0100 Subject: [PATCH 322/449] Edit readme --- README.adoc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.adoc b/README.adoc index 3d514fd899..5aa224d286 100644 --- a/README.adoc +++ b/README.adoc @@ -6,9 +6,8 @@ image:https://codecov.io/gh/rabbitmq/rabbitmq-stream-java-client/branch/main/gra The RabbitMQ Stream Java Client is a Java library to communicate with the https://rabbitmq.com/stream.html[RabbitMQ Stream Plugin]. -It allows to create and delete streams, as well as to publish to and consume from -these streams. -This library requires at least Java 8, but Java 11 or more is recommended. +It allows to create and delete streams, as well as to publish to and consume from these streams. +This library requires at least Java 11 but Java 21 or more is recommended. See the https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmlsingle/#stream-client-overview[overview] for a quick glance at the features. https://github.com/rabbitmq/rabbitmq-stream-perf-test[Stream PerfTest] is a performance testing tool based on this client library. @@ -115,7 +114,7 @@ Please launch the `./mvnw spotless:apply` command to format your changes before == Copyright and License -(c) 2020-2024, 2024 Broadcom. All Rights Reserved. +(c) 2020-2024 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. Double licensed under the MPL2.0 and ASL2. See link:LICENSE[LICENSE] for details. From 6a447923e49055e04e6a9905287c736ae157e4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 16 Dec 2024 14:46:48 +0100 Subject: [PATCH 323/449] Fix SAC test Some confusion between the 2 consumers used in the test. --- .../stream/impl/SacStreamConsumerTest.java | 40 ++++++++----------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java index 44ab97e806..c0d2463168 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java @@ -25,6 +25,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; +import java.util.function.BiConsumer; import java.util.stream.Stream; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -119,24 +120,24 @@ void autoTrackingSecondConsumerShouldTakeOverWhereTheFirstOneLeftOff() throws Ex void manualTrackingSecondConsumerShouldTakeOverWhereTheFirstOneLeftOff() throws Exception { int messageCount = 10000; int storeEvery = 1000; - Map receivedMessages = new ConcurrentHashMap<>(); - receivedMessages.put(0, new AtomicInteger(0)); - receivedMessages.put(1, new AtomicInteger(0)); + AtomicInteger consumer1MessageCount = new AtomicInteger(0); + AtomicInteger consumer2MessageCount = new AtomicInteger(0); AtomicLong lastReceivedOffset = new AtomicLong(0); String consumerName = "foo"; + BiConsumer handler = + (ctx, count) -> { + lastReceivedOffset.set(ctx.offset()); + if (count.incrementAndGet() % storeEvery == 0) { + ctx.storeOffset(); + } + }; + Consumer consumer1 = environment.consumerBuilder().stream(stream) .name(consumerName) .singleActiveConsumer() - .messageHandler( - (context, message) -> { - lastReceivedOffset.set(context.offset()); - int count = receivedMessages.get(0).incrementAndGet(); - if (count % storeEvery == 0) { - context.storeOffset(); - } - }) + .messageHandler((context, message) -> handler.accept(context, consumer1MessageCount)) .offset(OffsetSpecification.first()) .manualTrackingStrategy() .builder() @@ -146,24 +147,17 @@ void manualTrackingSecondConsumerShouldTakeOverWhereTheFirstOneLeftOff() throws environment.consumerBuilder().stream(stream) .name(consumerName) .singleActiveConsumer() - .messageHandler( - (context, message) -> { - lastReceivedOffset.set(context.offset()); - int count = receivedMessages.get(1).incrementAndGet(); - if (count % storeEvery == 0) { - context.storeOffset(); - } - }) + .messageHandler((context, message) -> handler.accept(context, consumer2MessageCount)) .offset(OffsetSpecification.first()) .manualTrackingStrategy() .builder() .build(); publishAndWaitForConfirms(cf, messageCount, stream); - waitAtMost(() -> receivedMessages.getOrDefault(0, new AtomicInteger(0)).get() == messageCount); + waitAtMost(() -> consumer1MessageCount.get() == messageCount); assertThat(lastReceivedOffset).hasPositiveValue(); - assertThat(receivedMessages.get(1)).hasValue(0); + assertThat(consumer2MessageCount).hasValue(0); long firstWaveLimit = lastReceivedOffset.get(); @@ -174,9 +168,9 @@ void manualTrackingSecondConsumerShouldTakeOverWhereTheFirstOneLeftOff() throws publishAndWaitForConfirms(cf, messageCount, stream); - waitAtMost(() -> receivedMessages.getOrDefault(0, new AtomicInteger(1)).get() == messageCount); + waitAtMost(() -> consumer2MessageCount.get() == messageCount); assertThat(lastReceivedOffset).hasValueGreaterThan(firstWaveLimit); - assertThat(receivedMessages.get(0)).hasValue(messageCount); + assertThat(consumer1MessageCount).hasValue(messageCount); consumer2.close(); } From 8d34963fd994c2c3e3e3c77dce6142adfa7a56ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:10:58 +0000 Subject: [PATCH 324/449] Bump org.junit:junit-bom from 5.11.3 to 5.11.4 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.11.3 to 5.11.4. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.11.3...r5.11.4) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c1bd7ccda0..4b83dbbc47 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.5.6-8 1.8.0 1.1.10.7 - 5.11.3 + 5.11.4 3.26.3 5.14.2 5.24.0 From 420e40cee5b83cbcb7c9099ac73f05d635646651 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:03:56 +0000 Subject: [PATCH 325/449] Bump netty.version from 4.1.115.Final to 4.1.116.Final Bumps `netty.version` from 4.1.115.Final to 4.1.116.Final. Updates `io.netty:netty-transport` from 4.1.115.Final to 4.1.116.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.115.Final...netty-4.1.116.Final) Updates `io.netty:netty-codec` from 4.1.115.Final to 4.1.116.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.115.Final...netty-4.1.116.Final) Updates `io.netty:netty-handler` from 4.1.115.Final to 4.1.116.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.115.Final...netty-4.1.116.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.115.Final to 4.1.116.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.115.Final...netty-4.1.116.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4b83dbbc47..c3787c6cd2 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.115.Final + 4.1.116.Final 0.34.1 4.2.29 1.14.2 From 979526bb42837bab38e3fdbabedc2b9c04b5bd0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 18 Dec 2024 09:48:35 +0100 Subject: [PATCH 326/449] Null-check connection name in test --- .../java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java index 2e99dc438f..ff3b1dd609 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java @@ -408,12 +408,12 @@ void shouldHaveSeveralLocatorsWhenSeveralUrisSpecifiedAndShouldRecoverThemIfClos () -> Cli.listConnections().stream() .map(ConnectionInfo::clientProvidedName) - .filter(name -> name.contains("-locator-")) + .filter(name -> name != null && name.contains("-locator-")) .collect(toList()); List locatorConnectionNames = locatorConnectionNamesSupplier.get(); assertThat(locatorConnectionNames).hasSameSizeAs(uris); - locatorConnectionNames.forEach(connectionName -> Cli.killConnection(connectionName)); + locatorConnectionNames.forEach(Cli::killConnection); environment.streamCreator().stream(s).create(); try { From 2c219c65028797c1dbfcafc8366a982a10e3831e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 19 Dec 2024 11:16:53 +0100 Subject: [PATCH 327/449] Log more info in cluster test --- .../stream/impl/ProducersCoordinator.java | 2 +- .../stream/impl/RecoveryClusterTest.java | 23 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java index 62c98434fb..4dd16f80e9 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java @@ -750,7 +750,7 @@ private void assignProducersToNewManagers( List candidates = brokerAndCandidates.v2(); String key = keyForNode(broker); LOGGER.debug( - "Assigning {} producer(s) and consumer tracker(s) to {}", trackers.size(), key); + "Assigning {} producer(s) and consumer tracker(s) to {} (stream '{}')", trackers.size(), key, stream); trackers.forEach(tracker -> maybeRecoverAgent(broker, candidates, tracker)); }) .exceptionally( diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index 753d5d229d..f90056451d 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -34,6 +34,9 @@ import io.netty.channel.EventLoopGroup; import java.nio.charset.StandardCharsets; import java.time.Duration; +import java.time.Instant; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; import java.util.Collections; import java.util.LinkedHashMap; import java.util.List; @@ -251,6 +254,11 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru LOGGER.info("Environment information:"); System.out.println(TestUtils.jsonPrettyPrint(environment.toString())); + LOGGER.info("Producer information:"); + producers.forEach(p -> { + LOGGER.info("Producer to '{}' (last exception: '{}')", p.stream(), p.lastException); + }); + LOGGER.info("Closing producers"); producers.forEach( p -> { @@ -293,6 +301,8 @@ private static class ProducerState implements AutoCloseable { final AtomicBoolean stopped = new AtomicBoolean(false); final AtomicInteger acceptedCount = new AtomicInteger(); final AtomicReference postConfirmed = new AtomicReference<>(() -> {}); + final AtomicReference lastException = new AtomicReference<>(); + final AtomicReference lastExceptionInstant = new AtomicReference<>(); private ProducerState(String stream, boolean dynamicBatch, Environment environment) { this.stream = stream; @@ -317,8 +327,9 @@ void start() { this.limiter.acquire(1); this.producer.send( producer.messageBuilder().addData(BODY).build(), confirmationHandler); - } catch (Exception e) { - + } catch (Throwable e) { + this.lastException.set(e); + this.lastExceptionInstant.set(Instant.now()); } } }); @@ -342,6 +353,14 @@ String stream() { return this.stream; } + String lastException() { + if (this.lastException.get() == null) { + return "no exception"; + } else { + return this.lastException.get().getMessage() + " at " + DateTimeFormatter.ISO_LOCAL_TIME.format(lastExceptionInstant.get()); + } + } + @Override public void close() { stopped.set(true); From 4c49b3d730c7bbde39826926413c829b1eb02024 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:11:48 +0000 Subject: [PATCH 328/449] Bump org.assertj:assertj-core from 3.26.3 to 3.27.0 Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.26.3 to 3.27.0. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.26.3...assertj-build-3.27.0) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c3787c6cd2..62d4d720ee 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.8.0 1.1.10.7 5.11.4 - 3.26.3 + 3.27.0 5.14.2 5.24.0 3.17.0 From f874796a16cca6dd8723eda8144cb70e2c70fe4b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:39:17 +0000 Subject: [PATCH 329/449] Bump org.assertj:assertj-core from 3.27.0 to 3.27.1 Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.27.0 to 3.27.1. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.27.0...assertj-build-3.27.1) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 62d4d720ee..d627290634 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.8.0 1.1.10.7 5.11.4 - 3.27.0 + 3.27.1 5.14.2 5.24.0 3.17.0 From ffd9264adbd82e997859844695cfde39b4aeffd1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:39:21 +0000 Subject: [PATCH 330/449] Bump com.github.luben:zstd-jni from 1.5.6-8 to 1.5.6-9 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.6-8 to 1.5.6-9. - [Commits](https://github.com/luben/zstd-jni/compare/v1.5.6-8...v1.5.6-9) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 62d4d720ee..2a25d7534a 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 12.2.2 4.7.5 1.27.1 - 1.5.6-8 + 1.5.6-9 1.8.0 1.1.10.7 5.11.4 From cbf741dc34f655df2036106c673f2930e37dc8cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:34:45 +0000 Subject: [PATCH 331/449] Bump org.mockito:mockito-core from 5.14.2 to 5.15.2 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.14.2 to 5.15.2. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.14.2...v5.15.2) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8123a2964f..39c079458c 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.1.10.7 5.11.4 3.27.1 - 5.14.2 + 5.15.2 5.24.0 3.17.0 1.17.1 From 100355ceccca0faec85ff9a833c0f37f59a0a60a Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Fri, 3 Jan 2025 15:48:12 -0500 Subject: [PATCH 332/449] Bump (c) year to 2025 --- LICENSE-APACHE2 | 2 +- LICENSE-MPL-RabbitMQ | 2 +- README.adoc | 2 +- src/main/java/com/rabbitmq/stream/Address.java | 2 +- src/main/java/com/rabbitmq/stream/AddressResolver.java | 2 +- .../rabbitmq/stream/AuthenticationFailureException.java | 2 +- src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java | 2 +- src/main/java/com/rabbitmq/stream/ByteCapacity.java | 2 +- src/main/java/com/rabbitmq/stream/ChunkChecksum.java | 2 +- .../rabbitmq/stream/ChunkChecksumValidationException.java | 2 +- src/main/java/com/rabbitmq/stream/Codec.java | 2 +- .../java/com/rabbitmq/stream/ConfirmationHandler.java | 2 +- src/main/java/com/rabbitmq/stream/ConfirmationStatus.java | 2 +- src/main/java/com/rabbitmq/stream/Constants.java | 2 +- src/main/java/com/rabbitmq/stream/Consumer.java | 2 +- src/main/java/com/rabbitmq/stream/ConsumerBuilder.java | 2 +- .../java/com/rabbitmq/stream/ConsumerFlowStrategy.java | 2 +- .../java/com/rabbitmq/stream/ConsumerUpdateListener.java | 2 +- src/main/java/com/rabbitmq/stream/Environment.java | 2 +- src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java | 2 +- src/main/java/com/rabbitmq/stream/Message.java | 2 +- src/main/java/com/rabbitmq/stream/MessageBuilder.java | 2 +- src/main/java/com/rabbitmq/stream/MessageHandler.java | 2 +- src/main/java/com/rabbitmq/stream/NoOffsetException.java | 2 +- .../java/com/rabbitmq/stream/ObservationCollector.java | 2 +- .../java/com/rabbitmq/stream/OffsetSpecification.java | 2 +- src/main/java/com/rabbitmq/stream/Producer.java | 2 +- src/main/java/com/rabbitmq/stream/ProducerBuilder.java | 2 +- src/main/java/com/rabbitmq/stream/Properties.java | 2 +- src/main/java/com/rabbitmq/stream/RoutingStrategy.java | 2 +- src/main/java/com/rabbitmq/stream/StreamCreator.java | 2 +- .../com/rabbitmq/stream/StreamDoesNotExistException.java | 2 +- src/main/java/com/rabbitmq/stream/StreamException.java | 2 +- .../com/rabbitmq/stream/StreamNotAvailableException.java | 2 +- src/main/java/com/rabbitmq/stream/StreamStats.java | 2 +- .../java/com/rabbitmq/stream/SubscriptionListener.java | 2 +- src/main/java/com/rabbitmq/stream/amqp/Symbol.java | 2 +- src/main/java/com/rabbitmq/stream/amqp/UnsignedByte.java | 2 +- .../java/com/rabbitmq/stream/amqp/UnsignedInteger.java | 2 +- src/main/java/com/rabbitmq/stream/amqp/UnsignedLong.java | 2 +- src/main/java/com/rabbitmq/stream/amqp/UnsignedShort.java | 2 +- .../java/com/rabbitmq/stream/codec/QpidProtonCodec.java | 2 +- .../rabbitmq/stream/codec/QpidProtonMessageBuilder.java | 2 +- src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java | 2 +- src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java | 2 +- .../com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java | 2 +- .../com/rabbitmq/stream/codec/WrapperMessageBuilder.java | 2 +- .../CommonsCompressCompressionCodecFactory.java | 2 +- .../java/com/rabbitmq/stream/compression/Compression.java | 2 +- .../com/rabbitmq/stream/compression/CompressionCodec.java | 2 +- .../stream/compression/CompressionCodecFactory.java | 2 +- .../rabbitmq/stream/compression/CompressionException.java | 2 +- .../com/rabbitmq/stream/compression/CompressionUtils.java | 2 +- .../compression/DefaultCompressionCodecFactory.java | 2 +- src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java | 2 +- src/main/java/com/rabbitmq/stream/impl/Client.java | 2 +- .../java/com/rabbitmq/stream/impl/ClientProperties.java | 4 ++-- src/main/java/com/rabbitmq/stream/impl/Clock.java | 2 +- src/main/java/com/rabbitmq/stream/impl/Codecs.java | 2 +- .../java/com/rabbitmq/stream/impl/CompressionCodecs.java | 2 +- .../java/com/rabbitmq/stream/impl/ConcurrencyUtils.java | 2 +- .../rabbitmq/stream/impl/ConnectionStreamException.java | 2 +- .../com/rabbitmq/stream/impl/ConsumersCoordinator.java | 2 +- .../stream/impl/DefaultExecutorServiceFactory.java | 2 +- src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java | 2 +- .../stream/impl/DynamicBatchMessageAccumulator.java | 2 +- .../com/rabbitmq/stream/impl/ExecutorServiceFactory.java | 2 +- .../com/rabbitmq/stream/impl/HashRoutingStrategy.java | 2 +- src/main/java/com/rabbitmq/stream/impl/HashUtils.java | 2 +- .../java/com/rabbitmq/stream/impl/JdkChunkChecksum.java | 2 +- .../java/com/rabbitmq/stream/impl/MessageAccumulator.java | 2 +- src/main/java/com/rabbitmq/stream/impl/MessageBatch.java | 2 +- .../rabbitmq/stream/impl/OffsetTrackingCoordinator.java | 2 +- .../rabbitmq/stream/impl/ParameterizedTypeReference.java | 2 +- src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java | 2 +- .../com/rabbitmq/stream/impl/ProducersCoordinator.java | 2 +- .../rabbitmq/stream/impl/RoutingKeyRoutingStrategy.java | 2 +- .../stream/impl/ScheduledExecutorServiceWrapper.java | 2 +- .../java/com/rabbitmq/stream/impl/ServerFrameHandler.java | 2 +- .../rabbitmq/stream/impl/SimpleMessageAccumulator.java | 2 +- .../java/com/rabbitmq/stream/impl/StreamConsumer.java | 2 +- .../com/rabbitmq/stream/impl/StreamConsumerBuilder.java | 2 +- .../java/com/rabbitmq/stream/impl/StreamEnvironment.java | 2 +- .../rabbitmq/stream/impl/StreamEnvironmentBuilder.java | 2 +- .../java/com/rabbitmq/stream/impl/StreamProducer.java | 2 +- .../com/rabbitmq/stream/impl/StreamProducerBuilder.java | 2 +- .../com/rabbitmq/stream/impl/StreamStreamCreator.java | 2 +- .../rabbitmq/stream/impl/SubEntryMessageAccumulator.java | 2 +- .../com/rabbitmq/stream/impl/SuperStreamConsumer.java | 2 +- .../com/rabbitmq/stream/impl/SuperStreamProducer.java | 2 +- src/main/java/com/rabbitmq/stream/impl/ThreadUtils.java | 2 +- .../com/rabbitmq/stream/impl/TimeoutStreamException.java | 2 +- src/main/java/com/rabbitmq/stream/impl/Tuples.java | 2 +- src/main/java/com/rabbitmq/stream/impl/Utils.java | 2 +- .../stream/metrics/DropwizardMetricsCollector.java | 2 +- .../com/rabbitmq/stream/metrics/MetricsCollector.java | 2 +- .../stream/metrics/MicrometerMetricsCollector.java | 2 +- .../com/rabbitmq/stream/metrics/NoOpMetricsCollector.java | 2 +- .../micrometer/DefaultProcessObservationConvention.java | 2 +- .../micrometer/DefaultPublishObservationConvention.java | 2 +- .../micrometer/MicrometerObservationCollector.java | 2 +- .../micrometer/MicrometerObservationCollectorBuilder.java | 2 +- .../stream/observation/micrometer/ProcessContext.java | 2 +- .../micrometer/ProcessObservationConvention.java | 2 +- .../stream/observation/micrometer/PublishContext.java | 2 +- .../micrometer/PublishObservationConvention.java | 2 +- .../micrometer/StreamObservationDocumentation.java | 2 +- .../com/rabbitmq/stream/sasl/AnonymousSaslMechanism.java | 2 +- .../com/rabbitmq/stream/sasl/CredentialsProvider.java | 2 +- .../rabbitmq/stream/sasl/DefaultSaslConfiguration.java | 2 +- .../sasl/DefaultUsernamePasswordCredentialsProvider.java | 2 +- .../com/rabbitmq/stream/sasl/ExternalSaslMechanism.java | 2 +- .../com/rabbitmq/stream/sasl/JdkSaslConfiguration.java | 2 +- .../java/com/rabbitmq/stream/sasl/PlainSaslMechanism.java | 2 +- .../java/com/rabbitmq/stream/sasl/SaslConfiguration.java | 2 +- src/main/java/com/rabbitmq/stream/sasl/SaslMechanism.java | 2 +- .../com/rabbitmq/stream/sasl/StreamSaslException.java | 2 +- .../stream/sasl/UsernamePasswordCredentialsProvider.java | 2 +- .../java/com/rabbitmq/stream/BackOffDelayPolicyTest.java | 2 +- src/test/java/com/rabbitmq/stream/ByteCapacityTest.java | 2 +- src/test/java/com/rabbitmq/stream/Cli.java | 2 +- src/test/java/com/rabbitmq/stream/CliTest.java | 8 ++++---- .../java/com/rabbitmq/stream/DefaultEnvironmentTest.java | 2 +- .../stream/benchmark/ChecksumAlgorithmBenchmark.java | 2 +- .../stream/benchmark/CompressDecompressBenchmark.java | 2 +- .../EncodeDecodeForPerformanceToolBenchmark.java | 2 +- .../stream/benchmark/EncodingDecodingBenchmark.java | 2 +- .../com/rabbitmq/stream/benchmark/FilteringBenchmark.java | 2 +- .../rabbitmq/stream/benchmark/HashAlgorithmBenchmark.java | 2 +- .../com/rabbitmq/stream/benchmark/ModuloBenchmark.java | 2 +- src/test/java/com/rabbitmq/stream/codec/CodecsTest.java | 2 +- src/test/java/com/rabbitmq/stream/docs/ConsumerUsage.java | 2 +- .../java/com/rabbitmq/stream/docs/EnvironmentUsage.java | 2 +- .../java/com/rabbitmq/stream/docs/FilteringUsage.java | 2 +- src/test/java/com/rabbitmq/stream/docs/ProducerUsage.java | 2 +- .../java/com/rabbitmq/stream/docs/SampleApplication.java | 2 +- .../java/com/rabbitmq/stream/docs/SuperStreamUsage.java | 2 +- src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java | 2 +- .../rabbitmq/stream/impl/Amqp10InteroperabilityTest.java | 2 +- .../rabbitmq/stream/impl/AmqpInteroperabilityTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/Assertions.java | 2 +- .../java/com/rabbitmq/stream/impl/AsyncRetryTest.java | 2 +- .../java/com/rabbitmq/stream/impl/AuthenticationTest.java | 2 +- .../java/com/rabbitmq/stream/impl/AuthorisationTest.java | 2 +- .../com/rabbitmq/stream/impl/ClientFlowControlTest.java | 2 +- .../com/rabbitmq/stream/impl/ClientParametersTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/ClientTest.java | 2 +- .../com/rabbitmq/stream/impl/CompressionCodecsTest.java | 2 +- .../rabbitmq/stream/impl/ConsumersCoordinatorTest.java | 2 +- .../stream/impl/DefaultExecutorServiceFactoryTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/DeliveryTest.java | 2 +- .../java/com/rabbitmq/stream/impl/DynamicBatchTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/FilteringTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/FrameTest.java | 2 +- .../com/rabbitmq/stream/impl/HashRoutingStrategyTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/HashUtilsTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/HeartbeatTest.java | 2 +- .../com/rabbitmq/stream/impl/JdkChunkChecksumTest.java | 2 +- .../com/rabbitmq/stream/impl/LoadBalancerClusterTest.java | 2 +- .../stream/impl/MessageCountConsumerFlowStrategyTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/MetadataTest.java | 2 +- .../com/rabbitmq/stream/impl/MetricsCollectionTest.java | 2 +- .../com/rabbitmq/stream/impl/MonitoringTestUtils.java | 2 +- .../rabbitmq/stream/impl/MqttInteroperabilityTest.java | 2 +- .../java/com/rabbitmq/stream/impl/NotificationTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/OffsetTest.java | 2 +- .../stream/impl/OffsetTrackingCoordinatorTest.java | 2 +- .../java/com/rabbitmq/stream/impl/OffsetTrackingTest.java | 2 +- .../rabbitmq/stream/impl/OutboundMappingCallbackTest.java | 2 +- .../rabbitmq/stream/impl/ProducersCoordinatorTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/PublisherTest.java | 2 +- .../com/rabbitmq/stream/impl/RecoveryClusterTest.java | 2 +- .../com/rabbitmq/stream/impl/RetentionClientTest.java | 2 +- .../com/rabbitmq/stream/impl/RoutePartitionsTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/SacClientTest.java | 2 +- .../com/rabbitmq/stream/impl/SacStreamConsumerTest.java | 2 +- .../rabbitmq/stream/impl/SacSuperStreamConsumerTest.java | 2 +- .../com/rabbitmq/stream/impl/ServerFrameHandlerTest.java | 2 +- .../com/rabbitmq/stream/impl/ShutdownListenerTest.java | 2 +- .../stream/impl/SingleActiveConsumerTestSuite.java | 2 +- .../rabbitmq/stream/impl/StompInteroperabilityTest.java | 2 +- .../java/com/rabbitmq/stream/impl/StreamConsumerTest.java | 2 +- .../com/rabbitmq/stream/impl/StreamConsumerUnitTest.java | 2 +- .../java/com/rabbitmq/stream/impl/StreamCreatorTest.java | 2 +- .../com/rabbitmq/stream/impl/StreamEnvironmentTest.java | 2 +- .../rabbitmq/stream/impl/StreamEnvironmentUnitTest.java | 2 +- .../java/com/rabbitmq/stream/impl/StreamProducerTest.java | 2 +- .../com/rabbitmq/stream/impl/StreamProducerUnitTest.java | 2 +- .../rabbitmq/stream/impl/StreamTestInfrastructure.java | 2 +- .../com/rabbitmq/stream/impl/SubEntryBatchingTest.java | 2 +- .../java/com/rabbitmq/stream/impl/SubscriptionTest.java | 2 +- .../com/rabbitmq/stream/impl/SuperStreamConsumerTest.java | 2 +- .../rabbitmq/stream/impl/SuperStreamManagementTest.java | 2 +- .../com/rabbitmq/stream/impl/SuperStreamProducerTest.java | 2 +- .../java/com/rabbitmq/stream/impl/SuperStreamTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/TestUtils.java | 2 +- src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/TlsTest.java | 2 +- src/test/java/com/rabbitmq/stream/impl/UtilsTest.java | 2 +- .../rabbitmq/stream/metrics/MetricsCollectorsTest.java | 2 +- .../micrometer/MicrometerObservationCollectorTest.java | 2 +- .../stream/sasl/DefaultSaslConfigurationTest.java | 2 +- .../com/rabbitmq/stream/sasl/PlainSaslMechanismTest.java | 2 +- 203 files changed, 207 insertions(+), 207 deletions(-) diff --git a/LICENSE-APACHE2 b/LICENSE-APACHE2 index 2cc4b7361e..0719b8dc33 100644 --- a/LICENSE-APACHE2 +++ b/LICENSE-APACHE2 @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2020-2023 2023 Broadcom. All Rights Reserved. + Copyright 2020-2023 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/LICENSE-MPL-RabbitMQ b/LICENSE-MPL-RabbitMQ index e44c13ddfd..175430d63e 100644 --- a/LICENSE-MPL-RabbitMQ +++ b/LICENSE-MPL-RabbitMQ @@ -367,5 +367,5 @@ for such a notice. The Original Code is RabbitMQ. The Initial Developer of the Original Code is Pivotal Software, Inc. -Copyright (c) 2020-2023 2023 Broadcom. All Rights Reserved. +Copyright (c) 2020-2023 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. \ No newline at end of file diff --git a/README.adoc b/README.adoc index 5aa224d286..95445f6e73 100644 --- a/README.adoc +++ b/README.adoc @@ -114,7 +114,7 @@ Please launch the `./mvnw spotless:apply` command to format your changes before == Copyright and License -(c) 2020-2024 Broadcom. All Rights Reserved. +(c) 2020-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. Double licensed under the MPL2.0 and ASL2. See link:LICENSE[LICENSE] for details. diff --git a/src/main/java/com/rabbitmq/stream/Address.java b/src/main/java/com/rabbitmq/stream/Address.java index a838d1e31c..4d4909a96b 100644 --- a/src/main/java/com/rabbitmq/stream/Address.java +++ b/src/main/java/com/rabbitmq/stream/Address.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/AddressResolver.java b/src/main/java/com/rabbitmq/stream/AddressResolver.java index 860806632a..361d3ebfc4 100644 --- a/src/main/java/com/rabbitmq/stream/AddressResolver.java +++ b/src/main/java/com/rabbitmq/stream/AddressResolver.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/AuthenticationFailureException.java b/src/main/java/com/rabbitmq/stream/AuthenticationFailureException.java index 4be66506ec..72a0ab806d 100644 --- a/src/main/java/com/rabbitmq/stream/AuthenticationFailureException.java +++ b/src/main/java/com/rabbitmq/stream/AuthenticationFailureException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java b/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java index 21bd43c06a..4124479135 100644 --- a/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java +++ b/src/main/java/com/rabbitmq/stream/BackOffDelayPolicy.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/ByteCapacity.java b/src/main/java/com/rabbitmq/stream/ByteCapacity.java index d3460e3578..7fbc6c0d38 100644 --- a/src/main/java/com/rabbitmq/stream/ByteCapacity.java +++ b/src/main/java/com/rabbitmq/stream/ByteCapacity.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/ChunkChecksum.java b/src/main/java/com/rabbitmq/stream/ChunkChecksum.java index 6547277dde..a576b1b5a6 100644 --- a/src/main/java/com/rabbitmq/stream/ChunkChecksum.java +++ b/src/main/java/com/rabbitmq/stream/ChunkChecksum.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/ChunkChecksumValidationException.java b/src/main/java/com/rabbitmq/stream/ChunkChecksumValidationException.java index b531be77d7..b7677ce35f 100644 --- a/src/main/java/com/rabbitmq/stream/ChunkChecksumValidationException.java +++ b/src/main/java/com/rabbitmq/stream/ChunkChecksumValidationException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/Codec.java b/src/main/java/com/rabbitmq/stream/Codec.java index 07d79ec74b..1cb3b0fb67 100644 --- a/src/main/java/com/rabbitmq/stream/Codec.java +++ b/src/main/java/com/rabbitmq/stream/Codec.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/ConfirmationHandler.java b/src/main/java/com/rabbitmq/stream/ConfirmationHandler.java index c5180ab9ec..db5d010fac 100644 --- a/src/main/java/com/rabbitmq/stream/ConfirmationHandler.java +++ b/src/main/java/com/rabbitmq/stream/ConfirmationHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/ConfirmationStatus.java b/src/main/java/com/rabbitmq/stream/ConfirmationStatus.java index 851407425f..2c9719966a 100644 --- a/src/main/java/com/rabbitmq/stream/ConfirmationStatus.java +++ b/src/main/java/com/rabbitmq/stream/ConfirmationStatus.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/Constants.java b/src/main/java/com/rabbitmq/stream/Constants.java index 05a4d2bae7..a432562d07 100644 --- a/src/main/java/com/rabbitmq/stream/Constants.java +++ b/src/main/java/com/rabbitmq/stream/Constants.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/Consumer.java b/src/main/java/com/rabbitmq/stream/Consumer.java index 26472ab87e..2b6254949b 100644 --- a/src/main/java/com/rabbitmq/stream/Consumer.java +++ b/src/main/java/com/rabbitmq/stream/Consumer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/ConsumerBuilder.java b/src/main/java/com/rabbitmq/stream/ConsumerBuilder.java index 2579548c01..29fc8646e9 100644 --- a/src/main/java/com/rabbitmq/stream/ConsumerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ConsumerBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java b/src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java index 9f32a2f9fd..aa8863d057 100644 --- a/src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java +++ b/src/main/java/com/rabbitmq/stream/ConsumerFlowStrategy.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2023-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/ConsumerUpdateListener.java b/src/main/java/com/rabbitmq/stream/ConsumerUpdateListener.java index 5c5cf07410..c827855ef6 100644 --- a/src/main/java/com/rabbitmq/stream/ConsumerUpdateListener.java +++ b/src/main/java/com/rabbitmq/stream/ConsumerUpdateListener.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/Environment.java b/src/main/java/com/rabbitmq/stream/Environment.java index 2ef6cfaab3..00baf4099d 100644 --- a/src/main/java/com/rabbitmq/stream/Environment.java +++ b/src/main/java/com/rabbitmq/stream/Environment.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java index c5c5d3b624..12dd0643ed 100644 --- a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/Message.java b/src/main/java/com/rabbitmq/stream/Message.java index 1c7a851b24..7355b02fa2 100644 --- a/src/main/java/com/rabbitmq/stream/Message.java +++ b/src/main/java/com/rabbitmq/stream/Message.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/MessageBuilder.java b/src/main/java/com/rabbitmq/stream/MessageBuilder.java index 5528a1f1d2..e91414d90a 100644 --- a/src/main/java/com/rabbitmq/stream/MessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/MessageBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/MessageHandler.java b/src/main/java/com/rabbitmq/stream/MessageHandler.java index 847f34733a..f7f7f1ca90 100644 --- a/src/main/java/com/rabbitmq/stream/MessageHandler.java +++ b/src/main/java/com/rabbitmq/stream/MessageHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/NoOffsetException.java b/src/main/java/com/rabbitmq/stream/NoOffsetException.java index 76385621db..57ca741806 100644 --- a/src/main/java/com/rabbitmq/stream/NoOffsetException.java +++ b/src/main/java/com/rabbitmq/stream/NoOffsetException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/ObservationCollector.java b/src/main/java/com/rabbitmq/stream/ObservationCollector.java index 47e9abdfc5..6bbea0ed65 100644 --- a/src/main/java/com/rabbitmq/stream/ObservationCollector.java +++ b/src/main/java/com/rabbitmq/stream/ObservationCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/OffsetSpecification.java b/src/main/java/com/rabbitmq/stream/OffsetSpecification.java index dcdcbfa066..64e12c8e45 100644 --- a/src/main/java/com/rabbitmq/stream/OffsetSpecification.java +++ b/src/main/java/com/rabbitmq/stream/OffsetSpecification.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/Producer.java b/src/main/java/com/rabbitmq/stream/Producer.java index 11f45853b2..035dcca74e 100644 --- a/src/main/java/com/rabbitmq/stream/Producer.java +++ b/src/main/java/com/rabbitmq/stream/Producer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java index a445dc2fb4..b89524de96 100644 --- a/src/main/java/com/rabbitmq/stream/ProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/ProducerBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/Properties.java b/src/main/java/com/rabbitmq/stream/Properties.java index e6471e45d0..5174118545 100644 --- a/src/main/java/com/rabbitmq/stream/Properties.java +++ b/src/main/java/com/rabbitmq/stream/Properties.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/RoutingStrategy.java b/src/main/java/com/rabbitmq/stream/RoutingStrategy.java index 89e9225ec4..a9ad95fcc2 100644 --- a/src/main/java/com/rabbitmq/stream/RoutingStrategy.java +++ b/src/main/java/com/rabbitmq/stream/RoutingStrategy.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/StreamCreator.java b/src/main/java/com/rabbitmq/stream/StreamCreator.java index 8693180a5b..c37c04fc2d 100644 --- a/src/main/java/com/rabbitmq/stream/StreamCreator.java +++ b/src/main/java/com/rabbitmq/stream/StreamCreator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/StreamDoesNotExistException.java b/src/main/java/com/rabbitmq/stream/StreamDoesNotExistException.java index a7442748da..494ebdf383 100644 --- a/src/main/java/com/rabbitmq/stream/StreamDoesNotExistException.java +++ b/src/main/java/com/rabbitmq/stream/StreamDoesNotExistException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/StreamException.java b/src/main/java/com/rabbitmq/stream/StreamException.java index 6f45150f15..4830512009 100644 --- a/src/main/java/com/rabbitmq/stream/StreamException.java +++ b/src/main/java/com/rabbitmq/stream/StreamException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/StreamNotAvailableException.java b/src/main/java/com/rabbitmq/stream/StreamNotAvailableException.java index 0142ec9f4c..1d59402759 100644 --- a/src/main/java/com/rabbitmq/stream/StreamNotAvailableException.java +++ b/src/main/java/com/rabbitmq/stream/StreamNotAvailableException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/StreamStats.java b/src/main/java/com/rabbitmq/stream/StreamStats.java index 1ed84a5281..bbcdc2d39b 100644 --- a/src/main/java/com/rabbitmq/stream/StreamStats.java +++ b/src/main/java/com/rabbitmq/stream/StreamStats.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/SubscriptionListener.java b/src/main/java/com/rabbitmq/stream/SubscriptionListener.java index e2a7ee8e26..c63959c71a 100644 --- a/src/main/java/com/rabbitmq/stream/SubscriptionListener.java +++ b/src/main/java/com/rabbitmq/stream/SubscriptionListener.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/amqp/Symbol.java b/src/main/java/com/rabbitmq/stream/amqp/Symbol.java index df59623da4..be1100ae8a 100644 --- a/src/main/java/com/rabbitmq/stream/amqp/Symbol.java +++ b/src/main/java/com/rabbitmq/stream/amqp/Symbol.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/amqp/UnsignedByte.java b/src/main/java/com/rabbitmq/stream/amqp/UnsignedByte.java index 87a36d8e34..3b48f741a3 100644 --- a/src/main/java/com/rabbitmq/stream/amqp/UnsignedByte.java +++ b/src/main/java/com/rabbitmq/stream/amqp/UnsignedByte.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/amqp/UnsignedInteger.java b/src/main/java/com/rabbitmq/stream/amqp/UnsignedInteger.java index 6d0b87fe24..f71560af76 100644 --- a/src/main/java/com/rabbitmq/stream/amqp/UnsignedInteger.java +++ b/src/main/java/com/rabbitmq/stream/amqp/UnsignedInteger.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/amqp/UnsignedLong.java b/src/main/java/com/rabbitmq/stream/amqp/UnsignedLong.java index f862843352..18bc4b2e8f 100644 --- a/src/main/java/com/rabbitmq/stream/amqp/UnsignedLong.java +++ b/src/main/java/com/rabbitmq/stream/amqp/UnsignedLong.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/amqp/UnsignedShort.java b/src/main/java/com/rabbitmq/stream/amqp/UnsignedShort.java index e21b42ab95..002efef626 100644 --- a/src/main/java/com/rabbitmq/stream/amqp/UnsignedShort.java +++ b/src/main/java/com/rabbitmq/stream/amqp/UnsignedShort.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java b/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java index 7b97048ead..8790128302 100644 --- a/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java index 523fbf8eb2..8902dd1ec1 100644 --- a/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java b/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java index 1f62c33577..a429619585 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java b/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java index eb6e92d17a..0feb5d6837 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java index 75803b1c8c..a6180c9655 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java index 78acb9d9d1..195d37cb89 100644 --- a/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/compression/CommonsCompressCompressionCodecFactory.java b/src/main/java/com/rabbitmq/stream/compression/CommonsCompressCompressionCodecFactory.java index 7b33171344..800120785c 100644 --- a/src/main/java/com/rabbitmq/stream/compression/CommonsCompressCompressionCodecFactory.java +++ b/src/main/java/com/rabbitmq/stream/compression/CommonsCompressCompressionCodecFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/compression/Compression.java b/src/main/java/com/rabbitmq/stream/compression/Compression.java index 1fe3d41a17..0d6637fc7f 100644 --- a/src/main/java/com/rabbitmq/stream/compression/Compression.java +++ b/src/main/java/com/rabbitmq/stream/compression/Compression.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/compression/CompressionCodec.java b/src/main/java/com/rabbitmq/stream/compression/CompressionCodec.java index 66f17afdf8..c3dbc0f0bb 100644 --- a/src/main/java/com/rabbitmq/stream/compression/CompressionCodec.java +++ b/src/main/java/com/rabbitmq/stream/compression/CompressionCodec.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/compression/CompressionCodecFactory.java b/src/main/java/com/rabbitmq/stream/compression/CompressionCodecFactory.java index c75be737f4..7d5ccb6b13 100644 --- a/src/main/java/com/rabbitmq/stream/compression/CompressionCodecFactory.java +++ b/src/main/java/com/rabbitmq/stream/compression/CompressionCodecFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/compression/CompressionException.java b/src/main/java/com/rabbitmq/stream/compression/CompressionException.java index b8519347bf..46e3668831 100644 --- a/src/main/java/com/rabbitmq/stream/compression/CompressionException.java +++ b/src/main/java/com/rabbitmq/stream/compression/CompressionException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/compression/CompressionUtils.java b/src/main/java/com/rabbitmq/stream/compression/CompressionUtils.java index 1717f81484..46090e5f55 100644 --- a/src/main/java/com/rabbitmq/stream/compression/CompressionUtils.java +++ b/src/main/java/com/rabbitmq/stream/compression/CompressionUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/compression/DefaultCompressionCodecFactory.java b/src/main/java/com/rabbitmq/stream/compression/DefaultCompressionCodecFactory.java index 1607adf704..5cf72e29f5 100644 --- a/src/main/java/com/rabbitmq/stream/compression/DefaultCompressionCodecFactory.java +++ b/src/main/java/com/rabbitmq/stream/compression/DefaultCompressionCodecFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java b/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java index bd8a862e41..2334cb7a08 100644 --- a/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java +++ b/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index c239f15cd1..3e54f2e497 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java b/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java index c557074df4..933f22021d 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java +++ b/src/main/java/com/rabbitmq/stream/impl/ClientProperties.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -42,7 +42,7 @@ public final class ClientProperties { put("product", "RabbitMQ Stream"); put("version", ClientProperties.VERSION); put("platform", "Java"); - put("copyright", "Copyright (c) 2020-2024 Broadcom Inc. and/or its subsidiaries."); + put("copyright", "Copyright (c) 2020-2025 Broadcom Inc. and/or its subsidiaries."); put("information", "Licensed under the MPL 2.0. See https://www.rabbitmq.com/"); } }); diff --git a/src/main/java/com/rabbitmq/stream/impl/Clock.java b/src/main/java/com/rabbitmq/stream/impl/Clock.java index 45c1a0197a..224f0881d3 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Clock.java +++ b/src/main/java/com/rabbitmq/stream/impl/Clock.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/Codecs.java b/src/main/java/com/rabbitmq/stream/impl/Codecs.java index 49e9321fba..401a5c128e 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Codecs.java +++ b/src/main/java/com/rabbitmq/stream/impl/Codecs.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/CompressionCodecs.java b/src/main/java/com/rabbitmq/stream/impl/CompressionCodecs.java index 10087836d7..85c2a5f0e3 100644 --- a/src/main/java/com/rabbitmq/stream/impl/CompressionCodecs.java +++ b/src/main/java/com/rabbitmq/stream/impl/CompressionCodecs.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java b/src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java index a4dc9f154b..f83d2abf29 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConcurrencyUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/ConnectionStreamException.java b/src/main/java/com/rabbitmq/stream/impl/ConnectionStreamException.java index 21c43a01de..675cce3359 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConnectionStreamException.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConnectionStreamException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java index fbbf2918fe..5a79a678ae 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java b/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java index c1e0a6f515..db47d1726f 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java +++ b/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2023-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java index 44b85f5464..7e2d1a7369 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java index 1eab27313e..ee8c397e13 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatchMessageAccumulator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/ExecutorServiceFactory.java b/src/main/java/com/rabbitmq/stream/impl/ExecutorServiceFactory.java index 938db67c8e..a8b1bf8c53 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ExecutorServiceFactory.java +++ b/src/main/java/com/rabbitmq/stream/impl/ExecutorServiceFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/HashRoutingStrategy.java b/src/main/java/com/rabbitmq/stream/impl/HashRoutingStrategy.java index 1b80c938ea..b696c714b0 100644 --- a/src/main/java/com/rabbitmq/stream/impl/HashRoutingStrategy.java +++ b/src/main/java/com/rabbitmq/stream/impl/HashRoutingStrategy.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/HashUtils.java b/src/main/java/com/rabbitmq/stream/impl/HashUtils.java index 4a770ac09d..f4f235aff4 100644 --- a/src/main/java/com/rabbitmq/stream/impl/HashUtils.java +++ b/src/main/java/com/rabbitmq/stream/impl/HashUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java b/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java index d54461a976..5b4b208560 100644 --- a/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java +++ b/src/main/java/com/rabbitmq/stream/impl/JdkChunkChecksum.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java index 80e3bb516e..673d931527 100644 --- a/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/MessageAccumulator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/MessageBatch.java b/src/main/java/com/rabbitmq/stream/impl/MessageBatch.java index 6225526dca..7ea2a3b737 100644 --- a/src/main/java/com/rabbitmq/stream/impl/MessageBatch.java +++ b/src/main/java/com/rabbitmq/stream/impl/MessageBatch.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinator.java index b88c612ba7..08b1219e9e 100644 --- a/src/main/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/ParameterizedTypeReference.java b/src/main/java/com/rabbitmq/stream/impl/ParameterizedTypeReference.java index 0061d9c2d7..abe2fab11b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ParameterizedTypeReference.java +++ b/src/main/java/com/rabbitmq/stream/impl/ParameterizedTypeReference.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java b/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java index c74fa0102b..5ae8faa7dd 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducerUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java index 4dd16f80e9..67a874df9b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/RoutingKeyRoutingStrategy.java b/src/main/java/com/rabbitmq/stream/impl/RoutingKeyRoutingStrategy.java index 3cbd3b27df..7c51d7ecbd 100644 --- a/src/main/java/com/rabbitmq/stream/impl/RoutingKeyRoutingStrategy.java +++ b/src/main/java/com/rabbitmq/stream/impl/RoutingKeyRoutingStrategy.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java b/src/main/java/com/rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java index 35c9071594..76eaded5e8 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java +++ b/src/main/java/com/rabbitmq/stream/impl/ScheduledExecutorServiceWrapper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2023-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java index 306b1c1dfd..0d4d662a8a 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java +++ b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java index 97e99e4b9f..5370b79887 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SimpleMessageAccumulator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java index 296ae02677..336da76e4c 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java index ce8660c6a5..eb3e0cae77 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index 4345da5caa..adece78863 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java index 0386ec79cd..555200dee0 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java index e7e67be0be..27552512c8 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java index 244b2b1746..e82ad142b5 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java b/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java index 1a71831418..86e3693ad7 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java index 14645074e6..6361b95dea 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java +++ b/src/main/java/com/rabbitmq/stream/impl/SubEntryMessageAccumulator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/SuperStreamConsumer.java b/src/main/java/com/rabbitmq/stream/impl/SuperStreamConsumer.java index dac6a2e9eb..898a665336 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SuperStreamConsumer.java +++ b/src/main/java/com/rabbitmq/stream/impl/SuperStreamConsumer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/SuperStreamProducer.java b/src/main/java/com/rabbitmq/stream/impl/SuperStreamProducer.java index 5078453342..91cc4722f0 100644 --- a/src/main/java/com/rabbitmq/stream/impl/SuperStreamProducer.java +++ b/src/main/java/com/rabbitmq/stream/impl/SuperStreamProducer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/ThreadUtils.java b/src/main/java/com/rabbitmq/stream/impl/ThreadUtils.java index 813daf8365..4d73c19123 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ThreadUtils.java +++ b/src/main/java/com/rabbitmq/stream/impl/ThreadUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/TimeoutStreamException.java b/src/main/java/com/rabbitmq/stream/impl/TimeoutStreamException.java index cf1f630e9b..bbbc9090cb 100644 --- a/src/main/java/com/rabbitmq/stream/impl/TimeoutStreamException.java +++ b/src/main/java/com/rabbitmq/stream/impl/TimeoutStreamException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/Tuples.java b/src/main/java/com/rabbitmq/stream/impl/Tuples.java index da9088f649..937e75c00b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Tuples.java +++ b/src/main/java/com/rabbitmq/stream/impl/Tuples.java @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index 92c6338ab8..4ce8c92ef2 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/metrics/DropwizardMetricsCollector.java b/src/main/java/com/rabbitmq/stream/metrics/DropwizardMetricsCollector.java index 1bb2c4600c..8e12a2ba3a 100644 --- a/src/main/java/com/rabbitmq/stream/metrics/DropwizardMetricsCollector.java +++ b/src/main/java/com/rabbitmq/stream/metrics/DropwizardMetricsCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/metrics/MetricsCollector.java b/src/main/java/com/rabbitmq/stream/metrics/MetricsCollector.java index 7cfc79a729..e9b7d016f2 100644 --- a/src/main/java/com/rabbitmq/stream/metrics/MetricsCollector.java +++ b/src/main/java/com/rabbitmq/stream/metrics/MetricsCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/metrics/MicrometerMetricsCollector.java b/src/main/java/com/rabbitmq/stream/metrics/MicrometerMetricsCollector.java index 4010d8e99e..e5a2d73151 100644 --- a/src/main/java/com/rabbitmq/stream/metrics/MicrometerMetricsCollector.java +++ b/src/main/java/com/rabbitmq/stream/metrics/MicrometerMetricsCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/metrics/NoOpMetricsCollector.java b/src/main/java/com/rabbitmq/stream/metrics/NoOpMetricsCollector.java index 885dde49d4..9ee511eeaa 100644 --- a/src/main/java/com/rabbitmq/stream/metrics/NoOpMetricsCollector.java +++ b/src/main/java/com/rabbitmq/stream/metrics/NoOpMetricsCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultProcessObservationConvention.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultProcessObservationConvention.java index bf4ec8bc33..077cb933db 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultProcessObservationConvention.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultProcessObservationConvention.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultPublishObservationConvention.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultPublishObservationConvention.java index 005b793a1b..fc068b1357 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultPublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/DefaultPublishObservationConvention.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollector.java index 72e3afb97f..829c05fe03 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorBuilder.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorBuilder.java index 96462022be..e7101898d2 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorBuilder.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessContext.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessContext.java index c281891624..737bb63d72 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessContext.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessContext.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessObservationConvention.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessObservationConvention.java index 3e6045c1d7..fd7c3c110c 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessObservationConvention.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/ProcessObservationConvention.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishContext.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishContext.java index 1e5f8e6507..be9be0d8d6 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishContext.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishContext.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishObservationConvention.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishObservationConvention.java index db3ca18344..c535be20aa 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/PublishObservationConvention.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/observation/micrometer/StreamObservationDocumentation.java b/src/main/java/com/rabbitmq/stream/observation/micrometer/StreamObservationDocumentation.java index aeaa4446e1..c8624b1d8b 100644 --- a/src/main/java/com/rabbitmq/stream/observation/micrometer/StreamObservationDocumentation.java +++ b/src/main/java/com/rabbitmq/stream/observation/micrometer/StreamObservationDocumentation.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/sasl/AnonymousSaslMechanism.java b/src/main/java/com/rabbitmq/stream/sasl/AnonymousSaslMechanism.java index a3ca7f82f1..14b056c2ff 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/AnonymousSaslMechanism.java +++ b/src/main/java/com/rabbitmq/stream/sasl/AnonymousSaslMechanism.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/sasl/CredentialsProvider.java b/src/main/java/com/rabbitmq/stream/sasl/CredentialsProvider.java index 96e211e632..0f7f2b3fd2 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/CredentialsProvider.java +++ b/src/main/java/com/rabbitmq/stream/sasl/CredentialsProvider.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java b/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java index bae204be18..5cef5c45f6 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java +++ b/src/main/java/com/rabbitmq/stream/sasl/DefaultSaslConfiguration.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/sasl/DefaultUsernamePasswordCredentialsProvider.java b/src/main/java/com/rabbitmq/stream/sasl/DefaultUsernamePasswordCredentialsProvider.java index 601b2c533a..a7b4b43462 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/DefaultUsernamePasswordCredentialsProvider.java +++ b/src/main/java/com/rabbitmq/stream/sasl/DefaultUsernamePasswordCredentialsProvider.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/sasl/ExternalSaslMechanism.java b/src/main/java/com/rabbitmq/stream/sasl/ExternalSaslMechanism.java index c1bc2579d7..4c31eee11c 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/ExternalSaslMechanism.java +++ b/src/main/java/com/rabbitmq/stream/sasl/ExternalSaslMechanism.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java b/src/main/java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java index cfffe8de01..ca2a251e94 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java +++ b/src/main/java/com/rabbitmq/stream/sasl/JdkSaslConfiguration.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/sasl/PlainSaslMechanism.java b/src/main/java/com/rabbitmq/stream/sasl/PlainSaslMechanism.java index 8fe0b7a687..ad80e6ef61 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/PlainSaslMechanism.java +++ b/src/main/java/com/rabbitmq/stream/sasl/PlainSaslMechanism.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/sasl/SaslConfiguration.java b/src/main/java/com/rabbitmq/stream/sasl/SaslConfiguration.java index 7e32581355..b5fa3aaf78 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/SaslConfiguration.java +++ b/src/main/java/com/rabbitmq/stream/sasl/SaslConfiguration.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/sasl/SaslMechanism.java b/src/main/java/com/rabbitmq/stream/sasl/SaslMechanism.java index 26b75a9406..58adfaab60 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/SaslMechanism.java +++ b/src/main/java/com/rabbitmq/stream/sasl/SaslMechanism.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/sasl/StreamSaslException.java b/src/main/java/com/rabbitmq/stream/sasl/StreamSaslException.java index 252b16de52..f2a3169c11 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/StreamSaslException.java +++ b/src/main/java/com/rabbitmq/stream/sasl/StreamSaslException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/main/java/com/rabbitmq/stream/sasl/UsernamePasswordCredentialsProvider.java b/src/main/java/com/rabbitmq/stream/sasl/UsernamePasswordCredentialsProvider.java index a61398f332..2c46921397 100644 --- a/src/main/java/com/rabbitmq/stream/sasl/UsernamePasswordCredentialsProvider.java +++ b/src/main/java/com/rabbitmq/stream/sasl/UsernamePasswordCredentialsProvider.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/BackOffDelayPolicyTest.java b/src/test/java/com/rabbitmq/stream/BackOffDelayPolicyTest.java index 6d6dc5fecb..a5983a299d 100644 --- a/src/test/java/com/rabbitmq/stream/BackOffDelayPolicyTest.java +++ b/src/test/java/com/rabbitmq/stream/BackOffDelayPolicyTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/ByteCapacityTest.java b/src/test/java/com/rabbitmq/stream/ByteCapacityTest.java index 00edc8ccf2..f359c434ec 100644 --- a/src/test/java/com/rabbitmq/stream/ByteCapacityTest.java +++ b/src/test/java/com/rabbitmq/stream/ByteCapacityTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/Cli.java b/src/test/java/com/rabbitmq/stream/Cli.java index 97908eb08f..7097725af4 100644 --- a/src/test/java/com/rabbitmq/stream/Cli.java +++ b/src/test/java/com/rabbitmq/stream/Cli.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/CliTest.java b/src/test/java/com/rabbitmq/stream/CliTest.java index 0d5b0effb5..7c3c4d1167 100644 --- a/src/test/java/com/rabbitmq/stream/CliTest.java +++ b/src/test/java/com/rabbitmq/stream/CliTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2023-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the @@ -36,8 +36,8 @@ void deserializeConnectionInfo() { private static final String LIST_STREAM_CONNECTIONS_JSON_OUTPUT = "[\n" - + "{\"conn_name\":\"127.0.0.1:49214 -> 127.0.1.1:5552\",\"client_properties\":[[\"connection_name\",\"longstr\",\"rabbitmq-stream-consumer-0\"],[\"copyright\",\"longstr\",\"Copyright (c) 2020-2023 Broadcom Inc. and/or its subsidiaries.\"],[\"information\",\"longstr\",\"Licensed under the MPL 2.0. See https://www.rabbitmq.com/\"],[\"platform\",\"longstr\",\"Java\"],[\"product\",\"longstr\",\"RabbitMQ Stream\"],[\"version\",\"longstr\",\"0.5.0-SNAPSHOT\"]]}\n" - + ",{\"conn_name\":\"127.0.0.1:49212 -> 127.0.1.1:5552\",\"client_properties\":[[\"connection_name\",\"longstr\",\"rabbitmq-stream-producer-0\"],[\"copyright\",\"longstr\",\"Copyright (c) 2020-2023 Broadcom Inc. and/or its subsidiaries.\"],[\"information\",\"longstr\",\"Licensed under the MPL 2.0. See https://www.rabbitmq.com/\"],[\"platform\",\"longstr\",\"Java\"],[\"product\",\"longstr\",\"RabbitMQ Stream\"],[\"version\",\"longstr\",\"0.5.0-SNAPSHOT\"]]}\n" - + ",{\"conn_name\":\"127.0.0.1:58118 -> 127.0.0.1:5552\",\"client_properties\":[[\"connection_name\",\"longstr\",\"rabbitmq-stream-locator-0\"],[\"copyright\",\"longstr\",\"Copyright (c) 2020-2023 Broadcom Inc. and/or its subsidiaries.\"],[\"information\",\"longstr\",\"Licensed under the MPL 2.0. See https://www.rabbitmq.com/\"],[\"platform\",\"longstr\",\"Java\"],[\"product\",\"longstr\",\"RabbitMQ Stream\"],[\"version\",\"longstr\",\"0.5.0-SNAPSHOT\"]]}\n" + + "{\"conn_name\":\"127.0.0.1:49214 -> 127.0.1.1:5552\",\"client_properties\":[[\"connection_name\",\"longstr\",\"rabbitmq-stream-consumer-0\"],[\"copyright\",\"longstr\",\"Copyright (c) 2020-2025 Broadcom Inc. and/or its subsidiaries.\"],[\"information\",\"longstr\",\"Licensed under the MPL 2.0. See https://www.rabbitmq.com/\"],[\"platform\",\"longstr\",\"Java\"],[\"product\",\"longstr\",\"RabbitMQ Stream\"],[\"version\",\"longstr\",\"0.5.0-SNAPSHOT\"]]}\n" + + ",{\"conn_name\":\"127.0.0.1:49212 -> 127.0.1.1:5552\",\"client_properties\":[[\"connection_name\",\"longstr\",\"rabbitmq-stream-producer-0\"],[\"copyright\",\"longstr\",\"Copyright (c) 2020-2025 Broadcom Inc. and/or its subsidiaries.\"],[\"information\",\"longstr\",\"Licensed under the MPL 2.0. See https://www.rabbitmq.com/\"],[\"platform\",\"longstr\",\"Java\"],[\"product\",\"longstr\",\"RabbitMQ Stream\"],[\"version\",\"longstr\",\"0.5.0-SNAPSHOT\"]]}\n" + + ",{\"conn_name\":\"127.0.0.1:58118 -> 127.0.0.1:5552\",\"client_properties\":[[\"connection_name\",\"longstr\",\"rabbitmq-stream-locator-0\"],[\"copyright\",\"longstr\",\"Copyright (c) 2020-2025 Broadcom Inc. and/or its subsidiaries.\"],[\"information\",\"longstr\",\"Licensed under the MPL 2.0. See https://www.rabbitmq.com/\"],[\"platform\",\"longstr\",\"Java\"],[\"product\",\"longstr\",\"RabbitMQ Stream\"],[\"version\",\"longstr\",\"0.5.0-SNAPSHOT\"]]}\n" + "]"; } diff --git a/src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java b/src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java index bf106a7215..4c45d6ae44 100644 --- a/src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java +++ b/src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/benchmark/ChecksumAlgorithmBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/ChecksumAlgorithmBenchmark.java index 88a1717a3e..ea208bf431 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/ChecksumAlgorithmBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/ChecksumAlgorithmBenchmark.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/benchmark/CompressDecompressBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/CompressDecompressBenchmark.java index 5ed348040f..6136e8c3ed 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/CompressDecompressBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/CompressDecompressBenchmark.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/benchmark/EncodeDecodeForPerformanceToolBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/EncodeDecodeForPerformanceToolBenchmark.java index 70c391373b..1fcd74e56a 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/EncodeDecodeForPerformanceToolBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/EncodeDecodeForPerformanceToolBenchmark.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/benchmark/EncodingDecodingBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/EncodingDecodingBenchmark.java index a9f4fc948f..b7673e4a3d 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/EncodingDecodingBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/EncodingDecodingBenchmark.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/benchmark/FilteringBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/FilteringBenchmark.java index 9677b0b359..dddbd9bf67 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/FilteringBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/FilteringBenchmark.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/benchmark/HashAlgorithmBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/HashAlgorithmBenchmark.java index 10f4a76638..4b2e528b68 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/HashAlgorithmBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/HashAlgorithmBenchmark.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/benchmark/ModuloBenchmark.java b/src/test/java/com/rabbitmq/stream/benchmark/ModuloBenchmark.java index e2c77c9926..342b9147e8 100644 --- a/src/test/java/com/rabbitmq/stream/benchmark/ModuloBenchmark.java +++ b/src/test/java/com/rabbitmq/stream/benchmark/ModuloBenchmark.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/codec/CodecsTest.java b/src/test/java/com/rabbitmq/stream/codec/CodecsTest.java index 5179cf278b..064e013617 100644 --- a/src/test/java/com/rabbitmq/stream/codec/CodecsTest.java +++ b/src/test/java/com/rabbitmq/stream/codec/CodecsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/docs/ConsumerUsage.java b/src/test/java/com/rabbitmq/stream/docs/ConsumerUsage.java index 1d377a4d15..1c96831164 100644 --- a/src/test/java/com/rabbitmq/stream/docs/ConsumerUsage.java +++ b/src/test/java/com/rabbitmq/stream/docs/ConsumerUsage.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/docs/EnvironmentUsage.java b/src/test/java/com/rabbitmq/stream/docs/EnvironmentUsage.java index d42e6662e4..4f4c001982 100644 --- a/src/test/java/com/rabbitmq/stream/docs/EnvironmentUsage.java +++ b/src/test/java/com/rabbitmq/stream/docs/EnvironmentUsage.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/docs/FilteringUsage.java b/src/test/java/com/rabbitmq/stream/docs/FilteringUsage.java index cb882ae1bc..6340b1b935 100644 --- a/src/test/java/com/rabbitmq/stream/docs/FilteringUsage.java +++ b/src/test/java/com/rabbitmq/stream/docs/FilteringUsage.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/docs/ProducerUsage.java b/src/test/java/com/rabbitmq/stream/docs/ProducerUsage.java index 5821d2c769..2a11e8ae2e 100644 --- a/src/test/java/com/rabbitmq/stream/docs/ProducerUsage.java +++ b/src/test/java/com/rabbitmq/stream/docs/ProducerUsage.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/docs/SampleApplication.java b/src/test/java/com/rabbitmq/stream/docs/SampleApplication.java index 69c811462b..5daaa2e506 100644 --- a/src/test/java/com/rabbitmq/stream/docs/SampleApplication.java +++ b/src/test/java/com/rabbitmq/stream/docs/SampleApplication.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/docs/SuperStreamUsage.java b/src/test/java/com/rabbitmq/stream/docs/SuperStreamUsage.java index 583937129f..109a0305d2 100644 --- a/src/test/java/com/rabbitmq/stream/docs/SuperStreamUsage.java +++ b/src/test/java/com/rabbitmq/stream/docs/SuperStreamUsage.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the // Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). diff --git a/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java b/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java index 503d9880a0..2ee819b058 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java index 264fabba70..48b54ffc42 100644 --- a/src/test/java/com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java index f1ca13ea60..95a4df4f91 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AmqpInteroperabilityTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/Assertions.java b/src/test/java/com/rabbitmq/stream/impl/Assertions.java index cfec3df5fb..8a3b0e966f 100644 --- a/src/test/java/com/rabbitmq/stream/impl/Assertions.java +++ b/src/test/java/com/rabbitmq/stream/impl/Assertions.java @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java b/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java index d1f13838de..30322b4d3d 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java b/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java index 7fbf4af4c8..ceb5fb805b 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AuthenticationTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java b/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java index e6fc7bd701..df07c03b76 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AuthorisationTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/ClientFlowControlTest.java b/src/test/java/com/rabbitmq/stream/impl/ClientFlowControlTest.java index 420e8fa916..9695884304 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ClientFlowControlTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ClientFlowControlTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/ClientParametersTest.java b/src/test/java/com/rabbitmq/stream/impl/ClientParametersTest.java index f94bbc32a6..322446bb5a 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ClientParametersTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ClientParametersTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/ClientTest.java b/src/test/java/com/rabbitmq/stream/impl/ClientTest.java index ffc44b0704..34496ac73d 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ClientTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ClientTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/CompressionCodecsTest.java b/src/test/java/com/rabbitmq/stream/impl/CompressionCodecsTest.java index c172934d9f..d714a7363b 100644 --- a/src/test/java/com/rabbitmq/stream/impl/CompressionCodecsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/CompressionCodecsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java index 7dd5e8da48..4844a6fdf6 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ConsumersCoordinatorTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactoryTest.java b/src/test/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactoryTest.java index 085766f4bc..ad187b0f28 100644 --- a/src/test/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactoryTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactoryTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/DeliveryTest.java b/src/test/java/com/rabbitmq/stream/impl/DeliveryTest.java index 27d3724a6c..02844308dd 100644 --- a/src/test/java/com/rabbitmq/stream/impl/DeliveryTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/DeliveryTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java index bbc2484c50..dca9810762 100644 --- a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/FilteringTest.java b/src/test/java/com/rabbitmq/stream/impl/FilteringTest.java index 54740b8a5d..4118b78b16 100644 --- a/src/test/java/com/rabbitmq/stream/impl/FilteringTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/FilteringTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/FrameTest.java b/src/test/java/com/rabbitmq/stream/impl/FrameTest.java index 6202dc61b5..28422d40ad 100644 --- a/src/test/java/com/rabbitmq/stream/impl/FrameTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/FrameTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/HashRoutingStrategyTest.java b/src/test/java/com/rabbitmq/stream/impl/HashRoutingStrategyTest.java index 5b7406d363..29799137e3 100644 --- a/src/test/java/com/rabbitmq/stream/impl/HashRoutingStrategyTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/HashRoutingStrategyTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2022-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2022-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/HashUtilsTest.java b/src/test/java/com/rabbitmq/stream/impl/HashUtilsTest.java index e7f1e16b5f..5b9c5cb310 100644 --- a/src/test/java/com/rabbitmq/stream/impl/HashUtilsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/HashUtilsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/HeartbeatTest.java b/src/test/java/com/rabbitmq/stream/impl/HeartbeatTest.java index bfe25b6557..c9d525fd15 100644 --- a/src/test/java/com/rabbitmq/stream/impl/HeartbeatTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/HeartbeatTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java b/src/test/java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java index 1375589100..fcce8cc29d 100644 --- a/src/test/java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/JdkChunkChecksumTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java index 09f43baee8..3c2adaf58e 100644 --- a/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/LoadBalancerClusterTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/MessageCountConsumerFlowStrategyTest.java b/src/test/java/com/rabbitmq/stream/impl/MessageCountConsumerFlowStrategyTest.java index 90ec80ae1c..ea959a1903 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MessageCountConsumerFlowStrategyTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/MessageCountConsumerFlowStrategyTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2023-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/MetadataTest.java b/src/test/java/com/rabbitmq/stream/impl/MetadataTest.java index 16241f2c25..de02f23093 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MetadataTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/MetadataTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/MetricsCollectionTest.java b/src/test/java/com/rabbitmq/stream/impl/MetricsCollectionTest.java index 069fe3f427..3bbd39d801 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MetricsCollectionTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/MetricsCollectionTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/MonitoringTestUtils.java b/src/test/java/com/rabbitmq/stream/impl/MonitoringTestUtils.java index e645f4eb93..58b6e4bf07 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MonitoringTestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/MonitoringTestUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/MqttInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/MqttInteroperabilityTest.java index 372cd612a1..1cd14bdabd 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MqttInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/MqttInteroperabilityTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/NotificationTest.java b/src/test/java/com/rabbitmq/stream/impl/NotificationTest.java index 320bc4128a..189aba2b02 100644 --- a/src/test/java/com/rabbitmq/stream/impl/NotificationTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/NotificationTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/OffsetTest.java b/src/test/java/com/rabbitmq/stream/impl/OffsetTest.java index 8663026b08..34dc697141 100644 --- a/src/test/java/com/rabbitmq/stream/impl/OffsetTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/OffsetTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinatorTest.java index 4af5ee44a6..4e116f63ea 100644 --- a/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingCoordinatorTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingTest.java b/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingTest.java index ab3399c799..8649dd0e15 100644 --- a/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/OffsetTrackingTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/OutboundMappingCallbackTest.java b/src/test/java/com/rabbitmq/stream/impl/OutboundMappingCallbackTest.java index f0d98f1db4..d424070a5d 100644 --- a/src/test/java/com/rabbitmq/stream/impl/OutboundMappingCallbackTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/OutboundMappingCallbackTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java index 173f951857..35aa7aeedb 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ProducersCoordinatorTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/PublisherTest.java b/src/test/java/com/rabbitmq/stream/impl/PublisherTest.java index e9eac1fcec..1c171713da 100644 --- a/src/test/java/com/rabbitmq/stream/impl/PublisherTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/PublisherTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index f90056451d..e5450f2225 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/RetentionClientTest.java b/src/test/java/com/rabbitmq/stream/impl/RetentionClientTest.java index 067106faf8..1d9fde7aff 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RetentionClientTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RetentionClientTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/RoutePartitionsTest.java b/src/test/java/com/rabbitmq/stream/impl/RoutePartitionsTest.java index 300fd1e07f..e42d23e796 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RoutePartitionsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RoutePartitionsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/SacClientTest.java b/src/test/java/com/rabbitmq/stream/impl/SacClientTest.java index 46a997fe51..6434af4d19 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SacClientTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SacClientTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2022-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2022-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java index c0d2463168..e58dc2e89b 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SacStreamConsumerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2022-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2022-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java index dab5f9ff47..df538319cd 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SacSuperStreamConsumerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/ServerFrameHandlerTest.java b/src/test/java/com/rabbitmq/stream/impl/ServerFrameHandlerTest.java index 1859236a3b..7ad3a56173 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ServerFrameHandlerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ServerFrameHandlerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/ShutdownListenerTest.java b/src/test/java/com/rabbitmq/stream/impl/ShutdownListenerTest.java index 014b5919da..dfb8df27c1 100644 --- a/src/test/java/com/rabbitmq/stream/impl/ShutdownListenerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/ShutdownListenerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/SingleActiveConsumerTestSuite.java b/src/test/java/com/rabbitmq/stream/impl/SingleActiveConsumerTestSuite.java index 49464fd02c..8d06a66fae 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SingleActiveConsumerTestSuite.java +++ b/src/test/java/com/rabbitmq/stream/impl/SingleActiveConsumerTestSuite.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/StompInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/StompInteroperabilityTest.java index a0ebfaee58..adb6153a27 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StompInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StompInteroperabilityTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java index 0f439df0b8..dcbb6f158a 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java index 5f7556d43d..7ed68df6eb 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamCreatorTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamCreatorTest.java index 3969c9dad7..60aee2136f 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamCreatorTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamCreatorTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java index ff3b1dd609..e080275f1f 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java index 383a1190d7..e8d3f25e34 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentUnitTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java index 6247e43ecf..63254247ad 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java index 19390e6877..1150a90842 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerUnitTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamTestInfrastructure.java b/src/test/java/com/rabbitmq/stream/impl/StreamTestInfrastructure.java index 4c39066377..1c02c0c278 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamTestInfrastructure.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamTestInfrastructure.java @@ -1,4 +1,4 @@ -// Copyright (c) 2024 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/SubEntryBatchingTest.java b/src/test/java/com/rabbitmq/stream/impl/SubEntryBatchingTest.java index 6816919428..65a6b5567a 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SubEntryBatchingTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SubEntryBatchingTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/SubscriptionTest.java b/src/test/java/com/rabbitmq/stream/impl/SubscriptionTest.java index ecdb5e7425..5c3eb4d828 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SubscriptionTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SubscriptionTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java index 11b0ff360e..c5e5c8b62a 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/SuperStreamManagementTest.java b/src/test/java/com/rabbitmq/stream/impl/SuperStreamManagementTest.java index 9b2e6b9732..a8464ed04e 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SuperStreamManagementTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SuperStreamManagementTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2023-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/SuperStreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/SuperStreamProducerTest.java index 47f5ec9ff6..e2d43d7aa1 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SuperStreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SuperStreamProducerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/SuperStreamTest.java b/src/test/java/com/rabbitmq/stream/impl/SuperStreamTest.java index ea14c8fdf8..0f3021126e 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SuperStreamTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SuperStreamTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index 19fc9c7f2d..417842be85 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java b/src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java index a67fcd1d69..b9ef7c1e92 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/TlsTest.java b/src/test/java/com/rabbitmq/stream/impl/TlsTest.java index 78e4b4e8de..3959789cda 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TlsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/TlsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2021-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/impl/UtilsTest.java b/src/test/java/com/rabbitmq/stream/impl/UtilsTest.java index bd564968f4..fb2f0bcddf 100644 --- a/src/test/java/com/rabbitmq/stream/impl/UtilsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/UtilsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/metrics/MetricsCollectorsTest.java b/src/test/java/com/rabbitmq/stream/metrics/MetricsCollectorsTest.java index 0f0dab16de..20b5152b07 100644 --- a/src/test/java/com/rabbitmq/stream/metrics/MetricsCollectorsTest.java +++ b/src/test/java/com/rabbitmq/stream/metrics/MetricsCollectorsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorTest.java b/src/test/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorTest.java index bd027d0aec..704a347f81 100644 --- a/src/test/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorTest.java +++ b/src/test/java/com/rabbitmq/stream/observation/micrometer/MicrometerObservationCollectorTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Broadcom. All Rights Reserved. +// Copyright (c) 2007-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java b/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java index 243d4be3d0..5979406515 100644 --- a/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java +++ b/src/test/java/com/rabbitmq/stream/sasl/DefaultSaslConfigurationTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2024 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the diff --git a/src/test/java/com/rabbitmq/stream/sasl/PlainSaslMechanismTest.java b/src/test/java/com/rabbitmq/stream/sasl/PlainSaslMechanismTest.java index 273cac924e..eb3746b836 100644 --- a/src/test/java/com/rabbitmq/stream/sasl/PlainSaslMechanismTest.java +++ b/src/test/java/com/rabbitmq/stream/sasl/PlainSaslMechanismTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020-2023 Broadcom. All Rights Reserved. +// Copyright (c) 2020-2025 Broadcom. All Rights Reserved. // The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Stream Java client library, is dual-licensed under the From f5dc4786cb5dfffbbada4e0e30c93ec690276e5d Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Fri, 3 Jan 2025 15:48:52 -0500 Subject: [PATCH 333/449] Update .git-blame-ignore-revs --- .git-blame-ignore-revs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000000..61ff625176 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,3 @@ +# Bump (c) year to 2025 +100355cecc + From d00146315a9e02ae1ef7b421cdb67127df8fb70e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 16:25:09 +0000 Subject: [PATCH 334/449] Bump org.assertj:assertj-core from 3.27.1 to 3.27.2 Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.27.1 to 3.27.2. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.27.1...assertj-build-3.27.2) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 39c079458c..bff69eefd6 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.8.0 1.1.10.7 5.11.4 - 3.27.1 + 3.27.2 5.15.2 5.24.0 3.17.0 From 532ad57ec06632eac3964c6670cd2c3d2108970b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 7 Jan 2025 15:33:23 +0100 Subject: [PATCH 335/449] Bump SwiftMQ client to 13.0.2 Now Java 11 is a requirement. --- .github/dependabot.yml | 1 - pom.xml | 2 +- .../com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 03a868b14b..4c09ba720a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,6 @@ updates: interval: "daily" open-pull-requests-limit: 20 ignore: - - dependency-name: "com.swiftmq:swiftmq-client" - dependency-name: "org.slf4j:slf4j-api" versions: [ "[2.0,)" ] - dependency-name: "ch.qos.logback:logback-classic" diff --git a/pom.xml b/pom.xml index bff69eefd6..b7d40bf585 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ 0.34.1 4.2.29 1.14.2 - 12.2.2 + 13.0.2 4.7.5 1.27.1 1.5.6-9 diff --git a/src/test/java/com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java index 48b54ffc42..e4753f4017 100644 --- a/src/test/java/com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/Amqp10InteroperabilityTest.java @@ -32,7 +32,6 @@ import com.swiftmq.amqp.v100.client.Producer; import com.swiftmq.amqp.v100.client.QoS; import com.swiftmq.amqp.v100.client.Session; -import com.swiftmq.amqp.v100.generated.messaging.delivery_state.*; import com.swiftmq.amqp.v100.generated.messaging.message_format.AmqpSequence; import com.swiftmq.amqp.v100.generated.messaging.message_format.AmqpValue; import com.swiftmq.amqp.v100.generated.messaging.message_format.ApplicationProperties; From 340d6005df63bcab57e276d72cc891964a99cd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 7 Jan 2025 15:33:50 +0100 Subject: [PATCH 336/449] Log last exception in recovery cluster test --- .../rabbitmq/stream/impl/RecoveryClusterTest.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index e5450f2225..9cc312b33a 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -35,7 +35,6 @@ import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; -import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.Collections; import java.util.LinkedHashMap; @@ -255,9 +254,10 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru System.out.println(TestUtils.jsonPrettyPrint(environment.toString())); LOGGER.info("Producer information:"); - producers.forEach(p -> { - LOGGER.info("Producer to '{}' (last exception: '{}')", p.stream(), p.lastException); - }); + producers.forEach( + p -> { + LOGGER.info("Producer to '{}' (last exception: '{}')", p.stream(), p.lastException); + }); LOGGER.info("Closing producers"); producers.forEach( @@ -357,7 +357,9 @@ String lastException() { if (this.lastException.get() == null) { return "no exception"; } else { - return this.lastException.get().getMessage() + " at " + DateTimeFormatter.ISO_LOCAL_TIME.format(lastExceptionInstant.get()); + return this.lastException.get().getMessage() + + " at " + + DateTimeFormatter.ISO_INSTANT.format(lastExceptionInstant.get()); } } From fafd1a61c5eefca2fb6af8ac50b5f6e234c91d6f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 14:35:15 +0000 Subject: [PATCH 337/449] Bump com.diffplug.spotless:spotless-maven-plugin from 2.43.0 to 2.44.0 Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.43.0 to 2.44.0. - [Release notes](https://github.com/diffplug/spotless/releases) - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/lib/2.43.0...lib/2.44.0) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b7d40bf585..1de0ad2309 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 2.3.1 3.2.1 1.37 - 2.43.0 + 2.44.0 1.25.2 0.8.12 4.8.6.6 From 99fd8b9b13f203ffe8e7f33877c6b718ab8f1c90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 14:35:25 +0000 Subject: [PATCH 338/449] Bump commons-codec:commons-codec from 1.17.1 to 1.17.2 Bumps [commons-codec:commons-codec](https://github.com/apache/commons-codec) from 1.17.1 to 1.17.2. - [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.17.1...rel/commons-codec-1.17.2) --- updated-dependencies: - dependency-name: commons-codec:commons-codec dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b7d40bf585..f39e69913f 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 5.15.2 5.24.0 3.17.0 - 1.17.1 + 1.17.2 2.11.0 0.10.5 1.2.5 From 871d76aeb800eaa1ef472e851906f852941cb2ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:16:30 +0000 Subject: [PATCH 339/449] Bump com.diffplug.spotless:spotless-maven-plugin from 2.44.0 to 2.44.1 Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.44.0 to 2.44.1. - [Release notes](https://github.com/diffplug/spotless/releases) - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/lib/2.44.0...maven/2.44.1) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c2e18d3ef1..16e968bdea 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 2.3.1 3.2.1 1.37 - 2.44.0 + 2.44.1 1.25.2 0.8.12 4.8.6.6 From 6d29a3335d45f88458968f51e63e009acc2c1fa4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:44:19 +0000 Subject: [PATCH 340/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.4.1 to 1.4.2. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.4.1...v1.4.2) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 16e968bdea..b99d21ce54 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.11.0 0.10.5 1.2.5 - 1.4.1 + 1.4.2 1.0.4 3.13.0 3.5.2 From 923422d18d94980cbe8ffbeda55f84d946317e3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:44:37 +0000 Subject: [PATCH 341/449] Bump io.micrometer:micrometer-core from 1.14.2 to 1.14.3 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.14.2 to 1.14.3. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.14.2...v1.14.3) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 16e968bdea..66ee9666d5 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.116.Final 0.34.1 4.2.29 - 1.14.2 + 1.14.3 13.0.2 4.7.5 1.27.1 From 9ff553e50e5d1d9e23ba0f720c9d6c372abefc04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:55:11 +0000 Subject: [PATCH 342/449] Bump netty.version from 4.1.116.Final to 4.1.117.Final Bumps `netty.version` from 4.1.116.Final to 4.1.117.Final. Updates `io.netty:netty-transport` from 4.1.116.Final to 4.1.117.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.116.Final...netty-4.1.117.Final) Updates `io.netty:netty-codec` from 4.1.116.Final to 4.1.117.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.116.Final...netty-4.1.117.Final) Updates `io.netty:netty-handler` from 4.1.116.Final to 4.1.117.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.116.Final...netty-4.1.117.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.116.Final to 4.1.117.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.116.Final...netty-4.1.117.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7f427e1ed0..f518434e8c 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.116.Final + 4.1.117.Final 0.34.1 4.2.29 1.14.3 From 14694e16b5772857768487751ddb1729e954b6d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Jan 2025 16:55:25 +0000 Subject: [PATCH 343/449] Bump io.dropwizard.metrics:metrics-core from 4.2.29 to 4.2.30 Bumps [io.dropwizard.metrics:metrics-core](https://github.com/dropwizard/metrics) from 4.2.29 to 4.2.30. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.29...v4.2.30) --- updated-dependencies: - dependency-name: io.dropwizard.metrics:metrics-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7f427e1ed0..5b828306d3 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 1.2.13 4.1.116.Final 0.34.1 - 4.2.29 + 4.2.30 1.14.3 13.0.2 4.7.5 From e424739d9aa5ddaae619f464c4b7491a67870d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 15 Jan 2025 15:27:26 +0100 Subject: [PATCH 344/449] Fix correlation ID increment Fixes #689 --- .../java/com/rabbitmq/stream/impl/Client.java | 72 +++++++++++++------ 1 file changed, 49 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 3e54f2e497..9e800163a1 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -104,6 +104,7 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; +import java.util.function.Supplier; import java.util.function.ToLongFunction; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLHandshakeException; @@ -178,7 +179,7 @@ public long applyAsLong(Object value) { private final CredentialsProvider credentialsProvider; private final Runnable nettyClosing; private final int maxFrameSize; - private final boolean frameSizeCopped; + private final boolean frameSizeCapped; private final EventLoopGroup eventLoopGroup; private final Map clientProperties; private final String NETTY_HANDLER_FLUSH_CONSOLIDATION = @@ -373,12 +374,18 @@ public void initChannel(SocketChannel ch) { new TuneState( parameters.requestedMaxFrameSize, (int) parameters.requestedHeartbeat.getSeconds()); this.clientProperties = clientProperties(parameters.clientProperties); + debug(() -> "exchanging peer properties"); this.serverProperties = peerProperties(); + debug(() -> "peer properties exchanged"); + debug(() -> "starting SASL handshake"); this.saslMechanisms = getSaslMechanisms(); + debug(() -> "SASL mechanisms supported by server ({})", this.saslMechanisms); + debug(() -> "starting authentication"); authenticate(this.credentialsProvider); + debug(() -> "authenticated"); this.tuneState.await(Duration.ofSeconds(10)); this.maxFrameSize = this.tuneState.getMaxFrameSize(); - this.frameSizeCopped = this.maxFrameSize() > 0; + this.frameSizeCapped = this.maxFrameSize() > 0; LOGGER.debug( "Connection tuned with max frame size {} and heartbeat {}", this.maxFrameSize(), @@ -418,6 +425,8 @@ public void initChannel(SocketChannel ch) { started.set(true); this.metricsCollector.openConnection(); } catch (RuntimeException e) { + LOGGER.debug( + "Error while opening connection {}: {}", this.clientConnectionName, e.getMessage()); this.closingSequence(null); throw e; } @@ -462,10 +471,14 @@ int maxFrameSize() { return this.maxFrameSize; } + private int nextCorrelationId() { + return this.correlationSequence.getAndIncrement(); + } + private Map peerProperties() { int clientPropertiesSize = mapSize(this.clientProperties); int length = 2 + 2 + 4 + clientPropertiesSize; - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocateNoCheck(length + 4); bb.writeInt(length); @@ -474,6 +487,7 @@ private Map peerProperties() { bb.writeInt(correlationId); writeMap(bb, this.clientProperties); OutstandingRequest> request = outstandingRequest(); + LOGGER.debug("Peer properties request has correlation ID {}", correlationId); outstandingRequests.put(correlationId, request); channel.writeAndFlush(bb); request.block(); @@ -539,7 +553,7 @@ private SaslAuthenticateResponse sendSaslAuthenticate( + saslMechanism.getName().length() + 4 + (challengeResponse == null ? 0 : challengeResponse.length); - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocateNoCheck(length + 4); bb.writeInt(length); @@ -569,7 +583,7 @@ private SaslAuthenticateResponse sendSaslAuthenticate( private Map open(String virtualHost) { int length = 2 + 2 + 4 + 2 + virtualHost.length(); - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -610,7 +624,7 @@ void send(byte[] content) { private void sendClose(short code, String reason) { int length = 2 + 2 + 4 + 2 + 2 + reason.length(); - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -643,7 +657,7 @@ private void sendClose(short code, String reason) { private List getSaslMechanisms() { int length = 2 + 2 + 4; - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocateNoCheck(length + 4); bb.writeInt(length); @@ -670,7 +684,7 @@ public Response create(String stream) { public Response create(String stream, Map arguments) { int length = 2 + 2 + 4 + 2 + stream.length() + mapSize(arguments); - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -719,7 +733,7 @@ Response createSuperStream( + collectionSize(partitions) + collectionSize(bindingKeys) + mapSize(arguments); - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -748,7 +762,7 @@ Response createSuperStream( Response deleteSuperStream(String superStream) { this.superStreamManagementCommandVersionsCheck.run(); int length = 2 + 2 + 4 + 2 + superStream.length(); - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -808,7 +822,7 @@ private static ByteBuf writeMap(ByteBuf bb, Map elements) { } ByteBuf allocate(ByteBufAllocator allocator, int capacity) { - if (frameSizeCopped && capacity > this.maxFrameSize()) { + if (frameSizeCapped && capacity > this.maxFrameSize()) { throw new IllegalArgumentException( "Cannot allocate " + capacity @@ -832,7 +846,7 @@ private ByteBuf allocateNoCheck(int capacity) { public Response delete(String stream) { int length = 2 + 2 + 4 + 2 + stream.length(); - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -864,7 +878,7 @@ public Map metadata(String... streams) { throw new IllegalArgumentException("At least one stream must be specified"); } int length = 2 + 2 + 4 + arraySize(streams); // API code, version, correlation ID, array size - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -897,7 +911,7 @@ public Response declarePublisher(byte publisherId, String publisherReference, St "If specified, publisher reference must less than 256 characters"); } int length = 2 + 2 + 4 + 1 + 2 + publisherReferenceSize + 2 + stream.length(); - int correlationId = correlationSequence.getAndIncrement(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -928,7 +942,7 @@ public Response declarePublisher(byte publisherId, String publisherReference, St public Response deletePublisher(byte publisherId) { int length = 2 + 2 + 4 + 1; - int correlationId = correlationSequence.getAndIncrement(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -1252,7 +1266,7 @@ public Response subscribe( propertiesSize = mapSize(properties); } length += propertiesSize; - int correlationId = correlationSequence.getAndIncrement(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -1320,7 +1334,7 @@ public QueryOffsetResponse queryOffset(String reference, String stream) { } int length = 2 + 2 + 4 + 2 + reference.length() + 2 + stream.length(); - int correlationId = correlationSequence.getAndIncrement(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -1361,7 +1375,7 @@ public long queryPublisherSequence(String publisherReference, String stream) { } int length = 2 + 2 + 4 + 2 + publisherReference.length() + 2 + stream.length(); - int correlationId = correlationSequence.getAndIncrement(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -1398,7 +1412,7 @@ public long queryPublisherSequence(String publisherReference, String stream) { public Response unsubscribe(byte subscriptionId) { int length = 2 + 2 + 4 + 1; - int correlationId = correlationSequence.getAndIncrement(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -1445,6 +1459,8 @@ private void closeNetty() { if (this.channel != null && this.channel.isOpen()) { LOGGER.debug("Closing Netty channel"); this.channel.close().get(10, TimeUnit.SECONDS); + } else { + LOGGER.debug("No Netty channel to close"); } } catch (InterruptedException e) { LOGGER.info("Channel closing has been interrupted"); @@ -1530,7 +1546,7 @@ public List route(String routingKey, String superStream) { + routingKey.length() + 2 + superStream.length(); // API code, version, correlation ID, 2 strings - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -1565,7 +1581,7 @@ public List partitions(String superStream) { } int length = 2 + 2 + 4 + 2 + superStream.length(); // API code, version, correlation ID, 1 string - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -1593,7 +1609,7 @@ List exchangeCommandVersions() { List commandVersions = ServerFrameHandler.commandVersions(); int length = 2 + 2 + 4 + 4; // API code, version, correlation ID, array size length += commandVersions.size() * (2 + 2 + 2); - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -1626,7 +1642,7 @@ StreamStatsResponse streamStats(String stream) { throw new IllegalArgumentException("stream must not be null"); } int length = 2 + 2 + 4 + 2 + stream.length(); // API code, version, correlation ID, 1 string - int correlationId = correlationSequence.incrementAndGet(); + int correlationId = nextCorrelationId(); try { ByteBuf bb = allocate(length + 4); bb.writeInt(length); @@ -2583,6 +2599,10 @@ public ClientParameters bootstrapCustomizer(Consumer bootstrapCustomi return this; } + Duration rpcTimeout() { + return this.rpcTimeout; + } + ClientParameters duplicate() { ClientParameters duplicate = new ClientParameters(); for (Field field : ClientParameters.class.getDeclaredFields()) { @@ -2926,4 +2946,10 @@ private OutstandingRequest outstandingRequest() { public String toString() { return "Client{connectionName='" + connectionName() + "'}"; } + + private void debug(Supplier format, Object... args) { + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("Connection '" + this.clientConnectionName + "': " + format.get(), args); + } + } } From def552383c62f9912de610deb87350ebd6e46421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 15 Jan 2025 15:29:18 +0100 Subject: [PATCH 345/449] Use lock in executor service factory Fixes #690 --- .../impl/DefaultExecutorServiceFactory.java | 66 ++++++++++++------- 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java b/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java index db47d1726f..63ccb6fea7 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java +++ b/src/main/java/com/rabbitmq/stream/impl/DefaultExecutorServiceFactory.java @@ -25,6 +25,8 @@ import java.util.concurrent.ThreadFactory; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; import java.util.function.Supplier; import java.util.stream.IntStream; import org.slf4j.Logger; @@ -42,12 +44,13 @@ class DefaultExecutorServiceFactory implements ExecutorServiceFactory { private final int minSize; private final int clientPerExecutor; private final Supplier executorFactory; + private final Lock lock = new ReentrantLock(); DefaultExecutorServiceFactory(int minSize, int clientPerExecutor, String prefix) { this.minSize = minSize; this.clientPerExecutor = clientPerExecutor; this.threadFactory = threadFactory(prefix); - this.executorFactory = () -> newExecutor(); + this.executorFactory = this::newExecutor; List l = new ArrayList<>(this.minSize); IntStream.range(0, this.minSize).forEach(ignored -> l.add(this.executorFactory.get())); executors = new CopyOnWriteArrayList<>(l); @@ -111,29 +114,39 @@ private Executor newExecutor() { } @Override - public synchronized ExecutorService get() { - if (closed.get()) { - throw new IllegalStateException("Executor service factory is closed"); - } else { - maybeResize(this.executors, this.minSize, this.clientPerExecutor, this.executorFactory); - LOGGER.debug("Looking least used executor in {}", this.executors); - Executor executor = this.executors.stream().min(EXECUTOR_COMPARATOR).get(); - LOGGER.debug("Least used executor is {}", executor); - executor.incrementUsage(); - return executor.executorService; + public ExecutorService get() { + this.lock.lock(); + try { + if (closed.get()) { + throw new IllegalStateException("Executor service factory is closed"); + } else { + maybeResize(this.executors, this.minSize, this.clientPerExecutor, this.executorFactory); + LOGGER.debug("Looking least used executor in {}", this.executors); + Executor executor = this.executors.stream().min(EXECUTOR_COMPARATOR).get(); + LOGGER.debug("Least used executor is {}", executor); + executor.incrementUsage(); + return executor.executorService; + } + } finally { + this.lock.unlock(); } } @Override - public synchronized void clientClosed(ExecutorService executorService) { - if (!closed.get()) { - Executor executor = find(executorService); - if (executor == null) { - LOGGER.info("Could not find executor service wrapper"); - } else { - executor.decrementUsage(); - maybeResize(this.executors, this.minSize, this.clientPerExecutor, this.executorFactory); + public void clientClosed(ExecutorService executorService) { + this.lock.lock(); + try { + if (!closed.get()) { + Executor executor = find(executorService); + if (executor == null) { + LOGGER.info("Could not find executor service wrapper"); + } else { + executor.decrementUsage(); + maybeResize(this.executors, this.minSize, this.clientPerExecutor, this.executorFactory); + } } + } finally { + this.lock.unlock(); } } @@ -148,17 +161,26 @@ private Executor find(ExecutorService executorService) { @Override public synchronized void close() { - if (closed.compareAndSet(false, true)) { - this.executors.forEach(executor -> executor.executorService.shutdownNow()); + this.lock.lock(); + try { + if (closed.compareAndSet(false, true)) { + this.executors.forEach(executor -> executor.executorService.shutdownNow()); + } + } finally { + this.lock.unlock(); } } static class Executor { + private static final AtomicInteger ID_SEQUENCE = new AtomicInteger(); + private final ExecutorService executorService; private AtomicInteger usage = new AtomicInteger(0); + private final int id; Executor(ExecutorService executorService) { + this.id = ID_SEQUENCE.getAndIncrement(); this.executorService = executorService; } @@ -192,7 +214,7 @@ private void close() { @Override public String toString() { - return "Executor{" + "usage=" + usage.get() + '}'; + return "Executor{" + "id=" + id + ", usage=" + usage.get() + '}'; } } } From 31a23bfba3ec28f24e305bcc93f0506bece420eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 15 Jan 2025 15:32:23 +0100 Subject: [PATCH 346/449] Retry stored offset lookup in consumer update callback Fixes #691 --- .../com/rabbitmq/stream/impl/AsyncRetry.java | 9 +- .../stream/impl/ConsumersCoordinator.java | 49 ++++++-- .../impl/DelegatingExecutorService.java | 105 +++++++++++++++++ .../stream/impl/ServerFrameHandler.java | 42 ++++--- .../rabbitmq/stream/impl/StreamConsumer.java | 111 ++++++++++-------- .../stream/impl/StreamEnvironment.java | 13 +- .../java/com/rabbitmq/stream/impl/Utils.java | 2 - .../rabbitmq/stream/impl/AsyncRetryTest.java | 47 ++++++-- .../stream/impl/StreamConsumerUnitTest.java | 71 ++++++++++- 9 files changed, 352 insertions(+), 97 deletions(-) create mode 100644 src/main/java/com/rabbitmq/stream/impl/DelegatingExecutorService.java diff --git a/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java b/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java index 2334cb7a08..6959f83328 100644 --- a/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java +++ b/src/main/java/com/rabbitmq/stream/impl/AsyncRetry.java @@ -53,6 +53,10 @@ private AsyncRetry( this.completableFuture.completeExceptionally(new CancellationException()); return; } + if (this.completableFuture.isCancelled()) { + LOGGER.debug("Task '{}' cancelled", description); + return; + } try { LOGGER.debug( "Running task '{}' (virtual threads: {})", @@ -64,9 +68,10 @@ private AsyncRetry( } catch (Exception e) { int attemptCount = attempts.getAndIncrement(); LOGGER.debug( - "Attempt {} for task '{}' failed, checking retry policy", + "Attempt {} for task '{}' failed with '{}', checking retry policy", attemptCount, - description); + description, + e.getMessage()); if (retry.test(e)) { if (delayPolicy.delay(attemptCount).equals(BackOffDelayPolicy.TIMEOUT)) { LOGGER.debug( diff --git a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java index 5a79a678ae..3faddae938 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java @@ -14,6 +14,7 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; +import static com.rabbitmq.stream.Constants.RESPONSE_CODE_SUBSCRIPTION_ID_ALREADY_EXISTS; import static com.rabbitmq.stream.impl.Utils.*; import static java.lang.String.format; import static java.util.stream.Collectors.toList; @@ -412,7 +413,7 @@ private static class SubscriptionTracker { private volatile boolean hasReceivedSomething = false; private volatile byte subscriptionIdInClient; private volatile ClientSubscriptionsManager manager; - private volatile AtomicReference state = + private final AtomicReference state = new AtomicReference<>(SubscriptionState.OPENING); private final ConsumerFlowStrategy flowStrategy; private final Lock subscriptionTrackerLock = new ReentrantLock(); @@ -507,7 +508,8 @@ SubscriptionState state() { String label() { return String.format( - "[id=%d, stream=%s, consumer=%d]", this.id, this.stream, this.consumer.id()); + "[id=%d, stream=%s, name=%s, consumer=%d]", + this.id, this.stream, this.offsetTrackingReference, this.consumer.id()); } } @@ -962,8 +964,27 @@ private void recoverSubscription(List candidates, SubscriptionTra recoveryBackOffDelayPolicy(), "Candidate lookup to consume from '%s' (subscription recovery)", tracker.stream); + } catch (StreamException e) { + LOGGER.warn( + "Stream error while re-assigning subscription from stream {} (name {})", + tracker.stream, + tracker.offsetTrackingReference, + e); + if (e.getCode() == RESPONSE_CODE_SUBSCRIPTION_ID_ALREADY_EXISTS) { + LOGGER.debug("Subscription ID already existing, retrying"); + } else { + LOGGER.debug( + "Not re-assigning consumer '{}' because of '{}'", tracker.label(), e.getMessage()); + reassignmentCompleted = true; + } } catch (Exception e) { - LOGGER.warn("Error while re-assigning subscription from stream {}", tracker.stream, e); + LOGGER.warn( + "Error while re-assigning subscription from stream {} (name {})", + tracker.stream, + tracker.offsetTrackingReference, + e); + LOGGER.debug( + "Not re-assigning consumer '{}' because of '{}'", tracker.label(), e.getMessage()); reassignmentCompleted = true; } } @@ -1002,11 +1023,13 @@ void add( List previousSubscriptions = this.subscriptionTrackers; LOGGER.debug( - "Subscribing to {}, requested offset specification is {}, offset tracking reference is {}, properties are {}", + "Subscribing to {}, requested offset specification is {}, offset tracking reference is {}, properties are {}, " + + "subscription ID is {}", subscriptionTracker.stream, offsetSpecification == null ? DEFAULT_OFFSET_SPECIFICATION : offsetSpecification, subscriptionTracker.offsetTrackingReference, - subscriptionTracker.subscriptionProperties); + subscriptionTracker.subscriptionProperties, + subscriptionId); try { // updating data structures before subscribing // (to make sure they are up-to-date in case message would arrive super fast) @@ -1063,12 +1086,11 @@ void add( subscriptionContext.offsetSpecification()); checkNotClosed(); - byte subId = subscriptionId; Client.Response subscribeResponse = Utils.callAndMaybeRetry( () -> client.subscribe( - subId, + subscriptionId, subscriptionTracker.stream, subscriptionContext.offsetSpecification(), subscriptionTracker.flowStrategy.initialCredits(), @@ -1084,6 +1106,19 @@ void add( + " failed with code " + formatConstant(subscribeResponse.getResponseCode()); LOGGER.debug(message); + if (subscribeResponse.getResponseCode() + == RESPONSE_CODE_SUBSCRIPTION_ID_ALREADY_EXISTS) { + if (LOGGER.isDebugEnabled()) { + SubscriptionTracker initialTracker = previousSubscriptions.get(subscriptionId); + LOGGER.debug("Subscription ID already exists"); + LOGGER.debug( + "Initial tracker with sub ID {}: consumer {}, stream {}, name {}", + subscriptionId, + initialTracker.consumer.id(), + initialTracker.stream, + initialTracker.offsetTrackingReference); + } + } throw convertCodeToException( subscribeResponse.getResponseCode(), subscriptionTracker.stream, () -> message); } diff --git a/src/main/java/com/rabbitmq/stream/impl/DelegatingExecutorService.java b/src/main/java/com/rabbitmq/stream/impl/DelegatingExecutorService.java new file mode 100644 index 0000000000..d55796955b --- /dev/null +++ b/src/main/java/com/rabbitmq/stream/impl/DelegatingExecutorService.java @@ -0,0 +1,105 @@ +// Copyright (c) 2025 Broadcom. All Rights Reserved. +// The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// +// This software, the RabbitMQ Stream Java client library, is dual-licensed under the +// Mozilla Public License 2.0 ("MPL"), and the Apache License version 2 ("ASL"). +// For the MPL, please see LICENSE-MPL-RabbitMQ. For the ASL, +// please see LICENSE-APACHE2. +// +// This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, +// either express or implied. See the LICENSE file for specific language governing +// rights and limitations of this software. +// +// If you have any questions regarding licensing, please contact us at +// info@rabbitmq.com. +package com.rabbitmq.stream.impl; + +import java.util.Collection; +import java.util.List; +import java.util.concurrent.*; + +final class DelegatingExecutorService implements ExecutorService { + + private final ExecutorService delegate; + private final int id; + + DelegatingExecutorService(int id, ExecutorService delegate) { + this.id = id; + this.delegate = delegate; + } + + @Override + public void shutdown() { + this.delegate.shutdown(); + } + + @Override + public List shutdownNow() { + return this.delegate.shutdownNow(); + } + + @Override + public boolean isShutdown() { + return this.delegate.isShutdown(); + } + + @Override + public boolean isTerminated() { + return this.delegate.isTerminated(); + } + + @Override + public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { + return this.delegate.awaitTermination(timeout, unit); + } + + @Override + public Future submit(Callable task) { + return this.delegate.submit(task); + } + + @Override + public Future submit(Runnable task, T result) { + return this.delegate.submit(task, result); + } + + @Override + public Future submit(Runnable task) { + return this.delegate.submit(task); + } + + @Override + public List> invokeAll(Collection> tasks) + throws InterruptedException { + return this.delegate.invokeAll(tasks); + } + + @Override + public List> invokeAll( + Collection> tasks, long timeout, TimeUnit unit) + throws InterruptedException { + return this.delegate.invokeAll(tasks, timeout, unit); + } + + @Override + public T invokeAny(Collection> tasks) + throws InterruptedException, ExecutionException { + return this.delegate.invokeAny(tasks); + } + + @Override + public T invokeAny(Collection> tasks, long timeout, TimeUnit unit) + throws InterruptedException, ExecutionException, TimeoutException { + return this.delegate.invokeAny(tasks, timeout, unit); + } + + @Override + public void execute(Runnable command) { + this.delegate.execute(command); + } + + @Override + public String toString() { + return "DelegatingExecutorService{" + "id=" + id + '}'; + } +} diff --git a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java index 0d4d662a8a..c8410bbd0f 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java +++ b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java @@ -251,6 +251,13 @@ public void handle(Client client, int frameSize, ChannelHandlerContext ctx, Byte } abstract int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message); + + protected void logMissingOutstandingRequest(int correlationId) { + LOGGER.warn( + "Could not find outstanding request with correlation ID {} ({})", + correlationId, + this.getClass().getSimpleName()); + } } private static class ConfirmFrameHandler extends BaseFrameHandler { @@ -670,7 +677,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { OutstandingRequest outstandingRequest = remove(client.outstandingRequests, correlationId, QueryPublisherSequenceResponse.class); if (outstandingRequest == null) { - LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); + logMissingOutstandingRequest(correlationId); } else { QueryPublisherSequenceResponse response = new QueryPublisherSequenceResponse(responseCode, sequence); @@ -695,7 +702,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { OutstandingRequest outstandingRequest = remove(client.outstandingRequests, correlationId, QueryOffsetResponse.class); if (outstandingRequest == null) { - LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); + logMissingOutstandingRequest(correlationId); } else { QueryOffsetResponse response = new QueryOffsetResponse(responseCode, offset); outstandingRequest.response().set(response); @@ -744,7 +751,13 @@ private static class PeerPropertiesFrameHandler extends BaseFrameHandler { @Override int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { + LOGGER.debug( + "Handling peer properties response for connection {}", client.clientConnectionName()); int correlationId = message.readInt(); + LOGGER.debug( + "Handling peer properties response for connection {}, correlation ID is {}", + client.clientConnectionName(), + correlationId); int read = 4; short responseCode = message.readShort(); @@ -773,7 +786,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { OutstandingRequest> outstandingRequest = remove(client.outstandingRequests, correlationId, new ParameterizedTypeReference<>() {}); if (outstandingRequest == null) { - LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); + logMissingOutstandingRequest(correlationId); } else { outstandingRequest.response().set(Collections.unmodifiableMap(serverProperties)); outstandingRequest.countDown(); @@ -811,7 +824,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { OutstandingRequest outstandingRequest = remove(client.outstandingRequests, correlationId, OpenResponse.class); if (outstandingRequest == null) { - LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); + logMissingOutstandingRequest(correlationId); } else { outstandingRequest.response().set(new OpenResponse(responseCode, connectionProperties)); outstandingRequest.countDown(); @@ -900,7 +913,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { OutstandingRequest outstandingRequest = remove(client.outstandingRequests, correlationId, SaslAuthenticateResponse.class); if (outstandingRequest == null) { - LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); + logMissingOutstandingRequest(correlationId); } else { outstandingRequest.response().set(response); outstandingRequest.countDown(); @@ -943,7 +956,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { correlationId, new ParameterizedTypeReference>() {}); if (outstandingRequest == null) { - LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); + logMissingOutstandingRequest(correlationId); } else { outstandingRequest.response().set(mechanisms); outstandingRequest.countDown(); @@ -1005,7 +1018,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { correlationId, new ParameterizedTypeReference>() {}); if (outstandingRequest == null) { - LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); + logMissingOutstandingRequest(correlationId); } else { outstandingRequest.response().set(results); outstandingRequest.countDown(); @@ -1026,7 +1039,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { OutstandingRequest outstandingRequest = remove(client.outstandingRequests, correlationId, Response.class); if (outstandingRequest == null) { - LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); + logMissingOutstandingRequest(correlationId); } else { Response response = new Response(responseCode); outstandingRequest.response().set(response); @@ -1063,12 +1076,9 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { } OutstandingRequest> outstandingRequest = - remove( - client.outstandingRequests, - correlationId, - new ParameterizedTypeReference>() {}); + remove(client.outstandingRequests, correlationId, new ParameterizedTypeReference<>() {}); if (outstandingRequest == null) { - LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); + logMissingOutstandingRequest(correlationId); } else { outstandingRequest.response().set(streams); outstandingRequest.countDown(); @@ -1110,7 +1120,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { correlationId, new ParameterizedTypeReference>() {}); if (outstandingRequest == null) { - LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); + logMissingOutstandingRequest(correlationId); } else { outstandingRequest.response().set(streams); outstandingRequest.countDown(); @@ -1155,7 +1165,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { correlationId, new ParameterizedTypeReference>() {}); if (outstandingRequest == null) { - LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); + logMissingOutstandingRequest(correlationId); } else { outstandingRequest.response().set(commandVersions); outstandingRequest.countDown(); @@ -1189,7 +1199,7 @@ int doHandle(Client client, ChannelHandlerContext ctx, ByteBuf message) { OutstandingRequest outstandingRequest = remove(client.outstandingRequests, correlationId, StreamStatsResponse.class); if (outstandingRequest == null) { - LOGGER.warn("Could not find outstanding request with correlation ID {}", correlationId); + logMissingOutstandingRequest(correlationId); } else { outstandingRequest.response().set(new StreamStatsResponse(responseCode, info)); outstandingRequest.countDown(); diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java index 336da76e4c..591b6db2e2 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumer.java @@ -17,21 +17,21 @@ import static com.rabbitmq.stream.BackOffDelayPolicy.fixedWithInitialDelay; import static com.rabbitmq.stream.impl.AsyncRetry.asyncRetry; import static com.rabbitmq.stream.impl.Utils.offsetBefore; +import static java.lang.String.format; import static java.time.Duration.ofMillis; import com.rabbitmq.stream.*; import com.rabbitmq.stream.MessageHandler.Context; import com.rabbitmq.stream.impl.Client.QueryOffsetResponse; import com.rabbitmq.stream.impl.StreamConsumerBuilder.TrackingConfiguration; +import com.rabbitmq.stream.impl.StreamEnvironment.LocatorNotAvailableException; import com.rabbitmq.stream.impl.StreamEnvironment.TrackingConsumerRegistration; import com.rabbitmq.stream.impl.Utils.CompositeConsumerUpdateListener; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.time.Duration; import java.util.Map; import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; +import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; @@ -161,18 +161,7 @@ class StreamConsumer implements Consumer { if (context.isActive()) { LOGGER.debug("Looking up offset (stream {})", this.stream); StreamConsumer consumer = (StreamConsumer) context.consumer(); - try { - long offset = getStoredOffsetSafely(consumer, this.environment); - LOGGER.debug( - "Stored offset is {}, returning the value + 1 to the server", offset); - result = OffsetSpecification.offset(offset + 1); - } catch (NoOffsetException e) { - LOGGER.debug( - "No stored offset, using initial offset specification: {}", - this.initialOffsetSpecification); - result = initialOffsetSpecification; - } - return result; + return getStoredOffset(consumer, environment, initialOffsetSpecification); } else { if (receivedSomething.get()) { LOGGER.debug( @@ -209,17 +198,7 @@ class StreamConsumer implements Consumer { if (context.isActive()) { LOGGER.debug("Going from passive to active, looking up offset"); StreamConsumer consumer = (StreamConsumer) context.consumer(); - try { - long offset = getStoredOffsetSafely(consumer, this.environment); - LOGGER.debug( - "Stored offset is {}, returning the value + 1 to the server", offset); - result = OffsetSpecification.offset(offset + 1); - } catch (NoOffsetException e) { - LOGGER.debug( - "No stored offset, using initial offset specification: {}", - this.initialOffsetSpecification); - result = initialOffsetSpecification; - } + result = getStoredOffset(consumer, environment, initialOffsetSpecification); } return result; }; @@ -274,38 +253,74 @@ class StreamConsumer implements Consumer { } } + static OffsetSpecification getStoredOffset( + StreamConsumer consumer, StreamEnvironment environment, OffsetSpecification fallback) { + OffsetSpecification result = null; + while (result == null) { + try { + long offset = getStoredOffsetSafely(consumer, environment); + LOGGER.debug("Stored offset is {}, returning the value + 1 to the server", offset); + result = OffsetSpecification.offset(offset + 1); + } catch (NoOffsetException e) { + LOGGER.debug("No stored offset, using initial offset specification: {}", fallback); + result = fallback; + } catch (TimeoutStreamException e) { + LOGGER.debug("Timeout when looking up stored offset, retrying"); + } + } + return result; + } + static long getStoredOffsetSafely(StreamConsumer consumer, StreamEnvironment environment) { long offset; try { offset = consumer.storedOffset(); } catch (IllegalStateException e) { - LOGGER.debug("Leader connection not available to retrieve offset, retrying"); - // no connection to leader to retrieve the offset, retrying + LOGGER.debug( + "Leader connection for '{}' not available to retrieve offset, retrying", consumer.stream); + // no connection to leader to retrieve the offset, trying with environment connections + String description = + format("Stored offset retrieval for '%s' on stream '%s'", consumer.name, consumer.stream); CompletableFuture storedOffetRetrievalFuture = - asyncRetry(() -> consumer.storedOffset(() -> consumer.trackingClient())) - .description( - "Stored offset retrieval for '%s' on stream '%s'", consumer.name, consumer.stream) + asyncRetry(() -> consumer.storedOffset(() -> environment.locator().client())) + .description(description) .scheduler(environment.scheduledExecutorService()) - .retry(ex -> ex instanceof IllegalStateException) + .retry( + ex -> + ex instanceof IllegalStateException + || ex instanceof LocatorNotAvailableException) .delayPolicy( fixedWithInitialDelay( - environment.recoveryBackOffDelayPolicy().delay(0), + Duration.ZERO, environment.recoveryBackOffDelayPolicy().delay(1), environment.recoveryBackOffDelayPolicy().delay(0).multipliedBy(3))) .build(); try { - offset = storedOffetRetrievalFuture.get(); + offset = + storedOffetRetrievalFuture.get( + environment.rpcTimeout().toMillis(), TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); throw new StreamException( - String.format( + format( "Could not get stored offset for '%s' on stream '%s'", consumer.name, consumer.stream), ex); } catch (ExecutionException ex) { - throw new StreamException( - String.format( - "Could not get stored offset for '%s' on stream '%s'", + if (ex.getCause() instanceof StreamException) { + throw (StreamException) ex.getCause(); + } else { + throw new StreamException( + format( + "Could not get stored offset for '%s' on stream '%s'", + consumer.name, consumer.stream), + ex); + } + } catch (TimeoutException ex) { + storedOffetRetrievalFuture.cancel(true); + throw new TimeoutStreamException( + format( + "Could not get stored offset for '%s' on stream '%s' (timeout)", consumer.name, consumer.stream), ex); } @@ -313,10 +328,6 @@ static long getStoredOffsetSafely(StreamConsumer consumer, StreamEnvironment env return offset; } - Client trackingClient() { - return this.trackingClient; - } - void waitForOffsetToBeStored(long expectedStoredOffset) { CompletableFuture storedTask = asyncRetry( @@ -469,8 +480,9 @@ boolean sacActive() { return this.sacActive; } - private boolean canTrack() { - return (this.status == Status.INITIALIZING || this.status == Status.RUNNING) + boolean canTrack() { + return ((this.status == Status.INITIALIZING || this.status == Status.RUNNING) + || (this.trackingClient == null && this.status == Status.NOT_AVAILABLE)) && this.name != null; } @@ -557,7 +569,7 @@ long storedOffset(Supplier clientSupplier) { response = clientSupplier.get().queryOffset(this.name, this.stream); } catch (Exception e) { throw new IllegalStateException( - String.format( + format( "Not possible to query offset for consumer %s on stream %s for now: %s", this.name, this.stream, e.getMessage()), e); @@ -566,23 +578,22 @@ long storedOffset(Supplier clientSupplier) { return response.getOffset(); } else if (response.getResponseCode() == Constants.RESPONSE_CODE_NO_OFFSET) { throw new NoOffsetException( - String.format( + format( "No offset stored for consumer %s on stream %s (%s)", this.name, this.stream, Utils.formatConstant(response.getResponseCode()))); } else { throw new StreamException( - String.format( + format( "QueryOffset for consumer %s on stream %s returned an error (%s)", this.name, this.stream, Utils.formatConstant(response.getResponseCode())), response.getResponseCode()); } - } else if (this.name == null) { throw new UnsupportedOperationException( "Not possible to query stored offset for a consumer without a name"); } else { throw new IllegalStateException( - String.format( + format( "Not possible to query offset for consumer %s on stream %s for now, consumer status is %s", this.name, this.stream, this.status.name())); } diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index adece78863..1aa1083f78 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -15,9 +15,11 @@ package com.rabbitmq.stream.impl; import static com.rabbitmq.stream.impl.AsyncRetry.asyncRetry; +import static com.rabbitmq.stream.impl.Client.DEFAULT_RPC_TIMEOUT; import static com.rabbitmq.stream.impl.ThreadUtils.threadFactory; import static com.rabbitmq.stream.impl.Utils.*; import static java.lang.String.format; +import static java.util.Optional.ofNullable; import static java.util.concurrent.TimeUnit.SECONDS; import static java.util.stream.Collectors.toList; @@ -88,6 +90,7 @@ class StreamEnvironment implements Environment { private final List locators; private final ExecutorServiceFactory executorServiceFactory; private final ObservationCollector observationCollector; + private final Duration rpcTimeout; @SuppressFBWarnings("CT_CONSTRUCTOR_THROW") StreamEnvironment( @@ -114,6 +117,8 @@ class StreamEnvironment implements Environment { this.recoveryBackOffDelayPolicy = recoveryBackOffDelayPolicy; this.topologyUpdateBackOffDelayPolicy = topologyBackOffDelayPolicy; this.byteBufAllocator = byteBufAllocator; + this.rpcTimeout = + ofNullable(clientParametersPrototype.rpcTimeout()).orElse(DEFAULT_RPC_TIMEOUT); clientParametersPrototype = clientParametersPrototype.byteBufAllocator(byteBufAllocator); clientParametersPrototype = maybeSetUpClientParametersFromUris(uris, clientParametersPrototype); @@ -713,6 +718,10 @@ ScheduledExecutorService scheduledExecutorService() { return this.scheduledExecutorService; } + Duration rpcTimeout() { + return this.rpcTimeout; + } + void execute(Runnable task, String description, Object... args) { this.scheduledExecutorService().execute(namedRunnable(task, description, args)); } @@ -998,7 +1007,7 @@ static class Locator { Locator client(Client client) { Client previous = this.nullableClient(); - this.client = Optional.ofNullable(client); + this.client = ofNullable(client); LocalDateTime now = LocalDateTime.now(); LOGGER.debug( "Locator wrapper '{}' updated from {} to {}, last changed {}, {} ago", @@ -1023,7 +1032,7 @@ private boolean isSet() { return this.client.isPresent(); } - private Client client() { + Client client() { return this.client.orElseThrow(() -> new LocatorNotAvailableException(id)); } diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index 4ce8c92ef2..d00728954f 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -312,8 +312,6 @@ interface ClientFactory { static class ConditionalClientFactory implements ClientFactory { - private static final Duration RETRY_INTERVAL = Duration.ofSeconds(1); - private final ClientFactory delegate; private final BiPredicate condition; private final Duration retryInterval; diff --git a/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java b/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java index 30322b4d3d..7c18ded3b3 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AsyncRetryTest.java @@ -14,18 +14,20 @@ // info@rabbitmq.com. package com.rabbitmq.stream.impl; +import static com.rabbitmq.stream.BackOffDelayPolicy.fixedWithInitialDelay; +import static com.rabbitmq.stream.impl.Assertions.assertThat; +import static com.rabbitmq.stream.impl.TestUtils.sync; +import static java.time.Duration.*; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.*; -import com.rabbitmq.stream.BackOffDelayPolicy; -import java.time.Duration; +import com.rabbitmq.stream.impl.TestUtils.Sync; import java.util.List; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; import org.mockito.Mock; @@ -37,7 +39,7 @@ public class AsyncRetryTest { AutoCloseable mocks; @BeforeEach - void init(TestInfo info) { + void init() { mocks = MockitoAnnotations.openMocks(this); } @@ -52,12 +54,11 @@ void callbackCalledIfCompletedImmediately(ScheduledExecutorService scheduler) th when(task.call()).thenReturn(42); CompletableFuture completableFuture = AsyncRetry.asyncRetry(task) - .delayPolicy( - BackOffDelayPolicy.fixedWithInitialDelay(Duration.ZERO, Duration.ofMillis(10))) + .delayPolicy(fixedWithInitialDelay(ZERO, ofMillis(10))) .scheduler(scheduler) .build(); AtomicInteger result = new AtomicInteger(0); - completableFuture.thenAccept(value -> result.set(value)); + completableFuture.thenAccept(result::set); assertThat(result.get()).isEqualTo(42); verify(task, times(1)).call(); } @@ -70,7 +71,7 @@ void shouldRetryWhenExecutionFails(ScheduledExecutorService scheduler) throws Ex .thenThrow(new RuntimeException()) .thenReturn(42); CompletableFuture completableFuture = - AsyncRetry.asyncRetry(task).scheduler(scheduler).delay(Duration.ofMillis(50)).build(); + AsyncRetry.asyncRetry(task).scheduler(scheduler).delay(ofMillis(50)).build(); CountDownLatch latch = new CountDownLatch(1); AtomicInteger result = new AtomicInteger(0); completableFuture.thenAccept( @@ -91,9 +92,7 @@ void shouldTimeoutWhenExecutionFailsForTooLong(ScheduledExecutorService schedule CompletableFuture completableFuture = AsyncRetry.asyncRetry(task) .scheduler(scheduler) - .delayPolicy( - BackOffDelayPolicy.fixedWithInitialDelay( - Duration.ofMillis(50), Duration.ofMillis(50), Duration.ofMillis(500))) + .delayPolicy(fixedWithInitialDelay(ofMillis(50), ofMillis(50), ofMillis(500))) .build(); CountDownLatch latch = new CountDownLatch(1); AtomicBoolean acceptCalled = new AtomicBoolean(false); @@ -126,7 +125,7 @@ void shouldRetryWhenPredicateAllowsIt(ScheduledExecutorService scheduler) throws AsyncRetry.asyncRetry(task) .scheduler(scheduler) .retry(e -> e instanceof IllegalStateException) - .delay(Duration.ofMillis(50)) + .delay(ofMillis(50)) .build(); CountDownLatch latch = new CountDownLatch(1); AtomicInteger result = new AtomicInteger(0); @@ -152,7 +151,7 @@ void shouldFailWhenPredicateDoesNotAllowRetry(ScheduledExecutorService scheduler AsyncRetry.asyncRetry(task) .scheduler(scheduler) .retry(e -> !(e instanceof IllegalArgumentException)) - .delay(Duration.ofMillis(50)) + .delay(ofMillis(50)) .build(); CountDownLatch latch = new CountDownLatch(1); AtomicBoolean acceptCalled = new AtomicBoolean(false); @@ -174,6 +173,28 @@ void shouldFailWhenPredicateDoesNotAllowRetry(ScheduledExecutorService scheduler verify(task, times(3)).call(); } + @ParameterizedTest + @MethodSource("schedulers") + void completeExceptionally(ScheduledExecutorService scheduler) throws Exception { + when(task.call()).thenThrow(new UnsupportedOperationException()); + CompletableFuture completableFuture = + AsyncRetry.asyncRetry(task) + .delayPolicy(fixedWithInitialDelay(ZERO, ofMillis(10))) + .retry(ex -> ex instanceof IllegalStateException) + .scheduler(scheduler) + .build(); + Sync sync = sync(); + completableFuture.handleAsync( + (v, ex) -> { + if (ex != null) { + sync.down(); + } + return null; + }, + scheduler); + assertThat(sync).completes(); + } + static List schedulers() { return List.of( Executors.newSingleThreadScheduledExecutor(), diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java index 7ed68df6eb..226a082028 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerUnitTest.java @@ -16,13 +16,13 @@ import static com.rabbitmq.stream.impl.StreamConsumer.getStoredOffsetSafely; import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.mockito.ArgumentMatchers.*; +import static org.mockito.Mockito.*; import com.rabbitmq.stream.BackOffDelayPolicy; +import com.rabbitmq.stream.Constants; +import com.rabbitmq.stream.NoOffsetException; import java.time.Duration; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; @@ -34,8 +34,12 @@ public class StreamConsumerUnitTest { + private static final Duration LARGE_RPC_TIMEOUT = Duration.ofSeconds(10); + @Mock StreamConsumer consumer; @Mock StreamEnvironment environment; + @Mock Client client; + @Mock StreamEnvironment.Locator locator; AutoCloseable closeable; @@ -68,9 +72,66 @@ void getStoredOffsetSafely_ShouldRetryWhenLeaderConnectionIsNotAvailable() { when(consumer.storedOffset(any())).thenThrow(new IllegalStateException()).thenReturn(42L); Duration retryDelay = Duration.ofMillis(10); when(environment.recoveryBackOffDelayPolicy()).thenReturn(BackOffDelayPolicy.fixed(retryDelay)); + when(environment.rpcTimeout()).thenReturn(LARGE_RPC_TIMEOUT); assertThat(getStoredOffsetSafely(consumer, environment)).isEqualTo(42); verify(consumer, times(1)).storedOffset(); verify(environment, times(1)).scheduledExecutorService(); verify(consumer, times(2)).storedOffset(any()); } + + @Test + void getStoredOffsetSafely_ShouldThrowNoOffsetException() { + when(consumer.storedOffset()).thenThrow(new NoOffsetException("")); + assertThatThrownBy(() -> getStoredOffsetSafely(consumer, environment)) + .isInstanceOf(NoOffsetException.class); + verify(consumer, times(1)).storedOffset(); + verify(environment, never()).scheduledExecutorService(); + verify(consumer, never()).storedOffset(any()); + } + + @Test + void getStoredOffsetSafely_ShouldReThrowNoOffsetExceptionFromFallback() { + when(consumer.storedOffset()).thenThrow(new IllegalStateException()); + when(consumer.storedOffset(any())).thenThrow(new NoOffsetException("no offset")); + Duration retryDelay = Duration.ofMillis(10); + when(environment.recoveryBackOffDelayPolicy()).thenReturn(BackOffDelayPolicy.fixed(retryDelay)); + assertThatThrownBy(() -> getStoredOffsetSafely(consumer, environment)) + .isInstanceOf(NoOffsetException.class); + verify(consumer, times(1)).storedOffset(); + verify(environment, times(1)).scheduledExecutorService(); + verify(consumer, times(1)).storedOffset(any()); + } + + @Test + void getStoredOffsetSafely_ShouldThrowTimeoutExceptionIfFallbackTimesOut() { + when(consumer.storedOffset()).thenThrow(new IllegalStateException()); + when(consumer.storedOffset(any())).thenThrow(new IllegalStateException()); + Duration retryDelay = Duration.ofMillis(50); + Duration rpcTimeout = retryDelay.multipliedBy(2); + when(environment.rpcTimeout()).thenReturn(rpcTimeout); + when(environment.recoveryBackOffDelayPolicy()).thenReturn(BackOffDelayPolicy.fixed(retryDelay)); + assertThatThrownBy(() -> getStoredOffsetSafely(consumer, environment)) + .isInstanceOf(TimeoutStreamException.class); + verify(consumer, times(1)).storedOffset(); + verify(environment, times(1)).scheduledExecutorService(); + verify(consumer, atLeastOnce()).storedOffset(any()); + } + + @Test + void getStoredOffsetSafely_ShouldUseLocatorConnectionWhenLeaderConnectionIsNotAvailable() { + when(consumer.canTrack()).thenReturn(true); + when(consumer.storedOffset()).thenThrow(new IllegalStateException()); + when(consumer.storedOffset(any())).thenCallRealMethod(); + when(environment.locator()).thenReturn(locator); + when(locator.client()).thenReturn(client); + when(client.queryOffset(isNull(), isNull())) + .thenReturn(new Client.QueryOffsetResponse(Constants.RESPONSE_CODE_OK, 42L)); + Duration retryDelay = Duration.ofMillis(10); + when(environment.recoveryBackOffDelayPolicy()).thenReturn(BackOffDelayPolicy.fixed(retryDelay)); + assertThat(getStoredOffsetSafely(consumer, environment)).isEqualTo(42L); + verify(consumer, times(1)).storedOffset(); + verify(environment, times(1)).scheduledExecutorService(); + verify(environment, times(1)).locator(); + verify(consumer, times(1)).storedOffset(any()); + } } From fc669c7bde0efb60515d9f4b483a512159d2956e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 16:19:07 +0000 Subject: [PATCH 347/449] Bump com.diffplug.spotless:spotless-maven-plugin from 2.44.1 to 2.44.2 Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.44.1 to 2.44.2. - [Release notes](https://github.com/diffplug/spotless/releases) - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/maven/2.44.1...maven/2.44.2) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6e90311320..b053cdc336 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 2.3.1 3.2.1 1.37 - 2.44.1 + 2.44.2 1.25.2 0.8.12 4.8.6.6 From c5267fbeb92ea61a68bdaf3dabff21bd3b90b40d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 16:35:25 +0000 Subject: [PATCH 348/449] Bump spotbugs.version from 4.8.6 to 4.9.0 Bumps `spotbugs.version` from 4.8.6 to 4.9.0. Updates `com.github.spotbugs:spotbugs-annotations` from 4.8.6 to 4.9.0 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.8.6...4.9.0) Updates `com.github.spotbugs:spotbugs` from 4.8.6 to 4.9.0 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.8.6...4.9.0) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-annotations dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.github.spotbugs:spotbugs dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b053cdc336..3f402f9592 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ 1.25.2 0.8.12 4.8.6.6 - 4.8.6 + 4.9.0 4.0 From 09106626ebf424a6e55e35539b8739e19751084c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 16:35:32 +0000 Subject: [PATCH 349/449] Bump com.swiftmq:swiftmq-client from 13.0.2 to 13.1.0 Bumps [com.swiftmq:swiftmq-client](https://github.com/iitsoftware/swiftmq-client) from 13.0.2 to 13.1.0. - [Release notes](https://github.com/iitsoftware/swiftmq-client/releases) - [Commits](https://github.com/iitsoftware/swiftmq-client/compare/13.0.2...13.1.0) --- updated-dependencies: - dependency-name: com.swiftmq:swiftmq-client dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b053cdc336..873991e4e7 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ 0.34.1 4.2.30 1.14.3 - 13.0.2 + 13.1.0 4.7.5 1.27.1 1.5.6-9 From e4df9c1f11fd997fa9bbce247fa043ac43e768ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:24:17 +0000 Subject: [PATCH 350/449] Bump org.assertj:assertj-core from 3.27.2 to 3.27.3 Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.27.2 to 3.27.3. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.27.2...assertj-build-3.27.3) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5bca4664be..8c478e61e8 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.8.0 1.1.10.7 5.11.4 - 3.27.2 + 3.27.3 5.15.2 5.24.0 3.17.0 From 534c926b6bda8ff520ed8c175893adda58f13976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 27 Jan 2025 09:32:14 +0100 Subject: [PATCH 351/449] Add message to test assertion --- .../stream/impl/StreamProducerBuilder.java | 4 +- .../stream/impl/SuperStreamConsumerTest.java | 6 ++- .../rabbitmq/stream/impl/TestUtilsTest.java | 41 +++++++++++++++---- 3 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java index e82ad142b5..43a57bbc5c 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamProducerBuilder.java @@ -28,8 +28,8 @@ class StreamProducerBuilder implements ProducerBuilder { - static final boolean DEFAULT_DYNAMIC_BATCH = - Boolean.parseBoolean(System.getProperty("rabbitmq.stream.producer.dynamic.batch", "true")); + static final boolean DEFAULT_DYNAMIC_BATCH = true; +// Boolean.parseBoolean(System.getProperty("rabbitmq.stream.producer.dynamic.batch", "true")); private final StreamEnvironment environment; diff --git a/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java index c5e5c8b62a..df3dbb67a2 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java @@ -330,7 +330,8 @@ void rebalancedPartitionShouldGetMessagesWhenItComesBackToOriginalConsumerInstan processing.run(); }) .build(); - waitAtMost(() -> receivedPartitions.size() == partitions.size()); + waitAtMost(() -> receivedPartitions.size() == partitions.size(), + () -> format("Expected to receive messages from all partitions, got %s", receivedPartitions)); AtomicReference partition = new AtomicReference<>(); Consumer consumer2 = @@ -352,7 +353,8 @@ void rebalancedPartitionShouldGetMessagesWhenItComesBackToOriginalConsumerInstan waitAtMost(() -> partition.get() != null); consumer2.close(); receivedPartitions.clear(); - waitAtMost(() -> receivedPartitions.size() == partitions.size()); + waitAtMost(() -> receivedPartitions.size() == partitions.size(), + () -> format("Expected to receive messages from all partitions, got %s", receivedPartitions)); consumer1.close(); } } diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java b/src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java index b9ef7c1e92..9938ef90ef 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtilsTest.java @@ -16,18 +16,41 @@ import static org.assertj.core.api.Assertions.assertThat; +import java.util.concurrent.Executor; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; public class TestUtilsTest { - @ParameterizedTest - @CsvSource({ - "3.9.6,3.9.5,false", - "3.9.6,3.9.0-alpha-stream.232,true", - "3.9.6,3.9.6-alpha.28,true" - }) - void atLeastVersion(String expectedVersion, String currentVersion, boolean expected) { - assertThat(TestUtils.atLeastVersion(expectedVersion, currentVersion)).isEqualTo(expected); - } + @ParameterizedTest + @CsvSource( + { + "3.9.6,3.9.5,false", + "3.9.6,3.9.0-alpha-stream.232,true", + "3.9.6,3.9.6-alpha.28,true", + } + ) + void atLeastVersion( + String expectedVersion, + String currentVersion, + boolean expected + ) { + assertThat( + TestUtils.atLeastVersion(expectedVersion, currentVersion) + ).isEqualTo(expected); + } + + private static class DelegatingExecutor implements Executor { + + private final Executor delegate; + + private DelegatingExecutor(Executor delegate) { + this.delegate = delegate; + } + + @Override + public void execute(Runnable command) { + delegate.execute(command); + } + } } From 3c7359969561628c24140329b078a02d9ceeee25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 27 Jan 2025 11:06:31 +0100 Subject: [PATCH 352/449] Fix flake --- .../stream/impl/SuperStreamConsumerTest.java | 137 +++++++++++------- 1 file changed, 84 insertions(+), 53 deletions(-) diff --git a/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java index df3dbb67a2..a563532c06 100644 --- a/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/SuperStreamConsumerTest.java @@ -94,6 +94,37 @@ private static void publishToPartitions( latchAssert(publishLatch).completes(); } + static AutoCloseable publishToPartitions(TestUtils.ClientFactory cf, List partitions) { + Client client = cf.get(); + for (int i = 0; i < partitions.size(); i++) { + assertThat(client.declarePublisher(b(i), null, partitions.get(i)).isOk()).isTrue(); + } + Runnable publish = + () -> { + int count = 0; + while (!Thread.currentThread().isInterrupted()) { + int partitionIndex = count++ % partitions.size(); + String partition = partitions.get(partitionIndex); + client.publish( + b(partitionIndex), + Collections.singletonList( + client + .messageBuilder() + .addData(partition.getBytes(StandardCharsets.UTF_8)) + .build())); + try { + Thread.sleep(10); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + break; + } + } + }; + Thread thread = new Thread(publish); + thread.start(); + return thread::interrupt; + } + @Test void consumeAllMessagesFromAllPartitions() { declareSuperStreamTopology(configurationClient, superStream, partitionCount); @@ -299,62 +330,62 @@ void autoOffsetTrackingShouldStoreOffsetZero() { @BrokerVersionAtLeast(RABBITMQ_3_11_11) void rebalancedPartitionShouldGetMessagesWhenItComesBackToOriginalConsumerInstance() throws Exception { + Duration timeout = Duration.ofSeconds(60); declareSuperStreamTopology(configurationClient, superStream, partitionCount); Client client = cf.get(); List partitions = client.partitions(superStream); - int messageCount = 10_000; - publishToPartitions(cf, partitions, messageCount); - String consumerName = "my-app"; - Set receivedPartitions = ConcurrentHashMap.newKeySet(partitionCount); - Runnable processing = - () -> { - try { - Thread.sleep(10); - } catch (InterruptedException e) { - // OK - } - }; - Consumer consumer1 = - environment - .consumerBuilder() - .superStream(superStream) - .singleActiveConsumer() - .offset(OffsetSpecification.first()) - .name(consumerName) - .autoTrackingStrategy() - .messageCountBeforeStorage(messageCount / partitionCount / 50) - .builder() - .messageHandler( - (context, message) -> { - receivedPartitions.add(context.stream()); - processing.run(); - }) - .build(); - waitAtMost(() -> receivedPartitions.size() == partitions.size(), - () -> format("Expected to receive messages from all partitions, got %s", receivedPartitions)); + try (AutoCloseable publish = publishToPartitions(cf, partitions)) { + int messageCountBeforeStorage = 10; + String consumerName = "my-app"; + Set receivedPartitions = ConcurrentHashMap.newKeySet(partitionCount); + Consumer consumer1 = + environment + .consumerBuilder() + .superStream(superStream) + .singleActiveConsumer() + .offset(OffsetSpecification.first()) + .name(consumerName) + .autoTrackingStrategy() + .messageCountBeforeStorage(messageCountBeforeStorage) + .builder() + .messageHandler( + (context, message) -> { + receivedPartitions.add(context.stream()); + }) + .build(); + waitAtMost( + timeout, + () -> receivedPartitions.size() == partitions.size(), + () -> + format( + "Expected to receive messages from all partitions, got %s", receivedPartitions)); - AtomicReference partition = new AtomicReference<>(); - Consumer consumer2 = - environment - .consumerBuilder() - .superStream(superStream) - .singleActiveConsumer() - .offset(OffsetSpecification.first()) - .name(consumerName) - .autoTrackingStrategy() - .messageCountBeforeStorage(messageCount / partitionCount / 50) - .builder() - .messageHandler( - (context, message) -> { - partition.set(context.stream()); - processing.run(); - }) - .build(); - waitAtMost(() -> partition.get() != null); - consumer2.close(); - receivedPartitions.clear(); - waitAtMost(() -> receivedPartitions.size() == partitions.size(), - () -> format("Expected to receive messages from all partitions, got %s", receivedPartitions)); - consumer1.close(); + AtomicReference partition = new AtomicReference<>(); + Consumer consumer2 = + environment + .consumerBuilder() + .superStream(superStream) + .singleActiveConsumer() + .offset(OffsetSpecification.first()) + .name(consumerName) + .autoTrackingStrategy() + .messageCountBeforeStorage(messageCountBeforeStorage) + .builder() + .messageHandler( + (context, message) -> { + partition.set(context.stream()); + }) + .build(); + waitAtMost(timeout, () -> partition.get() != null); + consumer2.close(); + receivedPartitions.clear(); + waitAtMost( + timeout, + () -> receivedPartitions.size() == partitions.size(), + () -> + format( + "Expected to receive messages from all partitions, got %s", receivedPartitions)); + consumer1.close(); + } } } From d013bf512d36445c692bb5918e89007ad81eb7eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 27 Jan 2025 15:11:40 +0100 Subject: [PATCH 353/449] Set release version to 0.23.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index f724bf031a..6be9f95466 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,5 +1,5 @@ -RELEASE_VERSION="0.21.0" -DEVELOPMENT_VERSION="0.22.0-SNAPSHOT" +RELEASE_VERSION="0.22.0" +DEVELOPMENT_VERSION="0.23.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 5ad4c0790be6022b28d5e8aa366bb7c9e87d65fe Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 27 Jan 2025 14:13:38 +0000 Subject: [PATCH 354/449] [maven-release-plugin] prepare release v0.22.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 8c478e61e8..b53b4e1f6c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.22.0-SNAPSHOT + 0.22.0 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.22.0 From e5e9d629efe33228f285df8ee08d42439be5b485 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 27 Jan 2025 14:13:39 +0000 Subject: [PATCH 355/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b53b4e1f6c..6a31022e5a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.22.0 + 0.23.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.22.0 + HEAD From eb089c670b35ffdede9511eb5f65572a4f9a148f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Jan 2025 16:52:42 +0000 Subject: [PATCH 356/449] Bump commons-codec:commons-codec from 1.17.2 to 1.18.0 Bumps [commons-codec:commons-codec](https://github.com/apache/commons-codec) from 1.17.2 to 1.18.0. - [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt) - [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.17.2...rel/commons-codec-1.18.0) --- updated-dependencies: - dependency-name: commons-codec:commons-codec dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6a31022e5a..57ebb55b67 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 5.15.2 5.24.0 3.17.0 - 1.17.2 + 1.18.0 2.11.0 0.10.5 1.2.5 From 99d5955262ccd780e3b1f420472187d0086baff5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 16:28:47 +0000 Subject: [PATCH 357/449] Bump com.google.code.gson:gson from 2.11.0 to 2.12.0 Bumps [com.google.code.gson:gson](https://github.com/google/gson) from 2.11.0 to 2.12.0. - [Release notes](https://github.com/google/gson/releases) - [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md) - [Commits](https://github.com/google/gson/compare/gson-parent-2.11.0...gson-parent-2.12.0) --- updated-dependencies: - dependency-name: com.google.code.gson:gson dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 57ebb55b67..e0a7a9723a 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ 5.24.0 3.17.0 1.18.0 - 2.11.0 + 2.12.0 0.10.5 1.2.5 1.4.2 From 59fe87cdb17cd97c8d6a7eb485fe818eda12a004 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 31 Jan 2025 09:09:06 +0100 Subject: [PATCH 358/449] Collect consumed metric message by message Instead of collecting after the whole chunk is dispatched. This makes the metric more accurate when message processing takes some time. --- .../java/com/rabbitmq/stream/impl/ServerFrameHandler.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java index c8410bbd0f..93050de1b6 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java +++ b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java @@ -451,7 +451,6 @@ static int handleDeliver( } metricsCollector.chunk(numEntries); - long messagesRead = 0; MutableBoolean messageIgnored = new MutableBoolean(false); while (numRecords != 0) { @@ -482,7 +481,7 @@ static int handleDeliver( subscriptionId, offset, chunkTimestamp, committedOffset, chunkContext); messageIgnored.set(false); } else { - messagesRead++; + metricsCollector.consume(1); } numRecords--; offset++; // works even for unsigned long @@ -551,7 +550,7 @@ static int handleDeliver( subscriptionId, offset, chunkTimestamp, committedOffset, chunkContext); messageIgnored.set(false); } else { - messagesRead++; + metricsCollector.consume(1); } numRecordsInBatch--; offset++; // works even for unsigned long @@ -564,7 +563,6 @@ static int handleDeliver( } } } - metricsCollector.consume(messagesRead); return read; } From a3e66db7cb551267dea2da14f0d1e41d22aa352c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 16:20:39 +0000 Subject: [PATCH 359/449] Bump com.google.code.gson:gson from 2.12.0 to 2.12.1 Bumps [com.google.code.gson:gson](https://github.com/google/gson) from 2.12.0 to 2.12.1. - [Release notes](https://github.com/google/gson/releases) - [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md) - [Commits](https://github.com/google/gson/compare/gson-parent-2.12.0...gson-parent-2.12.1) --- updated-dependencies: - dependency-name: com.google.code.gson:gson dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e0a7a9723a..3d74718190 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ 5.24.0 3.17.0 1.18.0 - 2.12.0 + 2.12.1 0.10.5 1.2.5 1.4.2 From c0a7dff993e5ea5236be4d613502c8e1f1288ced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 3 Feb 2025 09:30:24 +0100 Subject: [PATCH 360/449] Test against Java 25 ea --- .github/workflows/test-supported-java-versions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index 05834c9d78..f7694cdc18 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: distribution: [ 'temurin' ] - version: [ '11', '17', '21', '23', '24-ea' ] + version: [ '11', '17', '21', '23', '24-ea', '25-ea' ] include: - distribution: 'semeru' version: '17' From adcc0f880d45f91d26dc6a44c3a5b3c6b564c8b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 16:14:15 +0000 Subject: [PATCH 361/449] Bump io.vavr:vavr from 0.10.5 to 0.10.6 Bumps [io.vavr:vavr](https://github.com/vavr-io/vavr) from 0.10.5 to 0.10.6. - [Release notes](https://github.com/vavr-io/vavr/releases) - [Commits](https://github.com/vavr-io/vavr/compare/v0.10.5...v0.10.6) --- updated-dependencies: - dependency-name: io.vavr:vavr dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3d74718190..949b1fb1ab 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 3.17.0 1.18.0 2.12.1 - 0.10.5 + 0.10.6 1.2.5 1.4.2 1.0.4 From 6bc6ecd2c597d21d39b48e2c2ce6269743dd3cc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 16:37:51 +0000 Subject: [PATCH 362/449] Bump com.rabbitmq:amqp-client from 5.24.0 to 5.25.0 Bumps [com.rabbitmq:amqp-client](https://github.com/rabbitmq/rabbitmq-java-client) from 5.24.0 to 5.25.0. - [Release notes](https://github.com/rabbitmq/rabbitmq-java-client/releases) - [Commits](https://github.com/rabbitmq/rabbitmq-java-client/compare/v5.24.0...v5.25.0) --- updated-dependencies: - dependency-name: com.rabbitmq:amqp-client dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 949b1fb1ab..104ef3db42 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 5.11.4 3.27.3 5.15.2 - 5.24.0 + 5.25.0 3.17.0 1.18.0 2.12.1 From 924e5cd1b58048a59f68c2bb3d0a928d779f4748 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:16:03 +0000 Subject: [PATCH 363/449] Bump spotbugs.version from 4.9.0 to 4.9.1 Bumps `spotbugs.version` from 4.9.0 to 4.9.1. Updates `com.github.spotbugs:spotbugs-annotations` from 4.9.0 to 4.9.1 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.9.0...4.9.1) Updates `com.github.spotbugs:spotbugs` from 4.9.0 to 4.9.1 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.9.0...4.9.1) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-annotations dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.github.spotbugs:spotbugs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 104ef3db42..1d6b1228a6 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ 1.25.2 0.8.12 4.8.6.6 - 4.9.0 + 4.9.1 4.0 From 341662abe7d95c379f8f78ad5c4acf817b726787 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 16:16:05 +0000 Subject: [PATCH 364/449] Bump com.github.luben:zstd-jni from 1.5.6-9 to 1.5.6-10 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.6-9 to 1.5.6-10. - [Commits](https://github.com/luben/zstd-jni/commits) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 104ef3db42..836a8fd832 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 13.1.0 4.7.5 1.27.1 - 1.5.6-9 + 1.5.6-10 1.8.0 1.1.10.7 5.11.4 From e42aeff7ed229b76376a4b8222f2a33716a5afdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 11 Feb 2025 09:18:08 +0100 Subject: [PATCH 365/449] Squash some SpotBugs warnings --- .../com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java | 2 ++ src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java | 2 ++ .../com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java | 2 ++ .../com/rabbitmq/stream/codec/WrapperMessageBuilder.java | 2 ++ .../java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java | 5 +++++ 5 files changed, 13 insertions(+) diff --git a/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java index 8902dd1ec1..4d5502a1f5 100644 --- a/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java @@ -18,6 +18,7 @@ import com.rabbitmq.stream.Message; import com.rabbitmq.stream.MessageBuilder; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.math.BigDecimal; import java.util.Date; import java.util.LinkedHashMap; @@ -70,6 +71,7 @@ public Message build() { } @Override + @SuppressFBWarnings({"AT_NONATOMIC_64BIT_PRIMITIVE", "AT_STALE_THREAD_WRITE_OF_PRIMITIVE"}) public MessageBuilder publishingId(long publishingId) { this.publishingId = publishingId; this.hasPublishingId = true; diff --git a/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java b/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java index a429619585..d7ffeb2c65 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/SimpleCodec.java @@ -18,6 +18,7 @@ import com.rabbitmq.stream.Message; import com.rabbitmq.stream.MessageBuilder; import com.rabbitmq.stream.Properties; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; @@ -107,6 +108,7 @@ public Message build() { } @Override + @SuppressFBWarnings({"AT_NONATOMIC_64BIT_PRIMITIVE", "AT_STALE_THREAD_WRITE_OF_PRIMITIVE"}) public MessageBuilder publishingId(long publishingId) { this.publishingId = publishingId; this.hasPublishingId = true; diff --git a/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java index a6180c9655..3b873b47e6 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java @@ -21,6 +21,7 @@ import com.swiftmq.amqp.v100.generated.transport.definitions.SequenceNo; import com.swiftmq.amqp.v100.messaging.AMQPMessage; import com.swiftmq.amqp.v100.types.*; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.IOException; import java.math.BigDecimal; import java.util.LinkedHashMap; @@ -77,6 +78,7 @@ public Message build() { } @Override + @SuppressFBWarnings({"AT_NONATOMIC_64BIT_PRIMITIVE", "AT_STALE_THREAD_WRITE_OF_PRIMITIVE"}) public MessageBuilder publishingId(long publishingId) { this.publishingId = publishingId; this.hasPublishingId = true; diff --git a/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java index 195d37cb89..22cd523e67 100644 --- a/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java @@ -18,6 +18,7 @@ import com.rabbitmq.stream.MessageBuilder; import com.rabbitmq.stream.Properties; import com.rabbitmq.stream.amqp.*; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.math.BigDecimal; import java.util.Date; import java.util.LinkedHashMap; @@ -56,6 +57,7 @@ public Message build() { } @Override + @SuppressFBWarnings({"AT_NONATOMIC_64BIT_PRIMITIVE", "AT_STALE_THREAD_WRITE_OF_PRIMITIVE"}) public MessageBuilder publishingId(long publishingId) { this.publishingId = publishingId; this.hasPublishingId = true; diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java index eb3e0cae77..ec00136800 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamConsumerBuilder.java @@ -18,6 +18,7 @@ import static com.rabbitmq.stream.impl.Utils.SUBSCRIPTION_PROPERTY_MATCH_UNFILTERED; import com.rabbitmq.stream.*; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.time.Duration; @@ -112,6 +113,7 @@ public ConsumerBuilder subscriptionListener(SubscriptionListener subscriptionLis } @Override + @SuppressFBWarnings("AT_STALE_THREAD_WRITE_OF_PRIMITIVE") public ManualTrackingStrategy manualTrackingStrategy() { this.manualTrackingStrategy = new DefaultManualTrackingStrategy(this); this.autoTrackingStrategy = null; @@ -120,6 +122,7 @@ public ManualTrackingStrategy manualTrackingStrategy() { } @Override + @SuppressFBWarnings("AT_STALE_THREAD_WRITE_OF_PRIMITIVE") public AutoTrackingStrategy autoTrackingStrategy() { this.autoTrackingStrategy = new DefaultAutoTrackingStrategy(this); this.manualTrackingStrategy = null; @@ -128,6 +131,7 @@ public AutoTrackingStrategy autoTrackingStrategy() { } @Override + @SuppressFBWarnings("AT_STALE_THREAD_WRITE_OF_PRIMITIVE") public ConsumerBuilder noTrackingStrategy() { this.noTrackingStrategy = true; this.autoTrackingStrategy = null; @@ -140,6 +144,7 @@ public FlowConfiguration flow() { return this.flowConfiguration; } + @SuppressFBWarnings("AT_STALE_THREAD_WRITE_OF_PRIMITIVE") StreamConsumerBuilder lazyInit(boolean lazyInit) { this.lazyInit = lazyInit; return this; From 0d3304434ef5b7253b7b5af62857d40494e96f3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 17:02:18 +0000 Subject: [PATCH 366/449] Bump netty.version from 4.1.117.Final to 4.1.118.Final Bumps `netty.version` from 4.1.117.Final to 4.1.118.Final. Updates `io.netty:netty-transport` from 4.1.117.Final to 4.1.118.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.117.Final...netty-4.1.118.Final) Updates `io.netty:netty-codec` from 4.1.117.Final to 4.1.118.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.117.Final...netty-4.1.118.Final) Updates `io.netty:netty-handler` from 4.1.117.Final to 4.1.118.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.117.Final...netty-4.1.118.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.117.Final to 4.1.118.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.117.Final...netty-4.1.118.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9dbac24cda..1d58f4cebe 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.117.Final + 4.1.118.Final 0.34.1 4.2.30 1.14.3 From a4d9f89527ea3aab530c359bb4edc2e2a7a123a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 17:02:34 +0000 Subject: [PATCH 367/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.4.2 to 1.4.3. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.4.2...v1.4.3) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9dbac24cda..a0d5b6c26a 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.12.1 0.10.6 1.2.5 - 1.4.2 + 1.4.3 1.0.4 3.13.0 3.5.2 From 3b2eeb0aacd0e9fb08199ef21a2b7bef48d67ae7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 17:02:40 +0000 Subject: [PATCH 368/449] Bump io.micrometer:micrometer-core from 1.14.3 to 1.14.4 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.14.3 to 1.14.4. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.14.3...v1.14.4) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9dbac24cda..669f470bf7 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.117.Final 0.34.1 4.2.30 - 1.14.3 + 1.14.4 13.1.0 4.7.5 1.27.1 From 8fe871ea256d7438732a8ca37b87875a310d911e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 17 Feb 2025 09:24:44 +0100 Subject: [PATCH 369/449] Activate Khepri on CI --- ci/start-broker.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/start-broker.sh b/ci/start-broker.sh index c13c83ce3f..a45909c7bf 100755 --- a/ci/start-broker.sh +++ b/ci/start-broker.sh @@ -49,5 +49,6 @@ docker run -d --name rabbitmq \ wait_for_message rabbitmq "completed with" +docker exec rabbitmq rabbitmqctl enable_feature_flag --opt-in khepri_db docker exec rabbitmq rabbitmq-diagnostics erlang_version docker exec rabbitmq rabbitmqctl version From 92f103a904b176cdd667338bb2e580344f22b19f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 17 Feb 2025 10:44:15 +0100 Subject: [PATCH 370/449] Make sure close client connection executor services In case of disconnection during the initialization phase. We must make sure the closing sequence for executor services is called when the connection closes during the initialization phase. We also make sure the closing sequence is null-proof. --- .../java/com/rabbitmq/stream/impl/Client.java | 74 ++++++++++++------- 1 file changed, 48 insertions(+), 26 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 9e800163a1..8c4f53afec 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -155,8 +155,12 @@ public class Client implements AutoCloseable { final ConcurrentMap> outstandingRequests = new ConcurrentHashMap<>(); final List subscriptionOffsets = new CopyOnWriteArrayList<>(); + // dispatches broker frames, except for delivery frames final ExecutorService executorService; + private final Consumer closeExecutorService; + // dispatches delivery frames only final ExecutorService dispatchingExecutorService; + private final Consumer closeDispatchingExecutorService; final TuneState tuneState; final AtomicBoolean closing = new AtomicBoolean(false); final AtomicBoolean shuttingDownDispatching = new AtomicBoolean(false); @@ -174,7 +178,6 @@ public long applyAsLong(Object value) { } }; private final AtomicInteger correlationSequence = new AtomicInteger(0); - private final Runnable executorServiceClosing; private final SaslConfiguration saslConfiguration; private final CredentialsProvider credentialsProvider; private final Runnable nettyClosing; @@ -331,44 +334,58 @@ public void initChannel(SocketChannel ch) { this.channel = f.channel(); ExecutorServiceFactory executorServiceFactory = parameters.executorServiceFactory; if (executorServiceFactory == null) { + this.closeExecutorService = + Utils.makeIdempotent( + es -> { + if (es != null) { + es.shutdownNow(); + } + }); this.executorService = Executors.newSingleThreadExecutor(threadFactory(clientConnectionName + "-")); } else { + this.closeExecutorService = + Utils.makeIdempotent( + es -> { + if (es != null) { + executorServiceFactory.clientClosed(es); + } + }); this.executorService = executorServiceFactory.get(); } ExecutorServiceFactory dispatchingExecutorServiceFactory = parameters.dispatchingExecutorServiceFactory; if (dispatchingExecutorServiceFactory == null) { + this.closeDispatchingExecutorService = + Utils.makeIdempotent( + es -> { + if (es != null) { + List outstandingTasks = es.shutdownNow(); + this.shuttingDownDispatching.set(true); + for (Runnable outstandingTask : outstandingTasks) { + try { + outstandingTask.run(); + } catch (Exception e) { + LOGGER.info( + "Error while releasing buffer in outstanding connection tasks: {}", + e.getMessage()); + } + } + } + }); this.dispatchingExecutorService = Executors.newSingleThreadExecutor( threadFactory("dispatching-" + clientConnectionName + "-")); } else { + this.closeDispatchingExecutorService = + Utils.makeIdempotent( + es -> { + if (es != null) { + dispatchingExecutorServiceFactory.clientClosed(es); + } + }); this.dispatchingExecutorService = dispatchingExecutorServiceFactory.get(); } - this.executorServiceClosing = - Utils.makeIdempotent( - () -> { - if (dispatchingExecutorServiceFactory == null) { - List outstandingTasks = this.dispatchingExecutorService.shutdownNow(); - this.shuttingDownDispatching.set(true); - for (Runnable outstandingTask : outstandingTasks) { - try { - outstandingTask.run(); - } catch (Exception e) { - LOGGER.info( - "Error while releasing buffer in outstanding connection tasks: {}", - e.getMessage()); - } - } - } else { - dispatchingExecutorServiceFactory.clientClosed(this.dispatchingExecutorService); - } - if (executorServiceFactory == null) { - this.executorService.shutdownNow(); - } else { - executorServiceFactory.clientClosed(this.executorService); - } - }); try { this.tuneState = new TuneState( @@ -1451,7 +1468,12 @@ void closingSequence(ShutdownContext.ShutdownReason reason) { this.shutdownListenerCallback.accept(reason); } this.nettyClosing.run(); - this.executorServiceClosing.run(); + if (this.closeDispatchingExecutorService != null) { + this.closeDispatchingExecutorService.accept(this.dispatchingExecutorService); + } + if (this.closeExecutorService != null) { + this.closeExecutorService.accept(this.executorService); + } } private void closeNetty() { From 4c71124f1b9188293a0150da17124159de9eb921 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 16:17:54 +0000 Subject: [PATCH 371/449] Bump com.github.spotbugs:spotbugs-maven-plugin from 4.8.6.6 to 4.9.1.0 Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.8.6.6 to 4.9.1.0. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.8.6.6...spotbugs-maven-plugin-4.9.1.0) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 40b324b0f4..3a742286ca 100644 --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ 2.44.2 1.25.2 0.8.12 - 4.8.6.6 + 4.9.1.0 4.9.1 4.0 From 030fdcb03363acf538d26aa071481113c2c8463f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 17:15:27 +0000 Subject: [PATCH 372/449] Bump org.apache.maven.plugins:maven-clean-plugin from 3.4.0 to 3.4.1 Bumps [org.apache.maven.plugins:maven-clean-plugin](https://github.com/apache/maven-clean-plugin) from 3.4.0 to 3.4.1. - [Release notes](https://github.com/apache/maven-clean-plugin/releases) - [Commits](https://github.com/apache/maven-clean-plugin/compare/maven-clean-plugin-3.4.0...maven-clean-plugin-3.4.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-clean-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3a742286ca..9352b66f72 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 3.2.7 3.2.1 3.3.1 - 3.4.0 + 3.4.1 3.3.1 3.11.2 3.4.2 From 669c6d9ac63f749a9d0b8e7fa00433c851a18d9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 16:28:34 +0000 Subject: [PATCH 373/449] Bump com.github.luben:zstd-jni from 1.5.6-10 to 1.5.7-1 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.6-10 to 1.5.7-1. - [Commits](https://github.com/luben/zstd-jni/compare/v1.5.6-10...v1.5.7-1) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9352b66f72..4ef1d92dc3 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 13.1.0 4.7.5 1.27.1 - 1.5.6-10 + 1.5.7-1 1.8.0 1.1.10.7 5.11.4 From c62af4ef1ebfe195fd31b5e774c37e57fea8682c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 16:37:12 +0000 Subject: [PATCH 374/449] Bump com.diffplug.spotless:spotless-maven-plugin from 2.44.2 to 2.44.3 Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.44.2 to 2.44.3. - [Release notes](https://github.com/diffplug/spotless/releases) - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/maven/2.44.2...maven/2.44.3) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4ef1d92dc3..12bad16539 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 2.3.1 3.2.1 1.37 - 2.44.2 + 2.44.3 1.25.2 0.8.12 4.9.1.0 From e91194dc9f26e39bcf65f8414e0dc76bb656a244 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 16:37:17 +0000 Subject: [PATCH 375/449] Bump org.junit:junit-bom from 5.11.4 to 5.12.0 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.11.4 to 5.12.0. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.11.4...r5.12.0) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4ef1d92dc3..32bf72345f 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.5.7-1 1.8.0 1.1.10.7 - 5.11.4 + 5.12.0 3.27.3 5.15.2 5.25.0 From 09f6d9a0705ef2d88471e728eb98c0c32e9bbd57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 16:37:22 +0000 Subject: [PATCH 376/449] Bump org.apache.maven.plugins:maven-compiler-plugin Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.13.0 to 3.14.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.13.0...maven-compiler-plugin-3.14.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4ef1d92dc3..b2c239181c 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 1.2.5 1.4.3 1.0.4 - 3.13.0 + 3.14.0 3.5.2 3.8.1 1.11 From cf79647ad7a6f1500ddf238172829117fb28473f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Feb 2025 16:18:53 +0000 Subject: [PATCH 377/449] Bump netty.version from 4.1.118.Final to 4.1.119.Final Bumps `netty.version` from 4.1.118.Final to 4.1.119.Final. Updates `io.netty:netty-transport` from 4.1.118.Final to 4.1.119.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.118.Final...netty-4.1.119.Final) Updates `io.netty:netty-codec` from 4.1.118.Final to 4.1.119.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.118.Final...netty-4.1.119.Final) Updates `io.netty:netty-handler` from 4.1.118.Final to 4.1.119.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.118.Final...netty-4.1.119.Final) Updates `io.netty:netty-transport-native-epoll` from 4.1.118.Final to 4.1.119.Final - [Commits](https://github.com/netty/netty/compare/netty-4.1.118.Final...netty-4.1.119.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8998ec29c8..97b2c022aa 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.118.Final + 4.1.119.Final 0.34.1 4.2.30 1.14.4 From b646f703c2d3f029fa66cc520780eab92d21f87a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 16:58:25 +0000 Subject: [PATCH 378/449] Bump spotbugs.version from 4.9.1 to 4.9.2 Bumps `spotbugs.version` from 4.9.1 to 4.9.2. Updates `com.github.spotbugs:spotbugs-annotations` from 4.9.1 to 4.9.2 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.9.1...4.9.2) Updates `com.github.spotbugs:spotbugs` from 4.9.1 to 4.9.2 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.9.1...4.9.2) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-annotations dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.github.spotbugs:spotbugs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 97b2c022aa..df2d5c2d20 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ 1.25.2 0.8.12 4.9.1.0 - 4.9.1 + 4.9.2 4.0 From f2d48fc5f2022e1305c30632760524a2c36c9c1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Mar 2025 16:58:32 +0000 Subject: [PATCH 379/449] Bump org.mockito:mockito-core from 5.15.2 to 5.16.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.15.2 to 5.16.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.15.2...v5.16.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 97b2c022aa..9e2a1df2f9 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.1.10.7 5.12.0 3.27.3 - 5.15.2 + 5.16.0 5.25.0 3.17.0 1.18.0 From 3571d191a776714c16deeaf2e271b5b6a39013d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 4 Mar 2025 10:39:27 +0100 Subject: [PATCH 380/449] Squash Spotbugs warning --- src/main/java/com/rabbitmq/stream/impl/HashUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/HashUtils.java b/src/main/java/com/rabbitmq/stream/impl/HashUtils.java index f4f235aff4..fde6d946b2 100644 --- a/src/main/java/com/rabbitmq/stream/impl/HashUtils.java +++ b/src/main/java/com/rabbitmq/stream/impl/HashUtils.java @@ -18,6 +18,7 @@ import java.nio.charset.StandardCharsets; import java.util.function.ToIntFunction; +@SuppressFBWarnings({"SF_SWITCH_FALLTHROUGH", "SF_SWITCH_NO_DEFAULT"}) final class HashUtils { static final ToIntFunction MURMUR3 = new Murmur3(); @@ -72,7 +73,6 @@ private static int fmix32(int hash) { this.seed = seed; } - @SuppressFBWarnings({"SF_SWITCH_FALLTHROUGH", "SF_SWITCH_NO_DEFAULT"}) @Override public int applyAsInt(String value) { byte[] data = value.getBytes(StandardCharsets.UTF_8); From c620747969776c8e61108fd932e1b1138f494f50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 16:19:20 +0000 Subject: [PATCH 381/449] Bump com.github.spotbugs:spotbugs-maven-plugin from 4.9.1.0 to 4.9.2.0 Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.9.1.0 to 4.9.2.0. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.9.1.0...spotbugs-maven-plugin-4.9.2.0) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 973822872f..fcd6f7b55d 100644 --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ 2.44.3 1.25.2 0.8.12 - 4.9.1.0 + 4.9.2.0 4.9.2 4.0 From 57601f447d3f21873bb6e9b6ae04eba80e1a80cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 16:09:12 +0000 Subject: [PATCH 382/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.4.3 to 1.4.4. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.4.3...v1.4.4) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fcd6f7b55d..6ec22e9b52 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.12.1 0.10.6 1.2.5 - 1.4.3 + 1.4.4 1.0.4 3.14.0 3.5.2 From 88022818df179eab152aadf67d677fb594557304 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 16:09:24 +0000 Subject: [PATCH 383/449] Bump io.micrometer:micrometer-core from 1.14.4 to 1.14.5 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.14.4 to 1.14.5. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.14.4...v1.14.5) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fcd6f7b55d..b8a6e1fe73 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.1.119.Final 0.34.1 4.2.30 - 1.14.4 + 1.14.5 13.1.0 4.7.5 1.27.1 From 7f08b4925823d44d664cb4dd12e16e77df377498 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 16:31:25 +0000 Subject: [PATCH 384/449] Bump com.swiftmq:swiftmq-client from 13.1.0 to 13.1.1 Bumps [com.swiftmq:swiftmq-client](https://github.com/iitsoftware/swiftmq-client) from 13.1.0 to 13.1.1. - [Release notes](https://github.com/iitsoftware/swiftmq-client/releases) - [Commits](https://github.com/iitsoftware/swiftmq-client/compare/13.1.0...13.1.1) --- updated-dependencies: - dependency-name: com.swiftmq:swiftmq-client dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b8a6e1fe73..d7a1cabc5d 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ 0.34.1 4.2.30 1.14.5 - 13.1.0 + 13.1.1 4.7.5 1.27.1 1.5.7-1 From 695888022dd2aebad3d4e764c0c7ac3dddab116c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 12 Mar 2025 17:17:08 +0100 Subject: [PATCH 385/449] Test against RabbitMQ 4.1 alpha --- .github/workflows/test-rabbitmq-alphas.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index b707dc290a..0414fce497 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -13,7 +13,10 @@ jobs: runs-on: ubuntu-24.04 strategy: matrix: - rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v4.0.x', 'pivotalrabbitmq/rabbitmq:main' ] + rabbitmq-image: + - pivotalrabbitmq/rabbitmq:v4.0.x-otp27 + - pivotalrabbitmq/rabbitmq:v4.1.x-otp27 + - pivotalrabbitmq/rabbitmq:main-otp27 name: Test against ${{ matrix.rabbitmq-image }} steps: - uses: actions/checkout@v4 From 7146b0b65ec79e8e385edb2e972a85874c519e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Fri, 14 Mar 2025 11:45:09 +0100 Subject: [PATCH 386/449] Use number of available processors for stream count in test Instead of 10. This decreases load for low-resource environments, like CI (usually ~ 4 available processors). The VM has to run the test suite itself, but also the 3-node cluster. --- .../com/rabbitmq/stream/impl/ConsumersCoordinator.java | 2 +- .../com/rabbitmq/stream/impl/ProducersCoordinator.java | 7 +++++-- .../java/com/rabbitmq/stream/impl/StreamEnvironment.java | 2 +- src/main/java/com/rabbitmq/stream/impl/Utils.java | 2 ++ .../java/com/rabbitmq/stream/impl/RecoveryClusterTest.java | 7 ++++--- .../java/com/rabbitmq/stream/impl/StreamConsumerTest.java | 4 +--- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java index 3faddae938..05a9ae00c1 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ConsumersCoordinator.java @@ -75,7 +75,7 @@ final class ConsumersCoordinator implements AutoCloseable { private final List trackers = new CopyOnWriteArrayList<>(); private final ExecutorServiceFactory executorServiceFactory = new DefaultExecutorServiceFactory( - Runtime.getRuntime().availableProcessors(), 10, "rabbitmq-stream-consumer-connection-"); + AVAILABLE_PROCESSORS, 10, "rabbitmq-stream-consumer-connection-"); private final boolean forceReplica; private final Lock coordinatorLock = new ReentrantLock(); diff --git a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java index 67a874df9b..8ac1017f8a 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java +++ b/src/main/java/com/rabbitmq/stream/impl/ProducersCoordinator.java @@ -68,7 +68,7 @@ final class ProducersCoordinator implements AutoCloseable { private final List producerTrackers = new CopyOnWriteArrayList<>(); private final ExecutorServiceFactory executorServiceFactory = new DefaultExecutorServiceFactory( - Runtime.getRuntime().availableProcessors(), 10, "rabbitmq-stream-producer-connection-"); + AVAILABLE_PROCESSORS, 10, "rabbitmq-stream-producer-connection-"); private final Lock coordinatorLock = new ReentrantLock(); private final boolean forceLeader; @@ -750,7 +750,10 @@ private void assignProducersToNewManagers( List candidates = brokerAndCandidates.v2(); String key = keyForNode(broker); LOGGER.debug( - "Assigning {} producer(s) and consumer tracker(s) to {} (stream '{}')", trackers.size(), key, stream); + "Assigning {} producer(s) and consumer tracker(s) to {} (stream '{}')", + trackers.size(), + key, + stream); trackers.forEach(tracker -> maybeRecoverAgent(broker, candidates, tracker)); }) .exceptionally( diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index 1aa1083f78..2bf4b233f1 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -224,7 +224,7 @@ class StreamEnvironment implements Environment { } ScheduledExecutorService executorService; if (scheduledExecutorService == null) { - int threads = Runtime.getRuntime().availableProcessors(); + int threads = AVAILABLE_PROCESSORS; LOGGER.debug("Creating scheduled executor service with {} thread(s)", threads); ThreadFactory threadFactory = threadFactory("rabbitmq-stream-environment-scheduler-"); executorService = Executors.newScheduledThreadPool(threads, threadFactory); diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index d00728954f..b449763702 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -41,6 +41,8 @@ final class Utils { + static final int AVAILABLE_PROCESSORS = Runtime.getRuntime().availableProcessors(); + @SuppressWarnings("rawtypes") private static final Consumer NO_OP_CONSUMER = o -> {}; diff --git a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java index 9cc312b33a..24f50ee0cd 100644 --- a/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/RecoveryClusterTest.java @@ -28,6 +28,7 @@ import com.google.common.collect.Streams; import com.google.common.util.concurrent.RateLimiter; import com.rabbitmq.stream.*; +import com.rabbitmq.stream.impl.TestUtils.DisabledIfNotCluster; import com.rabbitmq.stream.impl.TestUtils.Sync; import com.rabbitmq.stream.impl.Tuples.Pair; import io.netty.channel.ChannelOption; @@ -52,7 +53,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -@TestUtils.DisabledIfNotCluster +@DisabledIfNotCluster @StreamTestInfrastructure public class RecoveryClusterTest { @@ -87,7 +88,7 @@ static void initAll() { @BeforeEach void init(TestInfo info) { - int availableProcessors = Runtime.getRuntime().availableProcessors(); + int availableProcessors = Utils.AVAILABLE_PROCESSORS; LOGGER.info("Available processors: {}", availableProcessors); ThreadFactory threadFactory = threadFactory("rabbitmq-stream-environment-scheduler-"); scheduledExecutorService = Executors.newScheduledThreadPool(availableProcessors, threadFactory); @@ -134,7 +135,7 @@ void clusterRestart(boolean useLoadBalancer, boolean forceLeader) throws Interru "Cluster restart test, use load balancer {}, force leader {}", useLoadBalancer, forceLeader); - int streamCount = 10; + int streamCount = Utils.AVAILABLE_PROCESSORS; int producerCount = streamCount * 2; int consumerCount = streamCount * 2; diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java index dcbb6f158a..6871823f61 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamConsumerTest.java @@ -17,7 +17,6 @@ import static com.rabbitmq.stream.ConsumerFlowStrategy.creditWhenHalfMessagesProcessed; import static com.rabbitmq.stream.impl.TestUtils.*; import static com.rabbitmq.stream.impl.TestUtils.CountDownLatchConditions.completed; -import static java.lang.Runtime.getRuntime; import static java.lang.String.format; import static java.util.Collections.synchronizedList; import static org.assertj.core.api.Assertions.*; @@ -243,8 +242,7 @@ void consumeWithAsyncConsumerFlowControl() throws Exception { void asynchronousProcessingWithFlowControl() { int messageCount = 100_000; publishAndWaitForConfirms(cf, messageCount, stream); - ExecutorService executorService = - Executors.newFixedThreadPool(getRuntime().availableProcessors()); + ExecutorService executorService = Executors.newFixedThreadPool(Utils.AVAILABLE_PROCESSORS); try { CountDownLatch latch = new CountDownLatch(messageCount); environment.consumerBuilder().stream(stream) From 30ba3027b2a6a17fd27f01bce0f2b9ba08a09a50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Mar 2025 16:44:06 +0000 Subject: [PATCH 387/449] Bump org.junit:junit-bom from 5.12.0 to 5.12.1 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.12.0 to 5.12.1. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.12.0...r5.12.1) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 89f68c5c5c..a2a9de63c5 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.5.7-1 1.8.0 1.1.10.7 - 5.12.0 + 5.12.1 3.27.3 5.16.0 5.25.0 From 5615b81869a4e2eb9f9f67c91124b883e3dced3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 16:21:15 +0000 Subject: [PATCH 388/449] Bump org.mockito:mockito-core from 5.16.0 to 5.16.1 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.16.0 to 5.16.1. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.16.0...v5.16.1) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a2a9de63c5..d30e47729c 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.1.10.7 5.12.1 3.27.3 - 5.16.0 + 5.16.1 5.25.0 3.17.0 1.18.0 From 22d024b9aa1709d21d68e6fca7eb86230cd31a57 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 16:21:23 +0000 Subject: [PATCH 389/449] Bump com.github.luben:zstd-jni from 1.5.7-1 to 1.5.7-2 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.7-1 to 1.5.7-2. - [Commits](https://github.com/luben/zstd-jni/compare/v1.5.7-1...v1.5.7-2) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a2a9de63c5..a23ced6113 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 13.1.1 4.7.5 1.27.1 - 1.5.7-1 + 1.5.7-2 1.8.0 1.1.10.7 5.12.1 From f51bcd03e547ac1082072ac4029d8200c22e6c3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 16:21:33 +0000 Subject: [PATCH 390/449] Bump com.github.spotbugs:spotbugs-maven-plugin from 4.9.2.0 to 4.9.3.0 Bumps [com.github.spotbugs:spotbugs-maven-plugin](https://github.com/spotbugs/spotbugs-maven-plugin) from 4.9.2.0 to 4.9.3.0. - [Release notes](https://github.com/spotbugs/spotbugs-maven-plugin/releases) - [Commits](https://github.com/spotbugs/spotbugs-maven-plugin/compare/spotbugs-maven-plugin-4.9.2.0...spotbugs-maven-plugin-4.9.3.0) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a2a9de63c5..7718e85421 100644 --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ 2.44.3 1.25.2 0.8.12 - 4.9.2.0 + 4.9.3.0 4.9.2 4.0 From a9403df2cdfffa0f0d059085a0bc2e99a40f100b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 17:41:59 +0000 Subject: [PATCH 391/449] Bump spotbugs.version from 4.9.2 to 4.9.3 Bumps `spotbugs.version` from 4.9.2 to 4.9.3. Updates `com.github.spotbugs:spotbugs-annotations` from 4.9.2 to 4.9.3 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.9.2...4.9.3) Updates `com.github.spotbugs:spotbugs` from 4.9.2 to 4.9.3 - [Release notes](https://github.com/spotbugs/spotbugs/releases) - [Changelog](https://github.com/spotbugs/spotbugs/blob/master/CHANGELOG.md) - [Commits](https://github.com/spotbugs/spotbugs/compare/4.9.2...4.9.3) --- updated-dependencies: - dependency-name: com.github.spotbugs:spotbugs-annotations dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.github.spotbugs:spotbugs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ef1880cb21..6a89fd5581 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ 1.25.2 0.8.12 4.9.3.0 - 4.9.2 + 4.9.3 4.0 From e3d3ce74175c84a1a6ed249c129e602efa8ce9c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Fri, 21 Mar 2025 09:16:19 +0100 Subject: [PATCH 392/449] Log message offset in case of decoding error --- .../com/rabbitmq/stream/impl/ServerFrameHandler.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java index 93050de1b6..d63da3ab30 100644 --- a/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java +++ b/src/main/java/com/rabbitmq/stream/impl/ServerFrameHandler.java @@ -332,9 +332,14 @@ static int handleMessage( if (ignore && Long.compareUnsigned(offset, offsetLimit) < 0) { messageIgnored.set(true); } else { - Message message = codec.decode(data); - messageListener.handle( - subscriptionId, offset, chunkTimestamp, committedChunkId, chunkContext, message); + try { + Message message = codec.decode(data); + messageListener.handle( + subscriptionId, offset, chunkTimestamp, committedChunkId, chunkContext, message); + } catch (RuntimeException e) { + LOGGER.warn("Error while decoding message at offset {}", offset, e); + throw e; + } } return read; } From 8964d09b23619d69c949cfbc03843307e7021b40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Fri, 21 Mar 2025 09:06:05 +0100 Subject: [PATCH 393/449] Support map, list, and array types when decoding message annotations Fixes #728 --- .../com/rabbitmq/stream/MessageBuilder.java | 8 + .../stream/codec/QpidProtonCodec.java | 29 ++-- .../codec/QpidProtonMessageBuilder.java | 23 ++- .../rabbitmq/stream/codec/SwiftMqCodec.java | 150 +++++++++++++++++- .../stream/codec/SwiftMqMessageBuilder.java | 82 +++++++++- .../stream/codec/WrapperMessageBuilder.java | 23 ++- .../com/rabbitmq/stream/codec/CodecsTest.java | 87 +++++++++- 7 files changed, 366 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/MessageBuilder.java b/src/main/java/com/rabbitmq/stream/MessageBuilder.java index e91414d90a..02a9d3c3ee 100644 --- a/src/main/java/com/rabbitmq/stream/MessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/MessageBuilder.java @@ -15,6 +15,8 @@ package com.rabbitmq.stream; import java.math.BigDecimal; +import java.util.List; +import java.util.Map; import java.util.UUID; /** @@ -186,6 +188,12 @@ interface MessageAnnotationsBuilder { MessageAnnotationsBuilder entrySymbol(String key, String value); + MessageAnnotationsBuilder entry(String key, List list); + + MessageAnnotationsBuilder entry(String key, Map map); + + MessageAnnotationsBuilder entryArray(String key, Object[] array); + /** * Go back to the message builder * diff --git a/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java b/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java index 8790128302..9d9465c496 100644 --- a/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java @@ -19,10 +19,7 @@ import com.rabbitmq.stream.MessageBuilder; import com.rabbitmq.stream.Properties; import java.nio.ByteBuffer; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.function.Function; import org.apache.qpid.proton.amqp.*; import org.apache.qpid.proton.amqp.messaging.*; @@ -63,7 +60,7 @@ private static Map createMapFromAmqpMap( if (amqpMap != null) { result = new LinkedHashMap<>(amqpMap.size()); for (Map.Entry entry : amqpMap.entrySet()) { - result.put(keyMaker.apply(entry.getKey()), convertApplicationProperty(entry.getValue())); + result.put(keyMaker.apply(entry.getKey()), fromQpidToJava(entry.getValue())); } } else { result = null; @@ -71,7 +68,7 @@ private static Map createMapFromAmqpMap( return result; } - private static Object convertApplicationProperty(Object value) { + private static Object fromQpidToJava(Object value) { if (value instanceof Boolean || value instanceof Byte || value instanceof Short @@ -81,7 +78,10 @@ private static Object convertApplicationProperty(Object value) { || value instanceof Double || value instanceof String || value instanceof Character - || value instanceof UUID) { + || value instanceof UUID + || value instanceof List + || value instanceof Map + || value instanceof Object[]) { return value; } else if (value instanceof Binary) { return ((Binary) value).getArray(); @@ -99,9 +99,10 @@ private static Object convertApplicationProperty(Object value) { return ((Symbol) value).toString(); } else if (value == null) { return null; + } else if (value.getClass().isArray()) { + return value; } else { - throw new IllegalArgumentException( - "Type not supported for an application property: " + value.getClass()); + throw new IllegalArgumentException("Type not supported: " + value.getClass()); } } @@ -281,7 +282,10 @@ protected Object convertToQpidType(Object value) { || value instanceof String || value instanceof Character || value instanceof UUID - || value instanceof Date) { + || value instanceof Date + || value instanceof List + || value instanceof Map + || value instanceof Object[]) { return value; } else if (value instanceof com.rabbitmq.stream.amqp.UnsignedByte) { return UnsignedByte.valueOf(((com.rabbitmq.stream.amqp.UnsignedByte) value).byteValue()); @@ -298,8 +302,7 @@ protected Object convertToQpidType(Object value) { } else if (value == null) { return null; } else { - throw new IllegalArgumentException( - "Type not supported for an application property: " + value.getClass()); + throw new IllegalArgumentException("Type not supported: " + value.getClass()); } } @@ -634,7 +637,7 @@ public Message copy() { // from // https://github.com/apache/activemq/blob/master/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/AmqpWritableBuffer.java - private static class ByteArrayWritableBuffer implements WritableBuffer { + protected static class ByteArrayWritableBuffer implements WritableBuffer { public static final int DEFAULT_CAPACITY = 4 * 1024; diff --git a/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java index 4d5502a1f5..1d1851bb52 100644 --- a/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/QpidProtonMessageBuilder.java @@ -20,10 +20,7 @@ import com.rabbitmq.stream.MessageBuilder; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.math.BigDecimal; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.qpid.proton.amqp.Binary; import org.apache.qpid.proton.amqp.Symbol; @@ -365,6 +362,24 @@ public MessageAnnotationsBuilder entrySymbol(String key, String value) { return this; } + @Override + public MessageAnnotationsBuilder entry(String key, List list) { + messageAnnotations.put(Symbol.getSymbol(key), list); + return this; + } + + @Override + public MessageAnnotationsBuilder entry(String key, Map map) { + messageAnnotations.put(Symbol.getSymbol(key), map); + return this; + } + + @Override + public MessageAnnotationsBuilder entryArray(String key, Object[] array) { + messageAnnotations.put(Symbol.getSymbol(key), array); + return this; + } + @Override public MessageBuilder messageBuilder() { return messageBuilder; diff --git a/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java b/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java index 0feb5d6837..76f15bd806 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/SwiftMqCodec.java @@ -25,10 +25,9 @@ import com.swiftmq.amqp.v100.types.*; import com.swiftmq.tools.util.DataByteArrayOutputStream; import java.io.IOException; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.UUID; +import java.lang.reflect.Array; +import java.nio.charset.StandardCharsets; +import java.util.*; public class SwiftMqCodec implements Codec { @@ -69,13 +68,48 @@ private static Object convertAmqpMapValue(AMQPType value) { return ((AMQPUuid) value).getValue(); } else if (value instanceof AMQPSymbol) { return ((AMQPSymbol) value).getValue(); + } else if (value instanceof AMQPList) { + try { + List source = ((AMQPList) value).getValue(); + List target = new ArrayList<>(source.size()); + for (AMQPType o : source) { + target.add(convertAmqpMapValue(o)); + } + return target; + } catch (IOException e) { + throw new StreamException("Error while reading SwiftMQ list", e); + } + } else if (value instanceof AMQPMap) { + try { + Map source = ((AMQPMap) value).getValue(); + Map target = new LinkedHashMap<>(source.size()); + for (Map.Entry entry : source.entrySet()) { + target.put(convertAmqpMapValue(entry.getKey()), convertAmqpMapValue(entry.getValue())); + } + return target; + } catch (IOException e) { + throw new StreamException("Error while reading SwiftMQ map", e); + } + } else if (value instanceof AMQPArray) { + try { + AMQPType[] source = ((AMQPArray) value).getValue(); + Object target = + Array.newInstance( + source.length == 0 ? Object.class : convertAmqpMapValue(source[0]).getClass(), + source.length); + for (int i = 0; i < source.length; i++) { + Array.set(target, i, convertAmqpMapValue(source[i])); + } + return target; + } catch (IOException e) { + throw new StreamException("Error while reading SwiftMQ array", e); + } } else if (value instanceof AMQPNull) { return null; } else if (value == null) { return null; } else { - throw new IllegalArgumentException( - "Type not supported for an application property: " + value.getClass()); + throw new IllegalArgumentException("Type not supported: " + value.getClass()); } } @@ -320,11 +354,111 @@ protected static AMQPType convertToSwiftMqType(Object value) { return new AMQPSymbol(value.toString()); } else if (value instanceof UUID) { return new AMQPUuid((UUID) value); + } else if (value instanceof List) { + List source = (List) value; + List target = new ArrayList<>(source.size()); + for (Object o : source) { + target.add(convertToSwiftMqType(o)); + } + try { + return new AMQPList(target); + } catch (IOException e) { + throw new StreamException("Error while creating SwiftMQ list", e); + } + } else if (value instanceof Map) { + Map source = (Map) value; + Map target = new LinkedHashMap<>(source.size()); + for (Map.Entry entry : source.entrySet()) { + target.put(convertToSwiftMqType(entry.getKey()), convertToSwiftMqType(entry.getValue())); + } + try { + return new AMQPMap(target); + } catch (IOException e) { + throw new StreamException("Error while creating SwiftMQ map", e); + } + } else if (value instanceof Object[]) { + Object[] source = (Object[]) value; + AMQPType[] target = new AMQPType[source.length]; + for (int i = 0; i < source.length; i++) { + target[i] = convertToSwiftMqType(source[i]); + } + try { + int code = source.length == 0 ? AMQPTypeDecoder.UNKNOWN : toSwiftMqTypeCode(source[0]); + return new AMQPArray(code, target); + } catch (IOException e) { + throw new StreamException("Error while creating SwiftMQ list", e); + } } else if (value == null) { return AMQPNull.NULL; } else { - throw new IllegalArgumentException( - "Type not supported for an application property: " + value.getClass()); + throw new IllegalArgumentException("Type not supported: " + value.getClass()); + } + } + + protected static int toSwiftMqTypeCode(Object value) { + if (value instanceof Boolean) { + return AMQPTypeDecoder.BOOLEAN; + } else if (value instanceof Byte) { + return AMQPTypeDecoder.BYTE; + } else if (value instanceof Short) { + return AMQPTypeDecoder.SHORT; + } else if (value instanceof Integer) { + int v = (Integer) value; + return (v < -128 || v > 127) ? AMQPTypeDecoder.INT : AMQPTypeDecoder.SINT; + } else if (value instanceof Long) { + long v = (Long) value; + return (v < -128 || v > 127) ? AMQPTypeDecoder.LONG : AMQPTypeDecoder.SLONG; + } else if (value instanceof UnsignedByte) { + return AMQPTypeDecoder.UBYTE; + } else if (value instanceof UnsignedShort) { + return AMQPTypeDecoder.USHORT; + } else if (value instanceof UnsignedInteger) { + return AMQPTypeDecoder.UINT; + } else if (value instanceof UnsignedLong) { + return AMQPTypeDecoder.ULONG; + } else if (value instanceof Float) { + return AMQPTypeDecoder.FLOAT; + } else if (value instanceof Double) { + return AMQPTypeDecoder.DOUBLE; + } else if (value instanceof byte[]) { + return ((byte[]) value).length > 255 ? AMQPTypeDecoder.BIN32 : AMQPTypeDecoder.BIN8; + } else if (value instanceof String) { + return value.toString().getBytes(StandardCharsets.UTF_8).length > 255 + ? AMQPTypeDecoder.STR32UTF8 + : AMQPTypeDecoder.STR8UTF8; + } else if (value instanceof Character) { + return AMQPTypeDecoder.CHAR; + } else if (value instanceof Date) { + return AMQPTypeDecoder.TIMESTAMP; + } else if (value instanceof Symbol) { + return value.toString().getBytes(StandardCharsets.US_ASCII).length > 255 + ? AMQPTypeDecoder.SYM32 + : AMQPTypeDecoder.SYM8; + } else if (value instanceof UUID) { + return AMQPTypeDecoder.UUID; + } else if (value instanceof List) { + List l = (List) value; + if (l.isEmpty()) { + return AMQPTypeDecoder.LIST0; + } else if (l.size() > 255) { + return AMQPTypeDecoder.LIST32; + } else { + return AMQPTypeDecoder.LIST8; + } + } else if (value instanceof Map) { + Map source = (Map) value; + return source.size() * 2 > 255 ? AMQPTypeDecoder.MAP32 : AMQPTypeDecoder.MAP8; + } else if (value instanceof Object[]) { + Object[] source = (Object[]) value; + if (source.length > 255) { + return AMQPTypeDecoder.ARRAY32; + } else { + return AMQPTypeDecoder.ARRAY8; + } + } else if (value == null) { + return AMQPTypeDecoder.NULL; + } else { + throw new IllegalArgumentException("Type not supported: " + value.getClass()); } } diff --git a/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java index 3b873b47e6..9e4e8ea8ee 100644 --- a/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/SwiftMqMessageBuilder.java @@ -14,6 +14,9 @@ // info@rabbitmq.com. package com.rabbitmq.stream.codec; +import static com.rabbitmq.stream.codec.SwiftMqCodec.convertToSwiftMqType; +import static com.rabbitmq.stream.codec.SwiftMqCodec.toSwiftMqTypeCode; + import com.rabbitmq.stream.Message; import com.rabbitmq.stream.MessageBuilder; import com.rabbitmq.stream.StreamException; @@ -23,10 +26,9 @@ import com.swiftmq.amqp.v100.types.*; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.IOException; +import java.lang.reflect.Array; import java.math.BigDecimal; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Function; @@ -321,6 +323,62 @@ protected void addEntry(String key, String value) { protected void addEntrySymbol(String key, String value) { map.put(keyMaker.apply(key), value == null ? AMQPNull.NULL : new AMQPSymbol(value)); } + + protected void addEntry(String key, List list) { + AMQPType amqpValue; + if (list == null) { + amqpValue = AMQPNull.NULL; + } else { + List l = new ArrayList<>(list.size()); + for (Object o : list) { + l.add(convertToSwiftMqType(o)); + } + try { + amqpValue = new AMQPList(l); + } catch (IOException e) { + throw new StreamException("Error while creating SwiftMq list", e); + } + } + map.put(keyMaker.apply(key), amqpValue); + } + + protected void addEntry(String key, Map mapEntry) { + AMQPType amqpValue; + if (mapEntry == null) { + amqpValue = AMQPNull.NULL; + } else { + Map m = new LinkedHashMap<>(mapEntry.size()); + mapEntry.forEach( + (k, v) -> { + m.put(convertToSwiftMqType(k), convertToSwiftMqType(v)); + }); + try { + amqpValue = new AMQPMap(m); + } catch (IOException e) { + throw new StreamException("Error while creating SwiftMQ map", e); + } + } + map.put(keyMaker.apply(key), amqpValue); + } + + protected void addEntry(String key, Object[] array) { + AMQPType amqpValue; + if (array == null) { + amqpValue = AMQPNull.NULL; + } else { + AMQPType[] a = new AMQPType[array.length]; + for (int i = 0; i < array.length; i++) { + a[i] = convertToSwiftMqType(Array.get(array, i)); + } + try { + int code = a.length == 0 ? AMQPTypeDecoder.UNKNOWN : toSwiftMqTypeCode(array[0]); + amqpValue = new AMQPArray(code, a); + } catch (IOException e) { + throw new StreamException("Error while creating SwiftMq list", e); + } + } + map.put(keyMaker.apply(key), amqpValue); + } } private static class SwiftMqApplicationPropertiesBuilder extends AmqpMapBuilderSupport @@ -587,6 +645,24 @@ public MessageAnnotationsBuilder entrySymbol(String key, String value) { return this; } + @Override + public MessageAnnotationsBuilder entry(String key, List list) { + addEntry(key, list); + return this; + } + + @Override + public MessageAnnotationsBuilder entry(String key, Map map) { + addEntry(key, map); + return this; + } + + @Override + public MessageAnnotationsBuilder entryArray(String key, Object[] array) { + addEntry(key, array); + return this; + } + @Override public MessageBuilder messageBuilder() { return messageBuilder; diff --git a/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java b/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java index 22cd523e67..e1c1afc850 100644 --- a/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java +++ b/src/main/java/com/rabbitmq/stream/codec/WrapperMessageBuilder.java @@ -20,10 +20,7 @@ import com.rabbitmq.stream.amqp.*; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.math.BigDecimal; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; public class WrapperMessageBuilder implements MessageBuilder { @@ -220,6 +217,24 @@ public MessageAnnotationsBuilder entrySymbol(String key, String value) { return this; } + @Override + public MessageAnnotationsBuilder entry(String key, List list) { + messageAnnotations.put(key, list); + return this; + } + + @Override + public MessageAnnotationsBuilder entry(String key, Map map) { + messageAnnotations.put(key, map); + return this; + } + + @Override + public MessageAnnotationsBuilder entryArray(String key, Object[] array) { + messageAnnotations.put(key, array); + return this; + } + @Override public MessageBuilder messageBuilder() { return this.messageBuilder; diff --git a/src/test/java/com/rabbitmq/stream/codec/CodecsTest.java b/src/test/java/com/rabbitmq/stream/codec/CodecsTest.java index 064e013617..b80acf1b2f 100644 --- a/src/test/java/com/rabbitmq/stream/codec/CodecsTest.java +++ b/src/test/java/com/rabbitmq/stream/codec/CodecsTest.java @@ -33,18 +33,18 @@ import java.math.BigInteger; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.UUID; +import java.util.*; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; import java.util.function.UnaryOperator; import java.util.stream.Stream; +import org.apache.qpid.proton.amqp.Symbol; import org.apache.qpid.proton.amqp.messaging.AmqpValue; +import org.apache.qpid.proton.amqp.messaging.MessageAnnotations; import org.assertj.core.api.InstanceOfAssertFactories; import org.assertj.core.api.ThrowableAssert; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -248,6 +248,22 @@ void codecs(CodecCouple codecCouple) { .entry("annotations.string", string) .entrySymbol("annotations.symbol", symbol) .entry("annotations.null", (String) null) + .entry( + "list", + List.of("1", "2", 3, List.of("1"), Map.of("k1", "v1"), new String[] {"1"})) + .entry( + "map", + Map.of( + "k1", + "v1", + "k2", + List.of("v2"), + "k3", + Map.of("k1", "v1"), + "k4", + new String[] {"1"})) + .entryArray("arrayString", new String[] {"1", "2", "3"}) + .entryArray("arrayInt", new Integer[] {200, 201, 202}) .messageBuilder() .build(); outboundMessage.annotate("extra.annotation", "extra annotation value"); @@ -474,6 +490,35 @@ void codecs(CodecCouple codecCouple) { .isNotNull() .isInstanceOf(String.class) .isEqualTo("extra annotation value"); + + List list = (List) inboundMessage.getMessageAnnotations().get("list"); + assertThat(list.get(0)).isEqualTo("1"); + assertThat(list.get(1)).isEqualTo("2"); + assertThat(list.get(2)).isEqualTo(3); + assertThat(list.get(3)).isEqualTo(List.of("1")); + assertThat(list.get(4)).isEqualTo(Map.of("k1", "v1")); + assertThat(list.get(5)).isEqualTo(new String[] {"1"}); + + Map map = (Map) inboundMessage.getMessageAnnotations().get("map"); + assertThat(map.get("k1")).isEqualTo("v1"); + assertThat(map.get("k2")).isEqualTo(List.of("v2")); + assertThat(map.get("k3")).isEqualTo(Map.of("k1", "v1")); + assertThat(map.get("k4")).isEqualTo(new String[] {"1"}); + + Object[] arrayString = + (Object[]) inboundMessage.getMessageAnnotations().get("arrayString"); + assertThat(arrayString).containsExactly("1", "2", "3"); + int[] arrayInt; + // QPid codec returns int[] and SwiftMQ codec returns Integer[] + if (inboundMessage.getMessageAnnotations().get("arrayInt") instanceof Integer[]) { + arrayInt = + Arrays.stream((Integer[]) inboundMessage.getMessageAnnotations().get("arrayInt")) + .mapToInt(Integer::intValue) + .toArray(); + } else { + arrayInt = (int[]) inboundMessage.getMessageAnnotations().get("arrayInt"); + } + assertThat(arrayInt).containsExactly(200, 201, 202); }); } @@ -624,6 +669,40 @@ void copy(CodecCouple codecCouple) { .containsEntry("copy", "copy value"); } + @Test + void qpidDoesNotSupportPrimitiveArrayEncodingInMap() { + org.apache.qpid.proton.message.Message message = + org.apache.qpid.proton.message.Message.Factory.create(); + Map map = new LinkedHashMap<>(); + map.put(Symbol.valueOf("foo"), new int[] {1, 2, 3}); + message.setMessageAnnotations(new MessageAnnotations(map)); + assertThatThrownBy(() -> qpidEncodeDecode(message)).isInstanceOf(ClassCastException.class); + } + + @Test + void qpidEncodeIntegerArrayDecodeIntArrayInMap() { + org.apache.qpid.proton.message.Message message = + org.apache.qpid.proton.message.Message.Factory.create(); + Map map = new LinkedHashMap<>(); + map.put(Symbol.valueOf("foo"), new Integer[] {1, 2, 3}); + message.setMessageAnnotations(new MessageAnnotations(map)); + message = qpidEncodeDecode(message); + map = message.getMessageAnnotations().getValue(); + assertThat(map.get(Symbol.valueOf("foo"))).isInstanceOf(int[].class); + } + + private static org.apache.qpid.proton.message.Message qpidEncodeDecode( + org.apache.qpid.proton.message.Message in) { + QpidProtonCodec.ByteArrayWritableBuffer writableBuffer = + new QpidProtonCodec.ByteArrayWritableBuffer(8192); + in.encode(writableBuffer); + + org.apache.qpid.proton.message.Message out = + org.apache.qpid.proton.message.Message.Factory.create(); + out.decode(writableBuffer.getArray(), 0, writableBuffer.getArrayLength()); + return out; + } + MessageTestConfiguration test( Function messageOperation, Consumer messageExpectation) { From 29534970a670d0c2262b6d20d7f3fac60430d379 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Fri, 21 Mar 2025 09:23:38 +0100 Subject: [PATCH 394/449] Squash SpotBugs warning --- .../rabbitmq/stream/codec/QpidProtonCodec.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java b/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java index 9d9465c496..72f865894c 100644 --- a/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java @@ -18,6 +18,7 @@ import com.rabbitmq.stream.Message; import com.rabbitmq.stream.MessageBuilder; import com.rabbitmq.stream.Properties; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.nio.ByteBuffer; import java.util.*; import java.util.function.Function; @@ -637,28 +638,29 @@ public Message copy() { // from // https://github.com/apache/activemq/blob/master/activemq-amqp/src/main/java/org/apache/activemq/transport/amqp/message/AmqpWritableBuffer.java - protected static class ByteArrayWritableBuffer implements WritableBuffer { + static class ByteArrayWritableBuffer implements WritableBuffer { - public static final int DEFAULT_CAPACITY = 4 * 1024; + static final int DEFAULT_CAPACITY = 4 * 1024; - byte[] buffer; - int position; + private byte[] buffer; + private int position; /** Creates a new WritableBuffer with default capacity. */ - public ByteArrayWritableBuffer() { + ByteArrayWritableBuffer() { this(DEFAULT_CAPACITY); } /** Create a new WritableBuffer with the given capacity. */ - public ByteArrayWritableBuffer(int capacity) { + ByteArrayWritableBuffer(int capacity) { this.buffer = new byte[capacity]; } - public byte[] getArray() { + @SuppressFBWarnings("EI_EXPOSE_REP") + byte[] getArray() { return buffer; } - public int getArrayLength() { + int getArrayLength() { return position; } From 85d93ab3255cf8b7499928f91e54bf4be83a0b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Fri, 21 Mar 2025 11:04:12 +0100 Subject: [PATCH 395/449] Squash SpotBugs warning --- src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java b/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java index 72f865894c..abadc2f618 100644 --- a/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java +++ b/src/main/java/com/rabbitmq/stream/codec/QpidProtonCodec.java @@ -18,7 +18,6 @@ import com.rabbitmq.stream.Message; import com.rabbitmq.stream.MessageBuilder; import com.rabbitmq.stream.Properties; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.nio.ByteBuffer; import java.util.*; import java.util.function.Function; @@ -655,7 +654,6 @@ static class ByteArrayWritableBuffer implements WritableBuffer { this.buffer = new byte[capacity]; } - @SuppressFBWarnings("EI_EXPOSE_REP") byte[] getArray() { return buffer; } From daccbd9269832ef67df48f5598b263d71a6448f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Mar 2025 10:18:50 +0000 Subject: [PATCH 396/449] Bump org.asciidoctor:asciidoctor-maven-plugin from 3.1.1 to 3.2.0 Bumps [org.asciidoctor:asciidoctor-maven-plugin](https://github.com/asciidoctor/asciidoctor-maven-plugin) from 3.1.1 to 3.2.0. - [Release notes](https://github.com/asciidoctor/asciidoctor-maven-plugin/releases) - [Changelog](https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/main/CHANGELOG.adoc) - [Commits](https://github.com/asciidoctor/asciidoctor-maven-plugin/compare/asciidoctor-maven-tools-3.1.1...asciidoctor-maven-tools-3.2.0) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctor-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6a89fd5581..03b214716e 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,7 @@ 3.11.2 3.4.2 3.4.0 - 3.1.1 + 3.2.0 3.0.0 2.3.1 3.2.1 From dd6e1891100c57b644d64068211d3c5f5b56c6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Mon, 24 Mar 2025 11:23:21 +0100 Subject: [PATCH 397/449] Set release version to 0.23.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index 6be9f95466..6431414974 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,5 +1,5 @@ -RELEASE_VERSION="0.22.0" -DEVELOPMENT_VERSION="0.23.0-SNAPSHOT" +RELEASE_VERSION="0.24.0" +DEVELOPMENT_VERSION="0.24.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 247303232aa9b0997864b1ca4a8410bb5852ed09 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 24 Mar 2025 10:27:24 +0000 Subject: [PATCH 398/449] [maven-release-plugin] prepare release v0.24.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 03b214716e..c10b334b7e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.23.0-SNAPSHOT + 0.24.0 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.24.0 From 741cf69bc246c141e736738530cd36a18a194077 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 24 Mar 2025 10:27:25 +0000 Subject: [PATCH 399/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c10b334b7e..dd420d8f72 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.24.0 + 0.24.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.24.0 + HEAD From 307948539c9986f5c5fa0db13d08f6eab6e642f7 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 24 Mar 2025 10:40:19 +0000 Subject: [PATCH 400/449] [maven-release-plugin] prepare release v0.24.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index dd420d8f72..c10b334b7e 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.24.0-SNAPSHOT + 0.24.0 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.24.0 From dd729ae77ea8053ddbc7ff298554e72e2e34d2df Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 24 Mar 2025 10:40:20 +0000 Subject: [PATCH 401/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c10b334b7e..dd420d8f72 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.24.0 + 0.24.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.24.0 + HEAD From 5b93fed3e7e4d520959bb71fe2ff76d78625d6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Mon, 24 Mar 2025 11:45:26 +0100 Subject: [PATCH 402/449] Set release version to 0.23.0 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index 6431414974..1fe2dedcdb 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,4 +1,4 @@ -RELEASE_VERSION="0.24.0" +RELEASE_VERSION="0.23.0" DEVELOPMENT_VERSION="0.24.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From ceade94c518b10162b1e09ce38f25cf4875445e6 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 24 Mar 2025 10:47:31 +0000 Subject: [PATCH 403/449] [maven-release-plugin] prepare release v0.23.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index dd420d8f72..738e763095 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.24.0-SNAPSHOT + 0.23.0 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.23.0 From b885b89533ef402734054e6a6a3a1f5f0124bc85 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 24 Mar 2025 10:47:33 +0000 Subject: [PATCH 404/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 738e763095..dd420d8f72 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.23.0 + 0.24.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.23.0 + HEAD From d61e6ea243c5917a02eccac788b24f7e17b77b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Thu, 27 Mar 2025 17:12:21 +0100 Subject: [PATCH 405/449] Remove random and least-leaders leader locator strategy Deprecated for several releases. --- .../com/rabbitmq/stream/StreamCreator.java | 18 +----------------- .../stream/impl/StreamStreamCreator.java | 2 +- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/StreamCreator.java b/src/main/java/com/rabbitmq/stream/StreamCreator.java index c37c04fc2d..659a53e728 100644 --- a/src/main/java/com/rabbitmq/stream/StreamCreator.java +++ b/src/main/java/com/rabbitmq/stream/StreamCreator.java @@ -146,23 +146,7 @@ enum LeaderLocator { * *

Default value for RabbitMQ 3.10+. */ - BALANCED("balanced"), - - /** - * The stream leader will be a random node of the cluster. - * - *

Deprecated as of RabbitMQ 3.10, same as {@link LeaderLocator#BALANCED}. - */ - RANDOM("random"), - - /** - * The stream leader will be on the node with the least number of stream leaders. - * - *

Deprecated as of RabbitMQ 3.10, same as {@link LeaderLocator#BALANCED}. - * - *

Default value for RabbitMQ 3.9. - */ - LEAST_LEADERS("least-leaders"); + BALANCED("balanced"); String value; diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java b/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java index 86e3693ad7..c3d216046e 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamStreamCreator.java @@ -32,7 +32,7 @@ class StreamStreamCreator implements StreamCreator { private final StreamEnvironment environment; private final Client.StreamParametersBuilder streamParametersBuilder = - new Client.StreamParametersBuilder().leaderLocator(LeaderLocator.LEAST_LEADERS); + new Client.StreamParametersBuilder().leaderLocator(LeaderLocator.BALANCED); private String name; private DefaultSuperStreamConfiguration superStreamConfiguration; From f5946f636a66a354e77ff2a8c9244d9b16d9cdaa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Mar 2025 17:22:57 +0000 Subject: [PATCH 406/449] Bump com.google.googlejavaformat:google-java-format Bumps [com.google.googlejavaformat:google-java-format](https://github.com/google/google-java-format) from 1.25.2 to 1.26.0. - [Release notes](https://github.com/google/google-java-format/releases) - [Commits](https://github.com/google/google-java-format/compare/v1.25.2...v1.26.0) --- updated-dependencies: - dependency-name: com.google.googlejavaformat:google-java-format dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dd420d8f72..b69263762e 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ 3.2.1 1.37 2.44.3 - 1.25.2 + 1.26.0 0.8.12 4.9.3.0 4.9.3 From 70fd3840de84ea65957ab5dc8793f050913d1868 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 16:38:20 +0000 Subject: [PATCH 407/449] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.5.2 to 3.5.3 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.5.2 to 3.5.3. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.2...surefire-3.5.3) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b69263762e..0ab424855f 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ 1.4.4 1.0.4 3.14.0 - 3.5.2 + 3.5.3 3.8.1 1.11 3.2.7 From 5f7f15a73ad91f0d7e0502bcb0024a475354f5e3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 17:00:16 +0000 Subject: [PATCH 408/449] Bump org.jacoco:jacoco-maven-plugin from 0.8.12 to 0.8.13 Bumps [org.jacoco:jacoco-maven-plugin](https://github.com/jacoco/jacoco) from 0.8.12 to 0.8.13. - [Release notes](https://github.com/jacoco/jacoco/releases) - [Commits](https://github.com/jacoco/jacoco/compare/v0.8.12...v0.8.13) --- updated-dependencies: - dependency-name: org.jacoco:jacoco-maven-plugin dependency-version: 0.8.13 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0ab424855f..e09a0c241f 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,7 @@ 1.37 2.44.3 1.26.0 - 0.8.12 + 0.8.13 4.9.3.0 4.9.3 From ea941b606053e1d4529c2e922e2b9cf124edaf02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 16:41:20 +0000 Subject: [PATCH 409/449] Bump org.asciidoctor:asciidoctorj-diagram from 2.3.1 to 2.3.2 Bumps [org.asciidoctor:asciidoctorj-diagram](https://github.com/asciidoctor/asciidoctorj-diagram) from 2.3.1 to 2.3.2. - [Release notes](https://github.com/asciidoctor/asciidoctorj-diagram/releases) - [Commits](https://github.com/asciidoctor/asciidoctorj-diagram/compare/v2.3.1...v2.3.2) --- updated-dependencies: - dependency-name: org.asciidoctor:asciidoctorj-diagram dependency-version: 2.3.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e09a0c241f..29b328bf9d 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ 3.4.0 3.2.0 3.0.0 - 2.3.1 + 2.3.2 3.2.1 1.37 2.44.3 From 69671deb57c454533f65ebc73545de77cfea6e20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 16:41:26 +0000 Subject: [PATCH 410/449] Bump org.mockito:mockito-core from 5.16.1 to 5.17.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.16.1 to 5.17.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.16.1...v5.17.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-version: 5.17.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e09a0c241f..b9395a0a92 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.1.10.7 5.12.1 3.27.3 - 5.16.1 + 5.17.0 5.25.0 3.17.0 1.18.0 From fac54ce7208478fdf68b31a113290669cbc6e4f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 14 Feb 2025 11:32:12 +0100 Subject: [PATCH 411/449] Bump Netty to 4.2.0.RC3 --- pom.xml | 2 +- src/main/java/com/rabbitmq/stream/impl/Client.java | 14 ++------------ .../rabbitmq/stream/impl/StreamEnvironment.java | 3 +-- src/main/java/com/rabbitmq/stream/impl/Utils.java | 7 +++++++ .../rabbitmq/stream/DefaultEnvironmentTest.java | 5 +++-- .../com/rabbitmq/stream/docs/EnvironmentUsage.java | 6 +++++- .../java/com/rabbitmq/stream/impl/AlarmsTest.java | 3 +-- .../stream/impl/MqttInteroperabilityTest.java | 3 +-- .../stream/impl/StompInteroperabilityTest.java | 3 +-- .../stream/impl/StreamEnvironmentTest.java | 6 ++++-- .../java/com/rabbitmq/stream/impl/TestUtils.java | 3 +-- 11 files changed, 27 insertions(+), 28 deletions(-) diff --git a/pom.xml b/pom.xml index 725f644930..5bdc1d9ee6 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.1.119.Final + 4.2.0.RC3 0.34.1 4.2.30 1.14.5 diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 8c4f53afec..7777ff158b 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -59,17 +59,7 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufAllocator; import io.netty.buffer.ByteBufOutputStream; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelOption; -import io.netty.channel.ChannelOutboundHandlerAdapter; -import io.netty.channel.ChannelPromise; -import io.netty.channel.ConnectTimeoutException; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.*; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.DecoderException; @@ -248,7 +238,7 @@ public Client(ClientParameters parameters) { if (b.config().group() == null) { EventLoopGroup eventLoopGroup; if (parameters.eventLoopGroup == null) { - this.eventLoopGroup = new NioEventLoopGroup(); + this.eventLoopGroup = Utils.eventLoopGroup(); eventLoopGroup = this.eventLoopGroup; } else { this.eventLoopGroup = null; diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index 2bf4b233f1..57db09292e 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -38,7 +38,6 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.netty.buffer.ByteBufAllocator; import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; import java.io.IOException; @@ -212,7 +211,7 @@ class StreamEnvironment implements Environment { this.addresses.size(), 1, "rabbitmq-stream-locator-connection-"); if (clientParametersPrototype.eventLoopGroup == null) { - this.eventLoopGroup = new NioEventLoopGroup(); + this.eventLoopGroup = Utils.eventLoopGroup(); this.clientParametersPrototype = clientParametersPrototype.duplicate().eventLoopGroup(this.eventLoopGroup); } else { diff --git a/src/main/java/com/rabbitmq/stream/impl/Utils.java b/src/main/java/com/rabbitmq/stream/impl/Utils.java index b449763702..4ea934e911 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Utils.java +++ b/src/main/java/com/rabbitmq/stream/impl/Utils.java @@ -20,6 +20,9 @@ import com.rabbitmq.stream.*; import com.rabbitmq.stream.impl.Client.ClientParameters; import io.netty.channel.ConnectTimeoutException; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.MultiThreadIoEventLoopGroup; +import io.netty.channel.nio.NioIoHandler; import java.net.UnknownHostException; import java.security.cert.X509Certificate; import java.time.Duration; @@ -408,6 +411,10 @@ static Function defaultConnectionNamingStrategy(St prefixes.get(clientConnectionType) + sequences.get(clientConnectionType).getAndIncrement(); } + static EventLoopGroup eventLoopGroup() { + return new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory()); + } + /* class to help testing SAC on super streams */ diff --git a/src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java b/src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java index 4c45d6ae44..0441f5e6a9 100644 --- a/src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java +++ b/src/test/java/com/rabbitmq/stream/DefaultEnvironmentTest.java @@ -19,7 +19,8 @@ import com.rabbitmq.stream.impl.Client; import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.MultiThreadIoEventLoopGroup; +import io.netty.channel.nio.NioIoHandler; import java.util.UUID; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -31,7 +32,7 @@ public class DefaultEnvironmentTest { @BeforeAll static void initAll() { - eventLoopGroup = new NioEventLoopGroup(); + eventLoopGroup = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory()); } @AfterAll diff --git a/src/test/java/com/rabbitmq/stream/docs/EnvironmentUsage.java b/src/test/java/com/rabbitmq/stream/docs/EnvironmentUsage.java index 4f4c001982..bd7a9c6bc2 100644 --- a/src/test/java/com/rabbitmq/stream/docs/EnvironmentUsage.java +++ b/src/test/java/com/rabbitmq/stream/docs/EnvironmentUsage.java @@ -19,7 +19,9 @@ import com.rabbitmq.stream.observation.micrometer.MicrometerObservationCollectorBuilder; import io.micrometer.observation.ObservationRegistry; import io.netty.channel.EventLoopGroup; +import io.netty.channel.MultiThreadIoEventLoopGroup; import io.netty.channel.epoll.EpollEventLoopGroup; +import io.netty.channel.epoll.EpollIoHandler; import io.netty.channel.epoll.EpollSocketChannel; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; @@ -140,7 +142,9 @@ void deleteStream() { void nativeEpoll() { // tag::native-epoll[] - EventLoopGroup epollEventLoopGroup = new EpollEventLoopGroup(); // <1> + EventLoopGroup epollEventLoopGroup = new MultiThreadIoEventLoopGroup( // <1> + EpollIoHandler.newFactory() // <1> + ); // <1> Environment environment = Environment.builder() .netty() // <2> .eventLoopGroup(epollEventLoopGroup) // <3> diff --git a/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java b/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java index 2ee819b058..78141e8130 100644 --- a/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/AlarmsTest.java @@ -32,7 +32,6 @@ import com.rabbitmq.stream.Producer; import com.rabbitmq.stream.StreamException; import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; import java.time.Duration; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicReference; @@ -56,7 +55,7 @@ public class AlarmsTest { @BeforeAll static void initAll() { - eventLoopGroup = new NioEventLoopGroup(); + eventLoopGroup = Utils.eventLoopGroup(); } @AfterAll diff --git a/src/test/java/com/rabbitmq/stream/impl/MqttInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/MqttInteroperabilityTest.java index 1cd14bdabd..9ee3e5b30c 100644 --- a/src/test/java/com/rabbitmq/stream/impl/MqttInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/MqttInteroperabilityTest.java @@ -27,7 +27,6 @@ import com.rabbitmq.stream.OffsetSpecification; import com.rabbitmq.stream.amqp.UnsignedByte; import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; import java.nio.charset.StandardCharsets; import java.util.UUID; import java.util.concurrent.CountDownLatch; @@ -57,7 +56,7 @@ public class MqttInteroperabilityTest { @BeforeAll static void initAll() { - eventLoopGroup = new NioEventLoopGroup(); + eventLoopGroup = Utils.eventLoopGroup(); } @AfterAll diff --git a/src/test/java/com/rabbitmq/stream/impl/StompInteroperabilityTest.java b/src/test/java/com/rabbitmq/stream/impl/StompInteroperabilityTest.java index adb6153a27..4faf6cd848 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StompInteroperabilityTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StompInteroperabilityTest.java @@ -22,7 +22,6 @@ import com.rabbitmq.stream.*; import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; @@ -66,7 +65,7 @@ public class StompInteroperabilityTest { @BeforeAll static void initAll() { - eventLoopGroup = new NioEventLoopGroup(); + eventLoopGroup = Utils.eventLoopGroup(); } @AfterAll diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java index e080275f1f..f076a78fde 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamEnvironmentTest.java @@ -51,7 +51,8 @@ import com.rabbitmq.stream.impl.TestUtils.DisabledIfTlsNotEnabled; import io.netty.channel.Channel; import io.netty.channel.EventLoopGroup; -import io.netty.channel.epoll.EpollEventLoopGroup; +import io.netty.channel.MultiThreadIoEventLoopGroup; +import io.netty.channel.epoll.EpollIoHandler; import io.netty.channel.epoll.EpollSocketChannel; import io.netty.handler.ssl.SslHandler; import java.net.ConnectException; @@ -723,7 +724,8 @@ void nettyInitializersAreCalled() { @EnabledIfSystemProperty(named = "os.arch", matches = "amd64") void nativeEpollWorksOnLinux() { int messageCount = 10_000; - EventLoopGroup epollEventLoopGroup = new EpollEventLoopGroup(); + EventLoopGroup epollEventLoopGroup = + new MultiThreadIoEventLoopGroup(EpollIoHandler.newFactory()); try { Set channels = ConcurrentHashMap.newKeySet(); try (Environment env = diff --git a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java index 417842be85..59d88cf6aa 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TestUtils.java +++ b/src/test/java/com/rabbitmq/stream/impl/TestUtils.java @@ -42,7 +42,6 @@ import com.rabbitmq.stream.impl.Client.Response; import com.rabbitmq.stream.impl.Client.StreamMetadata; import io.netty.channel.EventLoopGroup; -import io.netty.channel.nio.NioEventLoopGroup; import io.vavr.Tuple2; import java.io.IOException; import java.lang.annotation.Documented; @@ -627,7 +626,7 @@ static EventLoopGroup eventLoopGroup(ExtensionContext context) { @Override public void beforeAll(ExtensionContext context) { - store(context).put("nettyEventLoopGroup", new NioEventLoopGroup()); + store(context).put("nettyEventLoopGroup", Utils.eventLoopGroup()); } @Override From 0fa29503a5738efca11c2980d7cd2b6e4962b84b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 14 Feb 2025 15:13:44 +0100 Subject: [PATCH 412/449] Deprecate tls#hostnameVerification Now set up with Netty's SslContextBuilder#endpointIdentificationAlgorithm(String). --- src/docs/asciidoc/api.adoc | 14 ++++---------- .../com/rabbitmq/stream/EnvironmentBuilder.java | 10 ++++++++-- .../java/com/rabbitmq/stream/impl/Client.java | 15 --------------- .../rabbitmq/stream/impl/StreamEnvironment.java | 7 ++++--- .../stream/impl/StreamEnvironmentBuilder.java | 3 +++ .../java/com/rabbitmq/stream/impl/TlsTest.java | 12 ++++++------ 6 files changed, 25 insertions(+), 36 deletions(-) diff --git a/src/docs/asciidoc/api.adoc b/src/docs/asciidoc/api.adoc index d490a5d12b..f4c5d0be9a 100644 --- a/src/docs/asciidoc/api.adoc +++ b/src/docs/asciidoc/api.adoc @@ -88,10 +88,9 @@ TLS can be enabled by using the `rabbitmq-stream+tls` scheme in the URI. The default TLS port is 5551. Use the `EnvironmentBuilder#tls` method to configure TLS. -The most important setting is a `io.netty.handler.ssl.SslContext` instance, -which is created and configured with the -`io.netty.handler.ssl.SslContext#forClient` method. Note hostname verification -is enabled by default. +The most important setting is a `io.netty.handler.ssl.SslContext` instance, which is created and configured with the +`io.netty.handler.ssl.SslContext#forClient` method. +Note hostname verification is enabled by default. The following snippet shows a common configuration, whereby the client is instructed to trust servers with certificates @@ -242,15 +241,10 @@ Used as a prefix for connection names. |Configuration helper for TLS. |TLS is enabled if a `rabbitmq-stream+tls` URI is provided. -|`tls#hostnameVerification` -|Enable or disable hostname verification. -|Enabled by default. - |`tls#sslContext` |Set the `io.netty.handler.ssl.SslContext` used for the TLS connection. Use `io.netty.handler.ssl.SslContextBuilder#forClient` to configure it. -The server certificate chain and the client private key are the typical -elements that need to be configured. +The server certificate chain, the client private key, and hostname verification are the usual elements that need to be configured. |The JDK trust manager and no client private key. |`tls#trustEverything` diff --git a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java index 12dd0643ed..33fac4dcbc 100644 --- a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java @@ -442,7 +442,10 @@ interface TlsConfiguration { *

Hostname verification is enabled by default. * * @return the TLS configuration helper + * @deprecated use {@link SslContextBuilder#endpointIdentificationAlgorithm(String)} with {@link + * #sslContext(SslContext)} */ + @Deprecated(forRemoval = true) TlsConfiguration hostnameVerification(); /** @@ -450,9 +453,12 @@ interface TlsConfiguration { * *

Hostname verification is enabled by default. * - * @param hostnameVerification + * @param hostnameVerification whether to enable hostname verification or not * @return the TLS configuration helper + * @deprecated use {@link SslContextBuilder#endpointIdentificationAlgorithm(String)} with {@link + * #sslContext(SslContext)} */ + @Deprecated(forRemoval = true) TlsConfiguration hostnameVerification(boolean hostnameVerification); /** @@ -460,7 +466,7 @@ interface TlsConfiguration { * *

Use {@link SslContextBuilder#forClient()} to configure and create an instance. * - * @param sslContext + * @param sslContext the SSL context * @return the TLS configuration helper */ TlsConfiguration sslContext(SslContext sslContext); diff --git a/src/main/java/com/rabbitmq/stream/impl/Client.java b/src/main/java/com/rabbitmq/stream/impl/Client.java index 7777ff158b..8679844939 100644 --- a/src/main/java/com/rabbitmq/stream/impl/Client.java +++ b/src/main/java/com/rabbitmq/stream/impl/Client.java @@ -96,9 +96,7 @@ import java.util.function.Consumer; import java.util.function.Supplier; import java.util.function.ToLongFunction; -import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLHandshakeException; -import javax.net.ssl.SSLParameters; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -283,13 +281,6 @@ public void initChannel(SocketChannel ch) { SslHandler sslHandler = parameters.sslContext.newHandler(ch.alloc(), parameters.host, parameters.port); - if (parameters.tlsHostnameVerification) { - SSLEngine sslEngine = sslHandler.engine(); - SSLParameters sslParameters = sslEngine.getSSLParameters(); - sslParameters.setEndpointIdentificationAlgorithm("HTTPS"); - sslEngine.setSSLParameters(sslParameters); - } - ch.pipeline().addFirst("ssl", sslHandler); } channelCustomizer.accept(ch); @@ -2397,7 +2388,6 @@ public static class ClientParameters { private ChunkChecksum chunkChecksum = JdkChunkChecksum.CRC32_SINGLETON; private MetricsCollector metricsCollector = NoOpMetricsCollector.SINGLETON; private SslContext sslContext; - private boolean tlsHostnameVerification = true; private ByteBufAllocator byteBufAllocator; private Duration rpcTimeout; private Consumer channelCustomizer = noOpConsumer(); @@ -2554,11 +2544,6 @@ public ClientParameters sslContext(SslContext sslContext) { return this; } - public ClientParameters tlsHostnameVerification(boolean tlsHostnameVerification) { - this.tlsHostnameVerification = tlsHostnameVerification; - return this; - } - public ClientParameters compressionCodecFactory( CompressionCodecFactory compressionCodecFactory) { this.compressionCodecFactory = compressionCodecFactory; diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index 57db09292e..55957434cf 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -129,12 +129,13 @@ class StreamEnvironment implements Environment { try { SslContext sslContext = tlsConfiguration.sslContext() == null - ? SslContextBuilder.forClient().build() + ? SslContextBuilder.forClient() + .endpointIdentificationAlgorithm( + tlsConfiguration.hostnameVerificationEnabled() ? "HTTPS" : null) + .build() : tlsConfiguration.sslContext(); clientParametersPrototype.sslContext(sslContext); - clientParametersPrototype.tlsHostnameVerification( - tlsConfiguration.hostnameVerificationEnabled()); } catch (SSLException e) { throw new StreamException("Error while creating Netty SSL context", e); diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java index 555200dee0..e23dc8d845 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java @@ -373,12 +373,14 @@ private DefaultTlsConfiguration(EnvironmentBuilder environmentBuilder) { } @Override + @SuppressWarnings("removal") public TlsConfiguration hostnameVerification() { this.hostnameVerification = true; return this; } @Override + @SuppressWarnings("removal") public TlsConfiguration hostnameVerification(boolean hostnameVerification) { this.hostnameVerification = hostnameVerification; return this; @@ -400,6 +402,7 @@ public TlsConfiguration trustEverything() { this.sslContext( SslContextBuilder.forClient() .trustManager(Utils.TRUST_EVERYTHING_TRUST_MANAGER) + .endpointIdentificationAlgorithm("NONE") .build()); } catch (SSLException e) { throw new StreamException("Error while creating Netty SSL context", e); diff --git a/src/test/java/com/rabbitmq/stream/impl/TlsTest.java b/src/test/java/com/rabbitmq/stream/impl/TlsTest.java index 3959789cda..249034555b 100644 --- a/src/test/java/com/rabbitmq/stream/impl/TlsTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/TlsTest.java @@ -295,12 +295,12 @@ void hostnameVerificationShouldFailWhenSettingHostToLoopbackInterface() throws E @Test void shouldConnectWhenSettingHostToLoopbackInterfaceAndDisablingHostnameVerification() throws Exception { - SslContext context = SslContextBuilder.forClient().trustManager(caCertificate()).build(); - cf.get( - new ClientParameters() - .sslContext(context) - .host("127.0.0.1") - .tlsHostnameVerification(false)); + SslContext context = + SslContextBuilder.forClient() + .endpointIdentificationAlgorithm(null) + .trustManager(caCertificate()) + .build(); + cf.get(new ClientParameters().sslContext(context).host("127.0.0.1")); } @Test From 9b8e9926337f6067cffacb4eea9c861a27838843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Mon, 10 Mar 2025 17:35:17 +0100 Subject: [PATCH 413/449] Bump Netty to 4.2.0.RC4 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5bdc1d9ee6..2aa094eff7 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.2.0.RC3 + 4.2.0.RC4 0.34.1 4.2.30 1.14.5 From ee52e939bf176a6f23f662713f8f4ec50084c75c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Mon, 7 Apr 2025 09:15:47 +0200 Subject: [PATCH 414/449] Bump Netty to 4.2.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2aa094eff7..5c465ff2ea 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.2.0.RC4 + 4.2.0.Final 0.34.1 4.2.30 1.14.5 From 9f2a795aa727990ccb74fe96924eab9a8fefc2ae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 16:51:22 +0000 Subject: [PATCH 415/449] Bump com.diffplug.spotless:spotless-maven-plugin from 2.44.3 to 2.44.4 Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.44.3 to 2.44.4. - [Release notes](https://github.com/diffplug/spotless/releases) - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/maven/2.44.3...maven/2.44.4) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-version: 2.44.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5c465ff2ea..91259e57c7 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 2.3.2 3.2.1 1.37 - 2.44.3 + 2.44.4 1.26.0 0.8.13 4.9.3.0 From b47a3c6d17f71892c2c9dee43dbb2094cbca5a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 9 Apr 2025 10:32:58 +0200 Subject: [PATCH 416/449] Disable hostname verification in trust-everything TLS configuration By using Netty SslContextBuilder.endpointIdentificationAlgorithm(null). References #709 --- src/main/java/com/rabbitmq/stream/amqp/package-info.java | 2 +- .../java/com/rabbitmq/stream/impl/StreamEnvironment.java | 5 +---- .../com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/amqp/package-info.java b/src/main/java/com/rabbitmq/stream/amqp/package-info.java index 88cd83e282..14121ad9d6 100644 --- a/src/main/java/com/rabbitmq/stream/amqp/package-info.java +++ b/src/main/java/com/rabbitmq/stream/amqp/package-info.java @@ -1,2 +1,2 @@ -/** Classes for AMQP 1.0 support. */ +/** Classes for AMQP 1.0 message format support. */ package com.rabbitmq.stream.amqp; diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java index 55957434cf..8bf503beab 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironment.java @@ -129,10 +129,7 @@ class StreamEnvironment implements Environment { try { SslContext sslContext = tlsConfiguration.sslContext() == null - ? SslContextBuilder.forClient() - .endpointIdentificationAlgorithm( - tlsConfiguration.hostnameVerificationEnabled() ? "HTTPS" : null) - .build() + ? SslContextBuilder.forClient().build() : tlsConfiguration.sslContext(); clientParametersPrototype.sslContext(sslContext); diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java index e23dc8d845..bf7f395fca 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java @@ -402,7 +402,7 @@ public TlsConfiguration trustEverything() { this.sslContext( SslContextBuilder.forClient() .trustManager(Utils.TRUST_EVERYTHING_TRUST_MANAGER) - .endpointIdentificationAlgorithm("NONE") + .endpointIdentificationAlgorithm(null) .build()); } catch (SSLException e) { throw new StreamException("Error while creating Netty SSL context", e); From ec1a8d8e9d6c39c7b55826af50db9fbbc0db438e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 9 Apr 2025 10:56:55 +0200 Subject: [PATCH 417/449] Set release version to 0.24.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index 1fe2dedcdb..7e4e8269f6 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,5 +1,5 @@ -RELEASE_VERSION="0.23.0" -DEVELOPMENT_VERSION="0.24.0-SNAPSHOT" +RELEASE_VERSION="0.24.0" +DEVELOPMENT_VERSION="1.0.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 3797cdd06e7d81386574cb9c62f4cf6577671f54 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Wed, 9 Apr 2025 09:00:37 +0000 Subject: [PATCH 418/449] [maven-release-plugin] prepare release v0.24.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 91259e57c7..84d285b149 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.24.0-SNAPSHOT + 0.24.0 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v0.24.0 From 13e7de93b50ce1618f7ba199e2ceaa590a3ca33a Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Wed, 9 Apr 2025 09:00:39 +0000 Subject: [PATCH 419/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 84d285b149..a0bf5ed037 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 0.24.0 + 1.0.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v0.24.0 + HEAD From fef3d93f2bdc65f2d881a3666a423aa6b82bc5e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 16:29:24 +0000 Subject: [PATCH 420/449] Bump com.google.code.gson:gson from 2.12.1 to 2.13.0 Bumps [com.google.code.gson:gson](https://github.com/google/gson) from 2.12.1 to 2.13.0. - [Release notes](https://github.com/google/gson/releases) - [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md) - [Commits](https://github.com/google/gson/compare/gson-parent-2.12.1...gson-parent-2.13.0) --- updated-dependencies: - dependency-name: com.google.code.gson:gson dependency-version: 2.13.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a0bf5ed037..07f4a0e764 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ 5.25.0 3.17.0 1.18.0 - 2.12.1 + 2.13.0 0.10.6 1.2.5 1.4.4 From 7366f859e0a418b2ac420303d6a88cafc53c41fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 16:29:33 +0000 Subject: [PATCH 421/449] Bump org.junit:junit-bom from 5.12.1 to 5.12.2 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit5) from 5.12.1 to 5.12.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.12.1...r5.12.2) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-version: 5.12.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a0bf5ed037..63c3d4db69 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.5.7-2 1.8.0 1.1.10.7 - 5.12.1 + 5.12.2 3.27.3 5.17.0 5.25.0 From 51971e2ca693faf4596cea28f0d6957898a7ba47 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 16:36:53 +0000 Subject: [PATCH 422/449] Bump io.micrometer:micrometer-core from 1.14.5 to 1.14.6 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.14.5 to 1.14.6. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.14.5...v1.14.6) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-version: 1.14.6 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 04d69506be..b6e4a330b8 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.2.0.Final 0.34.1 4.2.30 - 1.14.5 + 1.14.6 13.1.1 4.7.5 1.27.1 From 5e7a66c03763e9be31e1b656192231eda38c52da Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Apr 2025 16:37:05 +0000 Subject: [PATCH 423/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.4.4 to 1.4.5. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.4.4...v1.4.5) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-version: 1.4.5 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 04d69506be..856b2a7909 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.13.0 0.10.6 1.2.5 - 1.4.4 + 1.4.5 1.0.4 3.14.0 3.5.3 From d566333b33c8bb6110706f3177f16c6be55bd8d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 16:13:13 +0000 Subject: [PATCH 424/449] Bump com.swiftmq:swiftmq-client from 13.1.1 to 13.1.2 Bumps [com.swiftmq:swiftmq-client](https://github.com/iitsoftware/swiftmq-client) from 13.1.1 to 13.1.2. - [Release notes](https://github.com/iitsoftware/swiftmq-client/releases) - [Commits](https://github.com/iitsoftware/swiftmq-client/compare/13.1.1...13.1.2) --- updated-dependencies: - dependency-name: com.swiftmq:swiftmq-client dependency-version: 13.1.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 191cbeb4c2..5b94ad978d 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ 0.34.1 4.2.30 1.14.6 - 13.1.1 + 13.1.2 4.7.5 1.27.1 1.5.7-2 From 7f3a09577bcd04b88bad2070d6e3d2d9a91c6dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 16 Apr 2025 09:48:32 +0200 Subject: [PATCH 425/449] Use RabbitMQ 4.1 as default on CI --- .github/workflows/test-rabbitmq-alphas.yml | 1 - README.adoc | 2 +- ci/cluster/docker-compose.yml | 6 +++--- ci/start-broker.sh | 2 +- ci/start-cluster.sh | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index 0414fce497..6b8e9e32c6 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -14,7 +14,6 @@ jobs: strategy: matrix: rabbitmq-image: - - pivotalrabbitmq/rabbitmq:v4.0.x-otp27 - pivotalrabbitmq/rabbitmq:v4.1.x-otp27 - pivotalrabbitmq/rabbitmq:main-otp27 name: Test against ${{ matrix.rabbitmq-image }} diff --git a/README.adoc b/README.adoc index 95445f6e73..05af0b4178 100644 --- a/README.adoc +++ b/README.adoc @@ -80,7 +80,7 @@ Launch the broker: ---- docker run -it --rm --name rabbitmq -p 5552:5552 -p 5672:5672 \ -e RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS='-rabbitmq_stream advertised_host localhost' \ - rabbitmq:4.0 + rabbitmq:4.1 ---- Enable the stream plugin: diff --git a/ci/cluster/docker-compose.yml b/ci/cluster/docker-compose.yml index 39345d3e8d..40a6860ee1 100644 --- a/ci/cluster/docker-compose.yml +++ b/ci/cluster/docker-compose.yml @@ -6,7 +6,7 @@ services: - rabbitmq-cluster hostname: node0 container_name: rabbitmq0 - image: ${RABBITMQ_IMAGE:-rabbitmq:4.0} + image: ${RABBITMQ_IMAGE:-rabbitmq:4.1} pull_policy: always ports: - "5672:5672" @@ -22,7 +22,7 @@ services: - rabbitmq-cluster hostname: node1 container_name: rabbitmq1 - image: ${RABBITMQ_IMAGE:-rabbitmq:4.0} + image: ${RABBITMQ_IMAGE:-rabbitmq:4.1} pull_policy: always ports: - "5673:5672" @@ -38,7 +38,7 @@ services: - rabbitmq-cluster hostname: node2 container_name: rabbitmq2 - image: ${RABBITMQ_IMAGE:-rabbitmq:4.0} + image: ${RABBITMQ_IMAGE:-rabbitmq:4.1} pull_policy: always ports: - "5674:5672" diff --git a/ci/start-broker.sh b/ci/start-broker.sh index a45909c7bf..38c60cc1b9 100755 --- a/ci/start-broker.sh +++ b/ci/start-broker.sh @@ -2,7 +2,7 @@ LOCAL_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:4.0} +RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:4.1} wait_for_message() { while ! docker logs "$1" | grep -q "$2"; diff --git a/ci/start-cluster.sh b/ci/start-cluster.sh index c7a5a9f321..b8440984fb 100755 --- a/ci/start-cluster.sh +++ b/ci/start-cluster.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -export RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:4.0} +export RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:4.1} wait_for_message() { while ! docker logs "$1" | grep -q "$2"; From 8883d16051871398b7a2285fef192fcb536cc074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:11:11 +0200 Subject: [PATCH 426/449] Remove deprecated TlsConfiguration#hostnameVerification methods References #740 --- .../rabbitmq/stream/EnvironmentBuilder.java | 25 ------------------- .../stream/impl/StreamEnvironmentBuilder.java | 14 ----------- 2 files changed, 39 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java index 33fac4dcbc..4c8a5239f5 100644 --- a/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/EnvironmentBuilder.java @@ -436,31 +436,6 @@ EnvironmentBuilder topologyUpdateBackOffDelayPolicy( /** Helper to configure TLS. */ interface TlsConfiguration { - /** - * Enable hostname verification. - * - *

Hostname verification is enabled by default. - * - * @return the TLS configuration helper - * @deprecated use {@link SslContextBuilder#endpointIdentificationAlgorithm(String)} with {@link - * #sslContext(SslContext)} - */ - @Deprecated(forRemoval = true) - TlsConfiguration hostnameVerification(); - - /** - * Enable or disable hostname verification. - * - *

Hostname verification is enabled by default. - * - * @param hostnameVerification whether to enable hostname verification or not - * @return the TLS configuration helper - * @deprecated use {@link SslContextBuilder#endpointIdentificationAlgorithm(String)} with {@link - * #sslContext(SslContext)} - */ - @Deprecated(forRemoval = true) - TlsConfiguration hostnameVerification(boolean hostnameVerification); - /** * Netty {@link SslContext} for TLS connections. * diff --git a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java index bf7f395fca..f3b38cb884 100644 --- a/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java +++ b/src/main/java/com/rabbitmq/stream/impl/StreamEnvironmentBuilder.java @@ -372,20 +372,6 @@ private DefaultTlsConfiguration(EnvironmentBuilder environmentBuilder) { this.environmentBuilder = environmentBuilder; } - @Override - @SuppressWarnings("removal") - public TlsConfiguration hostnameVerification() { - this.hostnameVerification = true; - return this; - } - - @Override - @SuppressWarnings("removal") - public TlsConfiguration hostnameVerification(boolean hostnameVerification) { - this.hostnameVerification = hostnameVerification; - return this; - } - @Override public TlsConfiguration sslContext(SslContext sslContext) { this.sslContext = sslContext; From f2a90a7e22d277d474992f880744c48927d4cbf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:24:33 +0200 Subject: [PATCH 427/449] Set release version to 1.0.0 (cherry picked from commit 4cd49eb09a4ff0e7c26086b4ff14a7676fe8c206) --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index 7e4e8269f6..9ff62f9ab4 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,5 +1,5 @@ -RELEASE_VERSION="0.24.0" -DEVELOPMENT_VERSION="1.0.0-SNAPSHOT" +RELEASE_VERSION="1.0.0" +DEVELOPMENT_VERSION="1.1.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 8a6c2ca06c18fe4eb781842e2f92ffd87d8c64c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:24:52 +0200 Subject: [PATCH 428/449] Use RabbitMQ 4.1 in documentation (cherry picked from commit d75f6981ae72f97683583a80071c98e4e5cc8a61) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5b94ad978d..3c45aabddb 100644 --- a/pom.xml +++ b/pom.xml @@ -94,7 +94,7 @@ 4.9.3.0 4.9.3 - 4.0 + 4.1 6026DFCA yyyy-MM-dd'T'HH:mm:ss'Z' From 1089f6cd48252ca0527369f8b0f49f569fd2d316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:25:41 +0200 Subject: [PATCH 429/449] Mention API is stable now library is in 1.0.0 (cherry picked from commit c48e8f69c9508e5b11921ed47be1ea4d560718dc) --- README.adoc | 7 +++++-- src/docs/asciidoc/overview.adoc | 17 +++-------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/README.adoc b/README.adoc index 05af0b4178..19869c317b 100644 --- a/README.adoc +++ b/README.adoc @@ -16,8 +16,11 @@ Please refer to the https://rabbitmq.github.io/rabbitmq-stream-java-client/stabl == Project Maturity -The project is in development and stabilization phase. -Features and API are subject to change, but https://rabbitmq.github.io/rabbitmq-stream-java-client/stable/htmlsingle/#stability-of-programming-interfaces[breaking changes] will be kept to a minimum. +The library is stable and production-ready. + +== Versioning + +This library uses https://semver.org/[semantic versioning]. == Support diff --git a/src/docs/asciidoc/overview.adoc b/src/docs/asciidoc/overview.adoc index 4e1f736a02..6040e03172 100644 --- a/src/docs/asciidoc/overview.adoc +++ b/src/docs/asciidoc/overview.adoc @@ -75,30 +75,19 @@ recovery and automatic re-subscription for consumers. == Versioning -The RabbitMQ Stream Java Client is in development and stabilization phase. -When the stabilization phase ends, a 1.0.0 version will be cut, and -https://semver.org/[semantic versioning] is likely to be enforced. +This library uses https://semver.org/[semantic versioning]. -Before reaching the stable phase, the client will use a versioning scheme of `[0.MINOR.PATCH]` where: - -* `0` indicates the project is still in a stabilization phase. -* `MINOR` is a 0-based number incrementing with each new release cycle. It generally reflects significant changes like new features and potentially some programming interfaces changes. -* `PATCH` is a 0-based number incrementing with each service release, that is bux fixes. - -Breaking changes between releases can happen but will be kept to a minimum. The next section provides more details about the evolution of programming interfaces. [[stability-of-programming-interfaces]] == Stability of Programming Interfaces -The RabbitMQ Stream Java Client is in active development but its programming interfaces will remain as stable as possible. -There is no guarantee though that they will remain completely stable, at least until it reaches version 1.0.0. - The client contains 2 sets of programming interfaces whose stability are of interest for application developers: * Application Programming Interfaces (API): those are the ones used to write application logic. They include the interfaces and classes in the `com.rabbitmq.stream` package (e.g. `Producer`, `Consumer`, `Message`). -These API constitute the main programming model of the client and will be kept as stable as possible. +These API constitute the main programming model of the client and are kept as stable as possible. +New features may require to add methods to existing interfaces. * Service Provider Interfaces (SPI): those are interfaces to implement mainly technical behavior in the client. They are not meant to be used to implement application logic. Application developers may have to refer to them in the configuration phase and if they want to customize some internal behavior of the client. From 28709386e1dcef3130bf00787683bfed586c744a Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Wed, 16 Apr 2025 15:36:58 +0000 Subject: [PATCH 430/449] [maven-release-plugin] prepare release v1.0.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 3c45aabddb..375e3457c9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 1.0.0-SNAPSHOT + 1.0.0 RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - HEAD + v1.0.0 From 97aaa8445d03a75a807348380538bf4133ed0d3f Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Wed, 16 Apr 2025 15:36:59 +0000 Subject: [PATCH 431/449] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 375e3457c9..ea8e4cba52 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq stream-client - 1.0.0 + 1.1.0-SNAPSHOT RabbitMQ Stream Java Client The RabbitMQ Stream Java client library allows Java applications to interface with @@ -43,7 +43,7 @@ https://github.com/rabbitmq/rabbitmq-stream-java-client scm:git:git://github.com/rabbitmq/rabbitmq-stream-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-stream-java-client.git - v1.0.0 + HEAD From 0b1d720d9d325e9dc98403063c948d3d18cba6aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:41:20 +0200 Subject: [PATCH 432/449] Set release version to 1.1.0 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index 9ff62f9ab4..c3aa198d6e 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,4 +1,4 @@ -RELEASE_VERSION="1.0.0" +RELEASE_VERSION="1.1.0" DEVELOPMENT_VERSION="1.1.0-SNAPSHOT" RELEASE_BRANCH="main" LATEST=true From 59b95c00d13fe7c6a5060ce5b71d60a45b2b4b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:41:39 +0200 Subject: [PATCH 433/449] Delete Dockerfile Leftover from Stream PerfTest. --- Dockerfile | 96 ------------------------------------------------------ 1 file changed, 96 deletions(-) delete mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 4deefa0459..0000000000 --- a/Dockerfile +++ /dev/null @@ -1,96 +0,0 @@ -FROM ubuntu:22.04 as builder - -ARG stream_perf_test_url="set-url-here" - -RUN set -eux; \ - \ - apt-get update; \ - apt-get -y upgrade; \ - apt-get install --yes --no-install-recommends \ - ca-certificates \ - wget \ - gnupg \ - jq - -ARG JAVA_VERSION="21" - -RUN if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ]; then echo "ARM"; ARCH="arm"; BUNDLE="jdk"; else echo "x86"; ARCH="x86"; BUNDLE="jdk"; fi \ - && wget "https://api.azul.com/zulu/download/community/v1.0/bundles/latest/?java_version=$JAVA_VERSION&ext=tar.gz&os=linux&arch=$ARCH&hw_bitness=64&release_status=ga&bundle_type=$BUNDLE" -O jdk-info.json -RUN wget --progress=bar:force:noscroll -O "jdk.tar.gz" $(cat jdk-info.json | jq --raw-output .url) -RUN echo "$(cat jdk-info.json | jq --raw-output .sha256_hash) *jdk.tar.gz" | sha256sum --check --strict - - -RUN set -eux; \ - if [ "$(uname -m)" = "x86_64" ] ; then JAVA_PATH="/usr/lib/jdk-$JAVA_VERSION"; \ - mkdir $JAVA_PATH && \ - tar --extract --file jdk.tar.gz --directory "$JAVA_PATH" --strip-components 1; \ - $JAVA_PATH/bin/jlink --compress=2 --output /jre --add-modules java.base,jdk.management,java.naming,java.xml,jdk.unsupported,jdk.crypto.cryptoki,jdk.httpserver; \ - /jre/bin/java -version; \ - fi - -RUN set -eux; \ - if [ "$(uname -m)" = "aarch64" ] || [ "$(uname -m)" = "arm64" ] ; then JAVA_PATH="/jre"; \ - mkdir $JAVA_PATH && \ - tar --extract --file jdk.tar.gz --directory "$JAVA_PATH" --strip-components 1; \ - fi - -# pgpkeys.uk is quite reliable, but allow for substitutions locally -ARG PGP_KEYSERVER=hkps://keys.openpgp.org -# If you are building this image locally and are getting `gpg: keyserver receive failed: No data` errors, -# run the build with a different PGP_KEYSERVER, e.g. docker build --tag rabbitmq:3.7 --build-arg PGP_KEYSERVER=pgpkeys.eu 3.7/ubuntu -# For context, see https://github.com/docker-library/official-images/issues/4252 - -# https://www.rabbitmq.com/signatures.html#importing-gpg -ENV RABBITMQ_PGP_KEY_ID="0x0A9AF2115F4687BD29803A206B73A36E6026DFCA" -ENV STREAM_PERF_TEST_HOME="/stream_perf_test" - -RUN set -eux; \ - \ - wget --progress dot:giga --output-document "/usr/local/src/stream-perf-test.jar.asc" "$stream_perf_test_url.asc"; \ - wget --progress dot:giga --output-document "/usr/local/src/stream-perf-test.jar" "$stream_perf_test_url"; \ - STREAM_PERF_TEST_SHA256="$(wget -qO- $stream_perf_test_url.sha256)"; \ - echo "$STREAM_PERF_TEST_SHA256 /usr/local/src/stream-perf-test.jar" | sha256sum --check --strict -; \ - \ - export GNUPGHOME="$(mktemp -d)"; \ - gpg --batch --keyserver "$PGP_KEYSERVER" --recv-keys "$RABBITMQ_PGP_KEY_ID"; \ - gpg --batch --verify "/usr/local/src/stream-perf-test.jar.asc" "/usr/local/src/stream-perf-test.jar"; \ - gpgconf --kill all; \ - rm -rf "$GNUPGHOME"; \ - \ - mkdir -p "$STREAM_PERF_TEST_HOME"; \ - cp /usr/local/src/stream-perf-test.jar $STREAM_PERF_TEST_HOME/stream-perf-test.jar - -FROM ubuntu:22.04 - -# we need locales support for characters like ยต to show up correctly in the console -RUN set -eux; \ - apt-get update; \ - apt-get -y upgrade; \ - apt-get install -y --no-install-recommends \ - locales \ - wget \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - locale-gen en_US.UTF-8 - -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 - -ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk/jre -RUN mkdir -p $JAVA_HOME -COPY --from=builder /jre $JAVA_HOME/ -RUN ln -svT $JAVA_HOME/bin/java /usr/local/bin/java - -RUN mkdir -p /stream_perf_test -WORKDIR /stream_perf_test -COPY --from=builder /stream_perf_test ./ -RUN set -eux; \ - if [ "$(uname -m)" = "x86_64" ] ; then java -jar stream-perf-test.jar --help ; \ - fi - -RUN groupadd --gid 1000 stream-perf-test -RUN useradd --uid 1000 --gid stream-perf-test --comment "perf-test user" stream-perf-test - -USER stream-perf-test:stream-perf-test - -ENTRYPOINT ["java", "-Dio.netty.processId=1", "-jar", "stream-perf-test.jar"] From 9d3cea55c816a8aa9c0c1895dcdb73908f7d3f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 16 Apr 2025 17:44:45 +0200 Subject: [PATCH 434/449] Remove pre-1.0 versioning section from readme --- README.adoc | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/README.adoc b/README.adoc index 19869c317b..2a96cd7585 100644 --- a/README.adoc +++ b/README.adoc @@ -18,10 +18,6 @@ Please refer to the https://rabbitmq.github.io/rabbitmq-stream-java-client/stabl The library is stable and production-ready. -== Versioning - -This library uses https://semver.org/[semantic versioning]. - == Support * For questions: https://groups.google.com/forum/#!forum/rabbitmq-users[RabbitMQ Users] @@ -54,17 +50,7 @@ This library requires at least Java 11, but Java 21 or more is recommended. == Versioning -The RabbitMQ Stream Java Client is in development and stabilization phase. -When the stabilization phase ends, a 1.0.0 version will be cut, and -https://semver.org/[semantic versioning] is likely to be enforced. - -Before reaching the stable phase, the client will use a versioning scheme of `[0.MINOR.PATCH]` where: - -* `0` indicates the project is still in a stabilization phase. -* `MINOR` is a 0-based number incrementing with each new release cycle. It generally reflects significant changes like new features and potentially some programming interfaces changes. -* `PATCH` is a 0-based number incrementing with each service release, that is bux fixes. - -Breaking changes between releases can happen but will be kept to a minimum. +This library uses https://semver.org/[semantic versioning]. == Build Instructions From e571b1a28439ea82bf7aef3abb834dc1113651eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Thu, 17 Apr 2025 16:40:10 +0200 Subject: [PATCH 435/449] Test against Java 24 stable And remove Java 23. --- .github/workflows/test-supported-java-versions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-supported-java-versions.yml b/.github/workflows/test-supported-java-versions.yml index f7694cdc18..f2ac5a1289 100644 --- a/.github/workflows/test-supported-java-versions.yml +++ b/.github/workflows/test-supported-java-versions.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: distribution: [ 'temurin' ] - version: [ '11', '17', '21', '23', '24-ea', '25-ea' ] + version: [ '11', '17', '21', '24', '25-ea' ] include: - distribution: 'semeru' version: '17' From e4b76cc77fcbca7f66497070c3548707f3c9c5ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 16:14:36 +0000 Subject: [PATCH 436/449] Bump com.google.code.gson:gson from 2.13.0 to 2.13.1 Bumps [com.google.code.gson:gson](https://github.com/google/gson) from 2.13.0 to 2.13.1. - [Release notes](https://github.com/google/gson/releases) - [Changelog](https://github.com/google/gson/blob/main/CHANGELOG.md) - [Commits](https://github.com/google/gson/compare/gson-parent-2.13.0...gson-parent-2.13.1) --- updated-dependencies: - dependency-name: com.google.code.gson:gson dependency-version: 2.13.1 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ea8e4cba52..f5c8558d8d 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ 5.25.0 3.17.0 1.18.0 - 2.13.0 + 2.13.1 0.10.6 1.2.5 1.4.5 From f616d4c02fe5b57d4d1a5561d959e1b6c8b60e6b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 May 2025 17:07:38 +0000 Subject: [PATCH 437/449] Bump com.github.luben:zstd-jni from 1.5.7-2 to 1.5.7-3 Bumps [com.github.luben:zstd-jni](https://github.com/luben/zstd-jni) from 1.5.7-2 to 1.5.7-3. - [Commits](https://github.com/luben/zstd-jni/compare/v1.5.7-2...v1.5.7-3) --- updated-dependencies: - dependency-name: com.github.luben:zstd-jni dependency-version: 1.5.7-3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f5c8558d8d..274b44d75f 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 13.1.2 4.7.5 1.27.1 - 1.5.7-2 + 1.5.7-3 1.8.0 1.1.10.7 5.12.2 From 5ff3ec21260bd417b106d032b3c32618217d46fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 May 2025 15:14:00 +0000 Subject: [PATCH 438/449] Bump netty.version from 4.2.0.Final to 4.2.1.Final Bumps `netty.version` from 4.2.0.Final to 4.2.1.Final. Updates `io.netty:netty-transport` from 4.2.0.Final to 4.2.1.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.0.Final...netty-4.2.1.Final) Updates `io.netty:netty-codec` from 4.2.0.Final to 4.2.1.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.0.Final...netty-4.2.1.Final) Updates `io.netty:netty-handler` from 4.2.0.Final to 4.2.1.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.0.Final...netty-4.2.1.Final) Updates `io.netty:netty-transport-native-epoll` from 4.2.0.Final to 4.2.1.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.0.Final...netty-4.2.1.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-version: 4.2.1.Final dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-version: 4.2.1.Final dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-version: 4.2.1.Final dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-version: 4.2.1.Final dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 274b44d75f..ebc8fa1fda 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.2.0.Final + 4.2.1.Final 0.34.1 4.2.30 1.14.6 From 40a6560c4ac5b8a2f9a6ed13a6cf68b3d8daa59b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 7 May 2025 10:33:02 +0200 Subject: [PATCH 439/449] Back to Netty 4.2.0 Experiencing unexpected disconnections in some tests. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ebc8fa1fda..274b44d75f 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.2.1.Final + 4.2.0.Final 0.34.1 4.2.30 1.14.6 From 5ff57aabe08ecf8050cd0af0c937994c831ef691 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 16:03:29 +0000 Subject: [PATCH 440/449] Bump netty.version from 4.2.0.Final to 4.2.1.Final Bumps `netty.version` from 4.2.0.Final to 4.2.1.Final. Updates `io.netty:netty-transport` from 4.2.0.Final to 4.2.1.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.0.Final...netty-4.2.1.Final) Updates `io.netty:netty-codec` from 4.2.0.Final to 4.2.1.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.0.Final...netty-4.2.1.Final) Updates `io.netty:netty-handler` from 4.2.0.Final to 4.2.1.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.0.Final...netty-4.2.1.Final) Updates `io.netty:netty-transport-native-epoll` from 4.2.0.Final to 4.2.1.Final - [Commits](https://github.com/netty/netty/compare/netty-4.2.0.Final...netty-4.2.1.Final) --- updated-dependencies: - dependency-name: io.netty:netty-transport dependency-version: 4.2.1.Final dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-codec dependency-version: 4.2.1.Final dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-handler dependency-version: 4.2.1.Final dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.netty:netty-transport-native-epoll dependency-version: 4.2.1.Final dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 274b44d75f..ebc8fa1fda 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.2.0.Final + 4.2.1.Final 0.34.1 4.2.30 1.14.6 From b2a2718bc580ec3e4798302b25c3da1ed1c7ad48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 16:03:45 +0000 Subject: [PATCH 441/449] Bump com.google.googlejavaformat:google-java-format Bumps [com.google.googlejavaformat:google-java-format](https://github.com/google/google-java-format) from 1.26.0 to 1.27.0. - [Release notes](https://github.com/google/google-java-format/releases) - [Commits](https://github.com/google/google-java-format/compare/v1.26.0...v1.27.0) --- updated-dependencies: - dependency-name: com.google.googlejavaformat:google-java-format dependency-version: 1.27.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 274b44d75f..ce9052892a 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ 3.2.1 1.37 2.44.4 - 1.26.0 + 1.27.0 0.8.13 4.9.3.0 4.9.3 From 2a02f06754416945e5e936dfa57baa7a2ee9044d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Mon, 12 May 2025 09:03:35 +0200 Subject: [PATCH 442/449] Back to Netty 4.2.0 Experiencing unexpected disconnections in some tests. --- pom.xml | 2 +- .../stream/impl/StreamProducerTest.java | 63 +++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4c8ac0194a..ce9052892a 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.2.1.Final + 4.2.0.Final 0.34.1 4.2.30 1.14.6 diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java index 63254247ad..bff57ad269 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java @@ -41,6 +41,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -57,6 +58,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import wiremock.org.checkerframework.checker.units.qual.A; @ExtendWith(TestUtils.StreamTestInfrastructureExtension.class) public class StreamProducerTest { @@ -88,6 +90,67 @@ void tearDown() { environment.close(); } + private static AtomicLong rate() { + AtomicLong count = new AtomicLong(); + AtomicLong tick = new AtomicLong(System.nanoTime()); + + Executors.newSingleThreadScheduledExecutor() + .scheduleAtFixedRate( + () -> { + long now = System.nanoTime(); + long before = tick.getAndSet(now); + long elapsed = now - before; + long sent = count.getAndSet(0); + System.out.println("Rate " + (sent * 1_000_000_000L / elapsed) + " msg/s"); + }, + 1, + 1, + TimeUnit.SECONDS); + return count; + } + + @Test + void test() { + AtomicLong count = rate(); + Producer producer = environment.producerBuilder().stream(stream) + .maxUnconfirmedMessages(10) + .build(); + + while(true) { + producer.send(producer.messageBuilder().build(), s -> { }); + count.incrementAndGet(); + } + + } + + @Test + void client() throws Exception { + int permits = 10; + Semaphore semaphore = new Semaphore(permits); + Client client = cf.get(new Client.ClientParameters().publishConfirmListener(new Client.PublishConfirmListener() { + @Override + public void handle(byte publisherId, long publishingId) { + semaphore.release(); + } + })); + + byte pubId = (byte) 0; + client.declarePublisher(pubId, null, stream); + + AtomicLong count = rate(); + + List messages = IntStream.range(0, permits).mapToObj(ignored -> client + .messageBuilder() + .addData("hello".getBytes(StandardCharsets.UTF_8)) + .build()).collect(Collectors.toList()); + while (true) { + semaphore.acquire(permits); + client.publish(pubId, messages); + count.addAndGet(permits); + } + + } + @Test void send() throws Exception { int batchSize = 10; From 65cb76d93c54f9dcc22ef4a45e8a590c5b196e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Mon, 12 May 2025 10:15:47 +0200 Subject: [PATCH 443/449] Revert "Back to Netty 4.2.0" This reverts commit 2a02f06754416945e5e936dfa57baa7a2ee9044d. --- pom.xml | 2 +- .../stream/impl/StreamProducerTest.java | 63 ------------------- 2 files changed, 1 insertion(+), 64 deletions(-) diff --git a/pom.xml b/pom.xml index ce9052892a..4c8ac0194a 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.2.0.Final + 4.2.1.Final 0.34.1 4.2.30 1.14.6 diff --git a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java index bff57ad269..63254247ad 100644 --- a/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/StreamProducerTest.java @@ -41,7 +41,6 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; @@ -58,7 +57,6 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import wiremock.org.checkerframework.checker.units.qual.A; @ExtendWith(TestUtils.StreamTestInfrastructureExtension.class) public class StreamProducerTest { @@ -90,67 +88,6 @@ void tearDown() { environment.close(); } - private static AtomicLong rate() { - AtomicLong count = new AtomicLong(); - AtomicLong tick = new AtomicLong(System.nanoTime()); - - Executors.newSingleThreadScheduledExecutor() - .scheduleAtFixedRate( - () -> { - long now = System.nanoTime(); - long before = tick.getAndSet(now); - long elapsed = now - before; - long sent = count.getAndSet(0); - System.out.println("Rate " + (sent * 1_000_000_000L / elapsed) + " msg/s"); - }, - 1, - 1, - TimeUnit.SECONDS); - return count; - } - - @Test - void test() { - AtomicLong count = rate(); - Producer producer = environment.producerBuilder().stream(stream) - .maxUnconfirmedMessages(10) - .build(); - - while(true) { - producer.send(producer.messageBuilder().build(), s -> { }); - count.incrementAndGet(); - } - - } - - @Test - void client() throws Exception { - int permits = 10; - Semaphore semaphore = new Semaphore(permits); - Client client = cf.get(new Client.ClientParameters().publishConfirmListener(new Client.PublishConfirmListener() { - @Override - public void handle(byte publisherId, long publishingId) { - semaphore.release(); - } - })); - - byte pubId = (byte) 0; - client.declarePublisher(pubId, null, stream); - - AtomicLong count = rate(); - - List messages = IntStream.range(0, permits).mapToObj(ignored -> client - .messageBuilder() - .addData("hello".getBytes(StandardCharsets.UTF_8)) - .build()).collect(Collectors.toList()); - while (true) { - semaphore.acquire(permits); - client.publish(pubId, messages); - count.addAndGet(permits); - } - - } - @Test void send() throws Exception { int batchSize = 10; From 05df2a56da0e9d53d24170e2eb51779d75b96147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Mon, 12 May 2025 10:16:19 +0200 Subject: [PATCH 444/449] Back to Netty 4.2.0 Experiencing unexpected disconnections in some tests. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4c8ac0194a..ce9052892a 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ true 1.7.36 1.2.13 - 4.2.1.Final + 4.2.0.Final 0.34.1 4.2.30 1.14.6 From 8a198eeb45592726736e21580330ece1bfeb5586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Mon, 12 May 2025 14:54:47 +0200 Subject: [PATCH 445/449] Make dynamic batch pump more aggressively Low value for maxUnconfirmedMessages combined with unfortunate timing can make the dynamic batch flush only on timeout. This commit makes the dynamic batch class "pump" for new items (messages) more aggressively, which mitigates the problem. References #750 --- .../rabbitmq/stream/impl/DynamicBatch.java | 26 +++++++++----- .../stream/impl/DynamicBatchTest.java | 36 +++++++++++++++++++ 2 files changed, 53 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java index 7e2d1a7369..c6038dfed6 100644 --- a/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java +++ b/src/main/java/com/rabbitmq/stream/impl/DynamicBatch.java @@ -69,15 +69,7 @@ private void loop() { if (state.items.size() >= state.batchSize) { this.maybeCompleteBatch(state, true); } else { - item = this.requests.poll(); - if (item == null) { - this.maybeCompleteBatch(state, false); - } else { - state.items.add(item); - if (state.items.size() >= state.batchSize) { - this.maybeCompleteBatch(state, true); - } - } + pump(state, 2); } } else { this.maybeCompleteBatch(state, false); @@ -85,6 +77,22 @@ private void loop() { } } + private void pump(State state, int pumpCount) { + if (pumpCount <= 0) { + return; + } + T item = this.requests.poll(); + if (item == null) { + this.maybeCompleteBatch(state, false); + } else { + state.items.add(item); + if (state.items.size() >= state.batchSize) { + this.maybeCompleteBatch(state, true); + } + this.pump(state, pumpCount - 1); + } + } + private static final class State { int batchSize; diff --git a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java index dca9810762..50698320f8 100644 --- a/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java +++ b/src/test/java/com/rabbitmq/stream/impl/DynamicBatchTest.java @@ -23,8 +23,11 @@ import com.rabbitmq.stream.impl.TestUtils.Sync; import java.util.Locale; import java.util.Random; +import java.util.concurrent.Semaphore; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; import java.util.stream.IntStream; import org.junit.jupiter.api.Test; @@ -118,4 +121,37 @@ void failedProcessingIsReplayed() throws Exception { waitAtMost(() -> collected.get() == itemCount); } } + + @Test + void lowThrottlingValueShouldStillHighPublishingRate() throws Exception { + int batchSize = 10; + Semaphore semaphore = new Semaphore(batchSize); + DynamicBatch.BatchConsumer action = + items -> { + semaphore.release(items.size()); + return true; + }; + + try (DynamicBatch batch = new DynamicBatch<>(action, batchSize)) { + MetricRegistry metrics = new MetricRegistry(); + Meter rate = metrics.meter("publishing-rate"); + AtomicBoolean keepGoing = new AtomicBoolean(true); + AtomicLong sequence = new AtomicLong(); + new Thread( + () -> { + while (keepGoing.get() && !Thread.interrupted()) { + long id = sequence.getAndIncrement(); + if (semaphore.tryAcquire()) { + batch.add(id); + rate.mark(); + } + } + }) + .start(); + long start = System.nanoTime(); + waitAtMost( + () -> + System.nanoTime() - start > TimeUnit.SECONDS.toNanos(1) && rate.getMeanRate() > 1000); + } + } } From 196f917c7835a12ae543bed983d0f05540f632d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 16:14:01 +0000 Subject: [PATCH 446/449] Bump io.micrometer:micrometer-core from 1.14.6 to 1.14.7 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.14.6 to 1.14.7. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.14.6...v1.14.7) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-version: 1.14.7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ce9052892a..fe18f7409c 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.2.0.Final 0.34.1 4.2.30 - 1.14.6 + 1.14.7 13.1.2 4.7.5 1.27.1 From c610ef8e7ab25d8cf4b8d5b0c91f0a141e682dcc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 16:16:56 +0000 Subject: [PATCH 447/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.4.5 to 1.4.6. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.4.5...v1.4.6) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-version: 1.4.6 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ce9052892a..56447fb07f 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.13.1 0.10.6 1.2.5 - 1.4.5 + 1.4.6 1.0.4 3.14.0 3.5.3 From ea06465bdbdd5046e84ca24ba93f5c0f1189f853 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 16:20:26 +0000 Subject: [PATCH 448/449] Bump io.micrometer:micrometer-tracing-integration-test Bumps [io.micrometer:micrometer-tracing-integration-test](https://github.com/micrometer-metrics/tracing) from 1.4.6 to 1.5.0. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.4.6...v1.5.0) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-tracing-integration-test dependency-version: 1.5.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e880edfbbe..aab50b070e 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.13.1 0.10.6 1.2.5 - 1.4.6 + 1.5.0 1.0.4 3.14.0 3.5.3 From 447e63b664203596091264e44e62e7fdbfcb07a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 May 2025 16:20:41 +0000 Subject: [PATCH 449/449] Bump io.micrometer:micrometer-core from 1.14.7 to 1.15.0 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.14.7 to 1.15.0. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.14.7...v1.15.0) --- updated-dependencies: - dependency-name: io.micrometer:micrometer-core dependency-version: 1.15.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e880edfbbe..d2a12b8ac6 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 4.2.0.Final 0.34.1 4.2.30 - 1.14.7 + 1.15.0 13.1.2 4.7.5 1.27.1