From 5eecda8bde9bef29f99e7b71e6a4d9e8d9e2dfd7 Mon Sep 17 00:00:00 2001 From: pivotal-rabbitmq-ci Date: Mon, 5 Jul 2021 14:39:52 +0000 Subject: [PATCH 001/657] [maven-release-plugin] prepare release v5.13.0.RC2 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f9c92a513d..f80f9aae72 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.13.0-SNAPSHOT + 5.13.0.RC2 jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:git@github.com:rabbitmq/rabbitmq-java-client.git - HEAD + v5.13.0.RC2 From 790a5fe8dfc13172fe9f0530dce915ef5c8e8357 Mon Sep 17 00:00:00 2001 From: pivotal-rabbitmq-ci Date: Mon, 5 Jul 2021 14:39:57 +0000 Subject: [PATCH 002/657] [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 f80f9aae72..f9c92a513d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.13.0.RC2 + 5.13.0-SNAPSHOT jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:git@github.com:rabbitmq/rabbitmq-java-client.git - v5.13.0.RC2 + HEAD From f5828f7b2fc70c35c89a6506ab935d9130fc71f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 5 Jul 2021 16:42:07 +0200 Subject: [PATCH 003/657] Set release version to 5.13.0.RC3 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index b350937ea3..b68df111be 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.13.0.RC2" +RELEASE_VERSION="5.13.0.RC3" DEVELOPMENT_VERSION="5.13.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From d46ff7db9291bd8f0be1498187f02892c7ac06ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 12 Jul 2021 14:23:42 +0200 Subject: [PATCH 004/657] Set release version to 5.13.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index b68df111be..717cff2f97 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.13.0.RC3" -DEVELOPMENT_VERSION="5.13.0-SNAPSHOT" +RELEASE_VERSION="5.13.0" +DEVELOPMENT_VERSION="5.14.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From 62c993f4af13e0cb7904e66695e333bd2433d1f2 Mon Sep 17 00:00:00 2001 From: pivotal-rabbitmq-ci Date: Mon, 12 Jul 2021 12:34:06 +0000 Subject: [PATCH 005/657] [maven-release-plugin] prepare release v5.13.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f9c92a513d..f00ac47285 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.13.0-SNAPSHOT + 5.13.0 jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:git@github.com:rabbitmq/rabbitmq-java-client.git - HEAD + v5.13.0 From 51b5abe1e1cd586576eedccdfa21176976167487 Mon Sep 17 00:00:00 2001 From: pivotal-rabbitmq-ci Date: Mon, 12 Jul 2021 12:34:11 +0000 Subject: [PATCH 006/657] [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 f00ac47285..10cde42178 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.13.0 + 5.14.0-SNAPSHOT jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:git@github.com:rabbitmq/rabbitmq-java-client.git - v5.13.0 + HEAD From c26edc05a01d4550c725ee2a20df8e55b5f1cb55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 12 Jul 2021 14:47:27 +0200 Subject: [PATCH 007/657] Set release version to 5.14.0.RC1 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index 717cff2f97..19d9bee27b 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.13.0" +RELEASE_VERSION="5.14.0.RC1" DEVELOPMENT_VERSION="5.14.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From 9131c7811c11408cc5493d1773e0d86f15faae04 Mon Sep 17 00:00:00 2001 From: madun Date: Tue, 6 Jul 2021 20:34:12 +0800 Subject: [PATCH 008/657] =?UTF-8?q?style:=201=E3=80=81format=20two=20line?= =?UTF-8?q?=20align=202=E3=80=81add=20channelMax=20<=200=20condition,=20fr?= =?UTF-8?q?iendly=20tips?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit c80afcfb2f88fa6989ca2c3470fe1af62acbb938) --- .../java/com/rabbitmq/client/impl/ChannelManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelManager.java b/src/main/java/com/rabbitmq/client/impl/ChannelManager.java index 59f7bb3fee..0264adeb92 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelManager.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelManager.java @@ -39,9 +39,9 @@ public class ChannelManager { /** Monitor for _channelMap and channelNumberAllocator */ private final Object monitor = new Object(); - /** Mapping from 1.._channelMax to {@link ChannelN} instance */ - private final Map _channelMap = new HashMap(); - private final IntAllocator channelNumberAllocator; + /** Mapping from 1.._channelMax to {@link ChannelN} instance */ + private final Map _channelMap = new HashMap(); + private final IntAllocator channelNumberAllocator; private final ConsumerWorkService workService; @@ -70,6 +70,8 @@ public ChannelManager(ConsumerWorkService workService, int channelMax, ThreadFac public ChannelManager(ConsumerWorkService workService, int channelMax, ThreadFactory threadFactory, MetricsCollector metricsCollector) { + if (channelMax < 0) + throw new IllegalStateException("create ChannelManager: 'channelMax' must be greater or equal to 0."); if (channelMax == 0) { // The framing encoding only allows for unsigned 16-bit integers // for the channel number From f52324aa06d64bc7ceed640724f268703a6c760e Mon Sep 17 00:00:00 2001 From: madun Date: Thu, 8 Jul 2021 09:15:21 +0800 Subject: [PATCH 009/657] =?UTF-8?q?style:=201=E3=80=81modify=20IllegalStat?= =?UTF-8?q?eException=20to=20IllegalArgumentException?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 0a4f08bddf61efbe0625d95e03eedf00b17d6b39) --- src/main/java/com/rabbitmq/client/impl/ChannelManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelManager.java b/src/main/java/com/rabbitmq/client/impl/ChannelManager.java index 0264adeb92..fb0490eade 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelManager.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelManager.java @@ -71,7 +71,7 @@ public ChannelManager(ConsumerWorkService workService, int channelMax, ThreadFac public ChannelManager(ConsumerWorkService workService, int channelMax, ThreadFactory threadFactory, MetricsCollector metricsCollector) { if (channelMax < 0) - throw new IllegalStateException("create ChannelManager: 'channelMax' must be greater or equal to 0."); + throw new IllegalArgumentException("create ChannelManager: 'channelMax' must be greater or equal to 0."); if (channelMax == 0) { // The framing encoding only allows for unsigned 16-bit integers // for the channel number From 5b6e4d3435fb27774a73ed7b16a90add5f1e355f Mon Sep 17 00:00:00 2001 From: madun Date: Fri, 9 Jul 2021 16:47:42 +0800 Subject: [PATCH 010/657] =?UTF-8?q?refactor:=201=E3=80=81optimize=20class?= =?UTF-8?q?=20code=20structure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 430412d3c6439d4745adf1ae5617153ccaaf7d73) --- .../com/rabbitmq/client/impl/recovery/RecordedEntity.java | 2 +- .../com/rabbitmq/client/impl/recovery/RecordedExchange.java | 1 + .../rabbitmq/client/impl/recovery/RecordedNamedEntity.java | 5 ++++- .../com/rabbitmq/client/impl/recovery/RecordedQueue.java | 5 +++-- .../rabbitmq/client/impl/recovery/RecordedQueueBinding.java | 2 +- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedEntity.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedEntity.java index a9fae4c3ae..a56f58b88a 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedEntity.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedEntity.java @@ -20,7 +20,7 @@ /** * @since 3.3.0 */ -public class RecordedEntity { +public abstract class RecordedEntity { protected final AutorecoveringChannel channel; public RecordedEntity(AutorecoveringChannel channel) { diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedExchange.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedExchange.java index 7625b5a870..aaedcbbf58 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedExchange.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedExchange.java @@ -31,6 +31,7 @@ public RecordedExchange(AutorecoveringChannel channel, String name) { super(channel, name); } + @Override public void recover() throws IOException { this.channel.getDelegate().exchangeDeclare(this.name, this.type, this.durable, this.autoDelete, this.arguments); } diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedNamedEntity.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedNamedEntity.java index 6ea8b6fa96..7b5a86a8f9 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedNamedEntity.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedNamedEntity.java @@ -15,10 +15,11 @@ package com.rabbitmq.client.impl.recovery; +import java.io.IOException; /** * @since 3.3.0 */ -public class RecordedNamedEntity extends RecordedEntity { +public abstract class RecordedNamedEntity extends RecordedEntity { protected String name; public RecordedNamedEntity(AutorecoveringChannel channel, String name) { @@ -26,6 +27,8 @@ public RecordedNamedEntity(AutorecoveringChannel channel, String name) { this.name = name; } + public abstract void recover() throws IOException; + public String getName() { return name; } diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueue.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueue.java index 52caced2af..b41ecdc302 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueue.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueue.java @@ -55,6 +55,7 @@ public boolean isServerNamed() { return this.serverNamed; } + @Override public void recover() throws IOException { this.name = this.channel.getDelegate().queueDeclare(this.getNameToUseForRecovery(), this.durable, @@ -71,7 +72,7 @@ public RecordedQueue durable(boolean value) { this.durable = value; return this; } - + public boolean isDurable() { return this.durable; } @@ -80,7 +81,7 @@ public RecordedQueue autoDelete(boolean value) { this.autoDelete = value; return this; } - + public boolean isAutoDelete() { return this.autoDelete; } diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueueBinding.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueueBinding.java index 12ed3d48bb..37bbb14fe5 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueueBinding.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueueBinding.java @@ -27,7 +27,7 @@ public RecordedQueueBinding(AutorecoveringChannel channel) { @Override public void recover() throws IOException { - this.channel.getDelegate().queueBind(this.getDestination(), this.getSource(), this.routingKey, this.arguments); + this.channel.getDelegate().queueBind(this.destination, this.source, this.routingKey, this.arguments); } @Override From 267c3553475f5284ec5ead6c34ae27893d3e819f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 26 Jul 2021 14:17:20 +0200 Subject: [PATCH 011/657] Disable global QoS temporarily Because of a regression in 3.9.x. References rabbitmq/rabbitmq-server#3230 (cherry picked from commit 559c4cb3e9803b2144e7900c13d26a0250da66cf) --- .../com/rabbitmq/client/test/functional/QosTests.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/test/java/com/rabbitmq/client/test/functional/QosTests.java b/src/test/java/com/rabbitmq/client/test/functional/QosTests.java index 276a363f4e..b347382f0d 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/QosTests.java +++ b/src/test/java/com/rabbitmq/client/test/functional/QosTests.java @@ -31,6 +31,7 @@ import java.util.Map; import java.util.concurrent.TimeoutException; +import org.junit.Ignore; import org.junit.Test; import com.rabbitmq.client.AMQP; @@ -119,6 +120,7 @@ public static List drain(QueueingConsumer c, int n) drain(c, 2); } + @Ignore @Test public void noAckObeysLimit() throws IOException { @@ -142,6 +144,7 @@ public static List drain(QueueingConsumer c, int n) drain(c2, 1); } + @Ignore @Test public void permutations() throws IOException { @@ -159,6 +162,7 @@ public static List drain(QueueingConsumer c, int n) } } + @Ignore @Test public void fairness() throws IOException { @@ -188,6 +192,7 @@ public static List drain(QueueingConsumer c, int n) } + @Ignore @Test public void singleChannelAndQueueFairness() throws IOException { @@ -237,6 +242,7 @@ public static List drain(QueueingConsumer c, int n) assertTrue(counts.get("c2").intValue() > 0); } + @Ignore @Test public void consumerLifecycle() throws IOException { @@ -258,6 +264,7 @@ public static List drain(QueueingConsumer c, int n) channel.queueDelete(queue); } + @Ignore @Test public void setLimitAfterConsume() throws IOException { @@ -282,6 +289,7 @@ public static List drain(QueueingConsumer c, int n) drain(c, 1); } + @Ignore @Test public void limitDecrease() throws IOException { @@ -302,6 +310,7 @@ public static List drain(QueueingConsumer c, int n) drain(c, 2); } + @Ignore @Test public void limitingMultipleChannels() throws IOException { @@ -338,6 +347,7 @@ public static List drain(QueueingConsumer c, int n) drain(c, 1); } + @Ignore @Test public void recoverReducesLimit() throws Exception { channel.basicQos(2, true); QueueingConsumer c = new QueueingConsumer(channel); From 73454cdbedc60b25788c4f61166b3859105afad5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 28 Jul 2021 09:46:16 +0200 Subject: [PATCH 012/657] Bump dependencies References #699 (cherry picked from commit 5653e1cac355fee3cc6c8e1ce3bc82197b5ab7cb) --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 10cde42178..b04e0943d1 100644 --- a/pom.xml +++ b/pom.xml @@ -54,10 +54,10 @@ UTF-8 UTF-8 - 1.7.31 - 4.2.2 - 1.7.1 - 2.12.3 + 1.7.32 + 4.2.3 + 1.7.2 + 2.12.4 1.2.3 4.13.2 3.11.2 From 1e5e40273e3e0fb43d44981a7a952b9f564c1046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 28 Jul 2021 09:46:56 +0200 Subject: [PATCH 013/657] Bump test dependencies (cherry picked from commit 281b679d3f076b9d2adbb8c8eeb983958eb1e3f4) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b04e0943d1..c290b479c3 100644 --- a/pom.xml +++ b/pom.xml @@ -58,11 +58,11 @@ 4.2.3 1.7.2 2.12.4 - 1.2.3 + 1.2.5 4.13.2 3.11.2 3.20.2 - 9.4.42.v20210604 + 9.4.43.v20210629 1.69 3.2.0 From 326e142eb6e89d4c0e5b94322d2aed81e4357659 Mon Sep 17 00:00:00 2001 From: yandryakov Date: Thu, 29 Jul 2021 16:07:02 +0300 Subject: [PATCH 014/657] support underflow handling without thread sleep (cherry picked from commit ba696986acad8aaee7365aa56e90ccef08bce4bc) --- .../nio/SocketChannelFrameHandlerState.java | 24 ++++++++++++++--- .../impl/nio/SslEngineFrameBuilder.java | 27 ++++++++++++------- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java index 50f08a59f2..87c1d08928 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java @@ -26,6 +26,8 @@ import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; +import java.util.concurrent.atomic.AtomicBoolean; + /** * @@ -70,6 +72,8 @@ public class SocketChannelFrameHandlerState { final FrameBuilder frameBuilder; + private final AtomicBoolean isUnderflowHandlingEnabled = new AtomicBoolean(false); + public SocketChannelFrameHandlerState(SocketChannel channel, NioLoopContext nioLoopsState, NioParams nioParams, SSLEngine sslEngine) { this.channel = channel; this.readSelectorState = nioLoopsState.readSelectorState; @@ -105,7 +109,7 @@ public SocketChannelFrameHandlerState(SocketChannel channel, NioLoopContext nioL this.outputStream = new DataOutputStream( new SslEngineByteBufferOutputStream(sslEngine, plainOut, cipherOut, channel) ); - this.frameBuilder = new SslEngineFrameBuilder(sslEngine, plainIn, cipherIn, channel); + this.frameBuilder = new SslEngineFrameBuilder(sslEngine, plainIn, cipherIn, channel, isUnderflowHandlingEnabled); } } @@ -176,11 +180,14 @@ void endWriteSequence() { void prepareForReadSequence() throws IOException { if(ssl) { - cipherIn.clear(); - plainIn.clear(); + if (!isUnderflowHandlingEnabled.get()) { + cipherIn.clear(); + cipherIn.flip(); + } - cipherIn.flip(); + plainIn.clear(); plainIn.flip(); + } else { NioHelper.read(channel, plainIn); plainIn.flip(); @@ -189,6 +196,15 @@ void prepareForReadSequence() throws IOException { boolean continueReading() throws IOException { if(ssl) { + if (isUnderflowHandlingEnabled.get()) { + int bytesRead = NioHelper.read(channel, cipherIn); + if (bytesRead == 0) { + return false; + } else { + cipherIn.flip(); + return true; + } + } if (!plainIn.hasRemaining() && !cipherIn.hasRemaining()) { // need to try to read something cipherIn.clear(); diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java index c2f1923874..34295fb36a 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java @@ -21,6 +21,8 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.ReadableByteChannel; +import java.util.concurrent.atomic.AtomicBoolean; + /** * Sub-class of {@link FrameBuilder} that unwraps crypted data from the network. @@ -32,20 +34,25 @@ public class SslEngineFrameBuilder extends FrameBuilder { private final ByteBuffer cipherBuffer; - public SslEngineFrameBuilder(SSLEngine sslEngine, ByteBuffer plainIn, ByteBuffer cipherIn, ReadableByteChannel channel) { + private final AtomicBoolean isUnderflowHandlingEnabled; + + public SslEngineFrameBuilder(SSLEngine sslEngine, ByteBuffer plainIn, ByteBuffer cipherIn, ReadableByteChannel channel, final AtomicBoolean isUnderflowHandlingEnabled) { super(channel, plainIn); this.sslEngine = sslEngine; this.cipherBuffer = cipherIn; + this.isUnderflowHandlingEnabled = isUnderflowHandlingEnabled; } @Override protected boolean somethingToRead() throws IOException { - if (applicationBuffer.hasRemaining()) { + if (applicationBuffer.hasRemaining() && !isUnderflowHandlingEnabled.get()) { return true; } else { applicationBuffer.clear(); - while (true) { + boolean underflowHandling = false; + + try { SSLEngineResult result = sslEngine.unwrap(cipherBuffer, applicationBuffer); switch (result.getStatus()) { case OK: @@ -59,18 +66,18 @@ protected boolean somethingToRead() throws IOException { throw new SSLException("buffer overflow in read"); case BUFFER_UNDERFLOW: cipherBuffer.compact(); - int read = NioHelper.read(channel, cipherBuffer); - if (read == 0) { - return false; - } - cipherBuffer.flip(); - break; + underflowHandling = true; + return false; case CLOSED: throw new SSLException("closed in read"); default: throw new IllegalStateException("Invalid SSL status: " + result.getStatus()); - } + } + } finally { + isUnderflowHandlingEnabled.set(underflowHandling); } + + return false; } } From c3d9e7532d8f2040ee71afc06a5e11c244988dae Mon Sep 17 00:00:00 2001 From: yandryakov Date: Thu, 29 Jul 2021 18:34:47 +0300 Subject: [PATCH 015/657] refactoring - make isUnderflowHandlingEnabled private property (cherry picked from commit 217a5e8c2a8e42748b6a33dadae9443ea7f7119a) --- .../com/rabbitmq/client/impl/nio/FrameBuilder.java | 5 +++++ .../impl/nio/SocketChannelFrameHandlerState.java | 9 +++------ .../client/impl/nio/SslEngineFrameBuilder.java | 14 ++++++++------ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java b/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java index 8352174360..813e328b9e 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java @@ -200,4 +200,9 @@ private void handleProtocolVersionMismatch() throws IOException { } throw x; } + + //Indicates ssl underflow state - means that cipherBuffer should aggregate next chunks of bytes + public boolean isUnderflowHandlingEnabled() { + return false; + } } diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java index 87c1d08928..4f1e4dc885 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java @@ -26,7 +26,6 @@ import java.nio.ByteBuffer; import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; -import java.util.concurrent.atomic.AtomicBoolean; /** @@ -72,8 +71,6 @@ public class SocketChannelFrameHandlerState { final FrameBuilder frameBuilder; - private final AtomicBoolean isUnderflowHandlingEnabled = new AtomicBoolean(false); - public SocketChannelFrameHandlerState(SocketChannel channel, NioLoopContext nioLoopsState, NioParams nioParams, SSLEngine sslEngine) { this.channel = channel; this.readSelectorState = nioLoopsState.readSelectorState; @@ -109,7 +106,7 @@ public SocketChannelFrameHandlerState(SocketChannel channel, NioLoopContext nioL this.outputStream = new DataOutputStream( new SslEngineByteBufferOutputStream(sslEngine, plainOut, cipherOut, channel) ); - this.frameBuilder = new SslEngineFrameBuilder(sslEngine, plainIn, cipherIn, channel, isUnderflowHandlingEnabled); + this.frameBuilder = new SslEngineFrameBuilder(sslEngine, plainIn, cipherIn, channel); } } @@ -180,7 +177,7 @@ void endWriteSequence() { void prepareForReadSequence() throws IOException { if(ssl) { - if (!isUnderflowHandlingEnabled.get()) { + if (!frameBuilder.isUnderflowHandlingEnabled()) { cipherIn.clear(); cipherIn.flip(); } @@ -196,7 +193,7 @@ void prepareForReadSequence() throws IOException { boolean continueReading() throws IOException { if(ssl) { - if (isUnderflowHandlingEnabled.get()) { + if (frameBuilder.isUnderflowHandlingEnabled()) { int bytesRead = NioHelper.read(channel, cipherIn); if (bytesRead == 0) { return false; diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java index 34295fb36a..8b6ecaf8ab 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java @@ -21,7 +21,6 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.ReadableByteChannel; -import java.util.concurrent.atomic.AtomicBoolean; /** @@ -34,18 +33,17 @@ public class SslEngineFrameBuilder extends FrameBuilder { private final ByteBuffer cipherBuffer; - private final AtomicBoolean isUnderflowHandlingEnabled; + private boolean isUnderflowHandlingEnabled = false; - public SslEngineFrameBuilder(SSLEngine sslEngine, ByteBuffer plainIn, ByteBuffer cipherIn, ReadableByteChannel channel, final AtomicBoolean isUnderflowHandlingEnabled) { + public SslEngineFrameBuilder(SSLEngine sslEngine, ByteBuffer plainIn, ByteBuffer cipherIn, ReadableByteChannel channel) { super(channel, plainIn); this.sslEngine = sslEngine; this.cipherBuffer = cipherIn; - this.isUnderflowHandlingEnabled = isUnderflowHandlingEnabled; } @Override protected boolean somethingToRead() throws IOException { - if (applicationBuffer.hasRemaining() && !isUnderflowHandlingEnabled.get()) { + if (applicationBuffer.hasRemaining() && !isUnderflowHandlingEnabled) { return true; } else { applicationBuffer.clear(); @@ -74,11 +72,15 @@ protected boolean somethingToRead() throws IOException { throw new IllegalStateException("Invalid SSL status: " + result.getStatus()); } } finally { - isUnderflowHandlingEnabled.set(underflowHandling); + isUnderflowHandlingEnabled = underflowHandling; } return false; } } + @Override + public boolean isUnderflowHandlingEnabled() { + return isUnderflowHandlingEnabled; + } } From 6d4c9f4b8ab9f8219b4938de8740145526f4a988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 30 Jul 2021 17:39:41 +0200 Subject: [PATCH 016/657] Re-enable QoS tests Now fix is in master and 3.9.x. (cherry picked from commit 12f9f75bdf973ed74082df5a0fc5d664610c1595) --- .../com/rabbitmq/client/test/functional/QosTests.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/test/functional/QosTests.java b/src/test/java/com/rabbitmq/client/test/functional/QosTests.java index b347382f0d..276a363f4e 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/QosTests.java +++ b/src/test/java/com/rabbitmq/client/test/functional/QosTests.java @@ -31,7 +31,6 @@ import java.util.Map; import java.util.concurrent.TimeoutException; -import org.junit.Ignore; import org.junit.Test; import com.rabbitmq.client.AMQP; @@ -120,7 +119,6 @@ public static List drain(QueueingConsumer c, int n) drain(c, 2); } - @Ignore @Test public void noAckObeysLimit() throws IOException { @@ -144,7 +142,6 @@ public static List drain(QueueingConsumer c, int n) drain(c2, 1); } - @Ignore @Test public void permutations() throws IOException { @@ -162,7 +159,6 @@ public static List drain(QueueingConsumer c, int n) } } - @Ignore @Test public void fairness() throws IOException { @@ -192,7 +188,6 @@ public static List drain(QueueingConsumer c, int n) } - @Ignore @Test public void singleChannelAndQueueFairness() throws IOException { @@ -242,7 +237,6 @@ public static List drain(QueueingConsumer c, int n) assertTrue(counts.get("c2").intValue() > 0); } - @Ignore @Test public void consumerLifecycle() throws IOException { @@ -264,7 +258,6 @@ public static List drain(QueueingConsumer c, int n) channel.queueDelete(queue); } - @Ignore @Test public void setLimitAfterConsume() throws IOException { @@ -289,7 +282,6 @@ public static List drain(QueueingConsumer c, int n) drain(c, 1); } - @Ignore @Test public void limitDecrease() throws IOException { @@ -310,7 +302,6 @@ public static List drain(QueueingConsumer c, int n) drain(c, 2); } - @Ignore @Test public void limitingMultipleChannels() throws IOException { @@ -347,7 +338,6 @@ public static List drain(QueueingConsumer c, int n) drain(c, 1); } - @Ignore @Test public void recoverReducesLimit() throws Exception { channel.basicQos(2, true); QueueingConsumer c = new QueueingConsumer(channel); From 34ccee73d2e208e997ff69f2a04e7a752a36fce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 30 Aug 2021 10:51:44 +0200 Subject: [PATCH 017/657] Bump dependencies References #699 (cherry picked from commit 2e098ffa521f29236a9c0ac3152bd534a9081bd2) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index c290b479c3..40f2fced6f 100644 --- a/pom.xml +++ b/pom.xml @@ -56,8 +56,8 @@ 1.7.32 4.2.3 - 1.7.2 - 2.12.4 + 1.7.3 + 2.12.5 1.2.5 4.13.2 3.11.2 From 653d08b801c0dae5844709bf5adcf9d15371e320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 30 Aug 2021 10:52:51 +0200 Subject: [PATCH 018/657] Bump test dependencies (cherry picked from commit 1a11d9fef88e14776554839142b07454903e9a05) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 40f2fced6f..9e611a7a91 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 2.12.5 1.2.5 4.13.2 - 3.11.2 + 3.12.4 3.20.2 9.4.43.v20210629 1.69 From 613927e0bf0da3c6624c7b3b7b799ec19f91545e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 28 Sep 2021 16:53:59 +0200 Subject: [PATCH 019/657] Bump Micrometer to 1.7.4 References #699 (cherry picked from commit c879d7a0404e49242623f101a1e861400602df9b) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9e611a7a91..37174092df 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.7.32 4.2.3 - 1.7.3 + 1.7.4 2.12.5 1.2.5 4.13.2 From a43612fdd83d964165f22cefb6aa250e6f3de4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 28 Sep 2021 16:54:54 +0200 Subject: [PATCH 020/657] Bump test dependencies (cherry picked from commit 2da7a4acbf9a80b7e0e00e167a9992713f8bb88d) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 37174092df..09ee9df890 100644 --- a/pom.xml +++ b/pom.xml @@ -58,10 +58,10 @@ 4.2.3 1.7.4 2.12.5 - 1.2.5 + 1.2.6 4.13.2 3.12.4 - 3.20.2 + 3.21.0 9.4.43.v20210629 1.69 From 4fd4ec9ababf5367b97cc0f8ddff9a8af2f50129 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 4 Oct 2021 09:20:51 +0200 Subject: [PATCH 021/657] Bump Maven to 3.8.3 (cherry picked from commit e01c208d21318371e755b91a072f47fb12981de2) --- .mvn/wrapper/maven-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 642d572ce9..a9f1ef87bb 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -1,2 +1,2 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.3/apache-maven-3.8.3-bin.zip wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar From b123de5143c277b26b3e49904b89e1666dcfa2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 5 Oct 2021 14:45:46 +0200 Subject: [PATCH 022/657] Bump optional dependencies References #699 (cherry picked from commit 54fa481d31a552a05b60791347c973784b4a7ec9) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 09ee9df890..ea211df5c4 100644 --- a/pom.xml +++ b/pom.xml @@ -55,9 +55,9 @@ UTF-8 1.7.32 - 4.2.3 + 4.2.4 1.7.4 - 2.12.5 + 2.13.0 1.2.6 4.13.2 3.12.4 From aa3bf23a3d7de4abe6a5f7176f3009d7264e537c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 5 Oct 2021 14:46:10 +0200 Subject: [PATCH 023/657] Bump test dependency (cherry picked from commit 3e5e2789baf8c9172a48474fdfd712cde9c2128f) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ea211df5c4..7959c57ff6 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 4.13.2 3.12.4 3.21.0 - 9.4.43.v20210629 + 9.4.44.v20210927 1.69 3.2.0 From 7d9565b4158209426299fd1acb63fe5516cc55c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 21 Oct 2021 09:30:52 +0200 Subject: [PATCH 024/657] Bump Micrometer to 1.7.5 References #699 (cherry picked from commit 4de6eb709330644e7707b3e0a9652b5f09c16c70) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7959c57ff6..de16922b29 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.7.32 4.2.4 - 1.7.4 + 1.7.5 2.13.0 1.2.6 4.13.2 From 2def01691f5593dcb5bf1e119b3c6e4f0bac29c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 21 Oct 2021 09:31:43 +0200 Subject: [PATCH 025/657] Bump Mockito to 4.0.0 (cherry picked from commit 15068a4d569e67a66cac7534270fe8e97761f741) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index de16922b29..721405e4a5 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 2.13.0 1.2.6 4.13.2 - 3.12.4 + 4.0.0 3.21.0 9.4.44.v20210927 1.69 From d3e957f79291d2ff8123a7d942e38501580344ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 25 Oct 2021 10:01:04 +0200 Subject: [PATCH 026/657] Fix dead lettering flaky test It was using Thread.sleep() statements, which are not reliable, using polling for assertion instead. (cherry picked from commit ea8aa89fafbb96260a31b63898d93128ed23adea) --- .../com/rabbitmq/client/test/TestUtils.java | 25 +++++++++--- .../test/functional/DeadLetterExchange.java | 39 +++++++++++++++---- 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/test/TestUtils.java b/src/test/java/com/rabbitmq/client/test/TestUtils.java index e16bca6f40..72e0b56cea 100644 --- a/src/test/java/com/rabbitmq/client/test/TestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/TestUtils.java @@ -56,9 +56,20 @@ public static ConnectionFactory connectionFactory() { return connectionFactory; } - public static void waitAtMost(Duration timeout, BooleanSupplier condition) { - if (condition.getAsBoolean()) { - return; + @FunctionalInterface + public interface CallableBooleanSupplier { + + boolean getAsBoolean() throws Exception; + + } + + public static void waitAtMost(Duration timeout, CallableBooleanSupplier condition) { + try { + if (condition.getAsBoolean()) { + return; + } + } catch (Exception e) { + throw new RuntimeException(e); } int waitTime = 100; int waitedTime = 0; @@ -70,8 +81,12 @@ public static void waitAtMost(Duration timeout, BooleanSupplier condition) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } - if (condition.getAsBoolean()) { - return; + try { + if (condition.getAsBoolean()) { + return; + } + } catch (Exception e) { + throw new RuntimeException(e); } waitedTime += waitTime; } diff --git a/src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java b/src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java index 36c09add6a..d7244c7845 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java +++ b/src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java @@ -19,12 +19,15 @@ import com.rabbitmq.client.AMQP.BasicProperties; import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; +import java.util.concurrent.atomic.AtomicReference; import org.junit.Test; import java.io.IOException; import java.util.*; import java.util.concurrent.*; +import static com.rabbitmq.client.test.TestUtils.waitAtMost; +import static java.time.Duration.ofSeconds; import static org.junit.Assert.*; public class DeadLetterExchange extends BrokerTestCase { @@ -403,9 +406,15 @@ public void handleDelivery(String consumerTag, Envelope envelope, channel.queueBind(DLQ, DLX, "test"); publishN(1); - sleep(200); - - GetResponse getResponse = channel.basicGet(DLQ, true); + AtomicReference responseRefeference = new AtomicReference<>(); + waitAtMost( + ofSeconds(1), + () -> { + GetResponse response = channel.basicGet(DLQ, true); + responseRefeference.set(response); + return responseRefeference.get() != null; + }); + GetResponse getResponse = responseRefeference.get(); assertNotNull("Message not dead-lettered", getResponse); assertEquals("test message", new String(getResponse.getBody())); @@ -432,9 +441,15 @@ public void handleDelivery(String consumerTag, Envelope envelope, .headers(headers) .build(), "test message".getBytes()); - sleep(100); - - getResponse = channel.basicGet(DLQ, true); + responseRefeference.set(null); + waitAtMost( + ofSeconds(1), + () -> { + GetResponse response = channel.basicGet(DLQ, true); + responseRefeference.set(response); + return responseRefeference.get() != null; + }); + getResponse = responseRefeference.get(); assertNotNull("Message not dead-lettered", getResponse); assertEquals("test message", new String(getResponse.getBody())); headers = getResponse.getProps().getHeaders(); @@ -453,9 +468,17 @@ public void handleDelivery(String consumerTag, Envelope envelope, new AMQP.BasicProperties.Builder() .headers(headers) .build(), "test message".getBytes()); - sleep(100); - getResponse = channel.basicGet(DLQ, true); + responseRefeference.set(null); + waitAtMost( + ofSeconds(1), + () -> { + GetResponse response = channel.basicGet(DLQ, true); + responseRefeference.set(response); + return responseRefeference.get() != null; + }); + getResponse = responseRefeference.get(); + assertNotNull("Message not dead-lettered", getResponse); assertEquals("test message", new String(getResponse.getBody())); headers = getResponse.getProps().getHeaders(); From ecbe8501f2dd1923bb8e88b5b126a44e75633872 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 25 Oct 2021 11:02:31 +0200 Subject: [PATCH 027/657] Fix test rule (cherry picked from commit 761628ee1ea4f1a90942110d22bb4407ab861549) --- src/test/java/com/rabbitmq/client/test/TestUtils.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/java/com/rabbitmq/client/test/TestUtils.java b/src/test/java/com/rabbitmq/client/test/TestUtils.java index 72e0b56cea..7544893760 100644 --- a/src/test/java/com/rabbitmq/client/test/TestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/TestUtils.java @@ -343,6 +343,8 @@ public void evaluate() throws Throwable { if (Host.isOnDocker()) { throw new AssumptionViolatedException("Broker is running on Docker"); } + } catch (AssumptionViolatedException e) { + throw e; } catch (Exception e) { throw new AssumptionViolatedException("Could not check whether broker is running on Docker or not", e); } From 99ea9e07588ee147d38f0babe944e956f59a5a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 25 Oct 2021 11:21:44 +0200 Subject: [PATCH 028/657] Change/remove usage of some deprecated JDK API API deprecated in Java 16 or more. There are alternatives (e.g. for certificate subject and issuer) for some, but not for all (e.g. usage of the security manager to change thread, which is no big deal as the changes to thread are minor and it is likely nobody cares about such checks nowadays). Fixes #709 (cherry picked from commit 57b61d82dc441d3779547c918f179026d94b5d51) --- .../com/rabbitmq/client/impl/Environment.java | 29 +++++++++---------- .../com/rabbitmq/client/impl/TlsUtils.java | 2 +- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/Environment.java b/src/main/java/com/rabbitmq/client/impl/Environment.java index 149b9a102e..2676311322 100644 --- a/src/main/java/com/rabbitmq/client/impl/Environment.java +++ b/src/main/java/com/rabbitmq/client/impl/Environment.java @@ -23,32 +23,29 @@ * Package-protected API. */ public class Environment { + + /** + * This method is deprecated and subject to removal in the next major release. + * + * There is no replacement for this method, as it used to use the + * {@link SecurityManager}, which is itself deprecated and subject to removal. + * @deprecated + * @return always returns true + */ + @Deprecated public static boolean isAllowedToModifyThreads() { - try { - SecurityManager sm = System.getSecurityManager(); - if(sm != null) { - sm.checkPermission(new RuntimePermission("modifyThread")); - sm.checkPermission(new RuntimePermission("modifyThreadGroup")); - } - return true; - } catch (SecurityException se) { - return false; - } + return true; } public static Thread newThread(ThreadFactory factory, Runnable runnable, String name) { Thread t = factory.newThread(runnable); - if(isAllowedToModifyThreads()) { - t.setName(name); - } + t.setName(name); return t; } public static Thread newThread(ThreadFactory factory, Runnable runnable, String name, boolean isDaemon) { Thread t = newThread(factory, runnable, name); - if(isAllowedToModifyThreads()) { - t.setDaemon(isDaemon); - } + t.setDaemon(isDaemon); return t; } } diff --git a/src/main/java/com/rabbitmq/client/impl/TlsUtils.java b/src/main/java/com/rabbitmq/client/impl/TlsUtils.java index a11deddc2c..aa103607ec 100644 --- a/src/main/java/com/rabbitmq/client/impl/TlsUtils.java +++ b/src/main/java/com/rabbitmq/client/impl/TlsUtils.java @@ -104,7 +104,7 @@ public static String peerCertificateInfo(Certificate certificate, String prefix) try { return String.format("%s subject: %s, subject alternative names: %s, " + "issuer: %s, not valid after: %s, X.509 usage extensions: %s", - stripCRLF(prefix), stripCRLF(c.getSubjectDN().getName()), stripCRLF(sans(c, ",")), stripCRLF(c.getIssuerDN().getName()), + stripCRLF(prefix), stripCRLF(c.getSubjectX500Principal().getName()), stripCRLF(sans(c, ",")), stripCRLF(c.getIssuerX500Principal().getName()), c.getNotAfter(), stripCRLF(extensions(c))); } catch (Exception e) { return "Error while retrieving " + prefix + " certificate information"; From d87c82feba2d835c35691bfeb97df90926964817 Mon Sep 17 00:00:00 2001 From: ByteAlex Date: Fri, 5 Nov 2021 11:09:45 +0100 Subject: [PATCH 029/657] Parse unsigned byte `B` in ValueReader (cherry picked from commit 15ed3d151e8c8747cd1beb17931eb06d1281d3e7) --- src/main/java/com/rabbitmq/client/impl/ValueReader.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/rabbitmq/client/impl/ValueReader.java b/src/main/java/com/rabbitmq/client/impl/ValueReader.java index 1162cc8af0..ed7f41284c 100644 --- a/src/main/java/com/rabbitmq/client/impl/ValueReader.java +++ b/src/main/java/com/rabbitmq/client/impl/ValueReader.java @@ -186,6 +186,9 @@ static Object readFieldValue(DataInputStream in) case 'b': value = in.readByte(); break; + case 'B': + value = in.readUnsignedByte(); + break; case 'd': value = in.readDouble(); break; From 525cb08ae142044c7189c606296e3161b6474c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 5 Nov 2021 13:41:55 +0100 Subject: [PATCH 030/657] Fix handshake with NIO on TLS 1.3 The unwrapping does not work the same way between TLS 1.2 and 1.3. This commit makes the unwrapping more reliable by getting the number of bytes consumed in the unwrapping and then set the position of the reading ByteBuffer accordingly to the number of bytes. With TLS 1.3, the unwrapping seems to read the whole content of the buffer and to extract only the first record, so the rewinding is necessary. The commit also adds some debug logging, adds tests on TLS 1.2 and 1.3, and re-arranges the TLS test (add utility class). Fixes #715 (cherry picked from commit 448d3dd0ccb9755db2fccb11f433ddf5b55ca48f) Conflicts: src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java --- .../client/impl/nio/SslEngineHelper.java | 101 +++++++++++---- .../rabbitmq/client/test/BrokerTestCase.java | 7 +- .../com/rabbitmq/client/test/TestUtils.java | 45 +++---- .../test/ssl/BadVerifiedConnection.java | 49 +------- .../client/test/ssl/HostnameVerification.java | 35 +----- .../test/ssl/NioTlsUnverifiedConnection.java | 55 +++++---- .../client/test/ssl/TlsConnectionLogging.java | 4 +- .../client/test/ssl/TlsTestUtils.java | 115 ++++++++++++++++++ .../client/test/ssl/UnverifiedConnection.java | 10 +- .../client/test/ssl/VerifiedConnection.java | 93 +++++++------- src/test/resources/logback-test.xml | 2 +- 11 files changed, 302 insertions(+), 214 deletions(-) create mode 100644 src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java index 1e7e3a0793..bcefe8b205 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -23,8 +23,12 @@ import java.nio.channels.ReadableByteChannel; import java.nio.channels.SocketChannel; import java.nio.channels.WritableByteChannel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static javax.net.ssl.SSLEngineResult.HandshakeStatus.FINISHED; +import static javax.net.ssl.SSLEngineResult.HandshakeStatus.NEED_TASK; +import static javax.net.ssl.SSLEngineResult.HandshakeStatus.NEED_WRAP; import static javax.net.ssl.SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING; /** @@ -32,6 +36,8 @@ */ public class SslEngineHelper { + private static final Logger LOGGER = LoggerFactory.getLogger(SslEngineHelper.class); + public static boolean doHandshake(SocketChannel socketChannel, SSLEngine engine) throws IOException { ByteBuffer plainOut = ByteBuffer.allocate(engine.getSession().getApplicationBufferSize()); @@ -39,20 +45,36 @@ public static boolean doHandshake(SocketChannel socketChannel, SSLEngine engine) ByteBuffer cipherOut = ByteBuffer.allocate(engine.getSession().getPacketBufferSize()); ByteBuffer cipherIn = ByteBuffer.allocate(engine.getSession().getPacketBufferSize()); + LOGGER.debug("Starting TLS handshake"); + SSLEngineResult.HandshakeStatus handshakeStatus = engine.getHandshakeStatus(); + LOGGER.debug("Initial handshake status is {}", handshakeStatus); while (handshakeStatus != FINISHED && handshakeStatus != NOT_HANDSHAKING) { + LOGGER.debug("Handshake status is {}", handshakeStatus); switch (handshakeStatus) { case NEED_TASK: + LOGGER.debug("Running tasks"); handshakeStatus = runDelegatedTasks(engine); break; case NEED_UNWRAP: + LOGGER.debug("Unwrapping..."); handshakeStatus = unwrap(cipherIn, plainIn, socketChannel, engine); break; case NEED_WRAP: + LOGGER.debug("Wrapping..."); handshakeStatus = wrap(plainOut, cipherOut, socketChannel, engine); break; + case FINISHED: + break; + case NOT_HANDSHAKING: + break; + default: + throw new SSLException("Unexpected handshake status " + handshakeStatus); } } + + + LOGGER.debug("TLS handshake completed"); return true; } @@ -60,6 +82,7 @@ private static SSLEngineResult.HandshakeStatus runDelegatedTasks(SSLEngine sslEn // FIXME run in executor? Runnable runnable; while ((runnable = sslEngine.getDelegatedTask()) != null) { + LOGGER.debug("Running delegated task"); runnable.run(); } return sslEngine.getHandshakeStatus(); @@ -68,29 +91,57 @@ private static SSLEngineResult.HandshakeStatus runDelegatedTasks(SSLEngine sslEn private static SSLEngineResult.HandshakeStatus unwrap(ByteBuffer cipherIn, ByteBuffer plainIn, ReadableByteChannel channel, SSLEngine sslEngine) throws IOException { SSLEngineResult.HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); - - if (channel.read(cipherIn) < 0) { - throw new SSLException("Could not read from socket channel"); + LOGGER.debug("Handshake status is {} before unwrapping", handshakeStatus); + + LOGGER.debug("Cipher in position {}", cipherIn.position()); + int read; + if (cipherIn.position() == 0) { + LOGGER.debug("Reading from channel"); + read = channel.read(cipherIn); + LOGGER.debug("Read {} byte(s) from channel", read); + if (read < 0) { + throw new SSLException("Could not read from socket channel"); + } + cipherIn.flip(); + } else { + LOGGER.debug("Not reading"); } - cipherIn.flip(); SSLEngineResult.Status status; + SSLEngineResult unwrapResult; do { - SSLEngineResult unwrapResult = sslEngine.unwrap(cipherIn, plainIn); + int positionBeforeUnwrapping = cipherIn.position(); + unwrapResult = sslEngine.unwrap(cipherIn, plainIn); + LOGGER.debug("SSL engine result is {} after unwrapping", unwrapResult); status = unwrapResult.getStatus(); switch (status) { case OK: plainIn.clear(); - handshakeStatus = runDelegatedTasks(sslEngine); + if (unwrapResult.getHandshakeStatus() == NEED_TASK) { + handshakeStatus = runDelegatedTasks(sslEngine); + int newPosition = positionBeforeUnwrapping + unwrapResult.bytesConsumed(); + if (newPosition == cipherIn.limit()) { + LOGGER.debug("Clearing cipherIn because all bytes have been read and unwrapped"); + cipherIn.clear(); + } else { + LOGGER.debug("Setting cipherIn position to {} (limit is {})", newPosition, cipherIn.limit()); + cipherIn.position(positionBeforeUnwrapping + unwrapResult.bytesConsumed()); + } + } else { + handshakeStatus = unwrapResult.getHandshakeStatus(); + } break; case BUFFER_OVERFLOW: throw new SSLException("Buffer overflow during handshake"); case BUFFER_UNDERFLOW: + LOGGER.debug("Buffer underflow"); cipherIn.compact(); - int read = NioHelper.read(channel, cipherIn); + LOGGER.debug("Reading from channel..."); + read = NioHelper.read(channel, cipherIn); if(read <= 0) { retryRead(channel, cipherIn); } + LOGGER.debug("Done reading from channel..."); cipherIn.flip(); break; case CLOSED: @@ -100,9 +151,9 @@ private static SSLEngineResult.HandshakeStatus unwrap(ByteBuffer cipherIn, ByteB throw new SSLException("Unexpected status from " + unwrapResult); } } - while (cipherIn.hasRemaining()); + while (unwrapResult.getHandshakeStatus() != NEED_WRAP && unwrapResult.getHandshakeStatus() != FINISHED); - cipherIn.compact(); + LOGGER.debug("cipherIn position after unwrap {}", cipherIn.position()); return handshakeStatus; } @@ -127,36 +178,32 @@ private static int retryRead(ReadableByteChannel channel, ByteBuffer buffer) thr private static SSLEngineResult.HandshakeStatus wrap(ByteBuffer plainOut, ByteBuffer cipherOut, WritableByteChannel channel, SSLEngine sslEngine) throws IOException { SSLEngineResult.HandshakeStatus handshakeStatus = sslEngine.getHandshakeStatus(); - SSLEngineResult.Status status = sslEngine.wrap(plainOut, cipherOut).getStatus(); - switch (status) { + LOGGER.debug("Handshake status is {} before wrapping", handshakeStatus); + SSLEngineResult result = sslEngine.wrap(plainOut, cipherOut); + LOGGER.debug("SSL engine result is {} after wrapping", result); + switch (result.getStatus()) { case OK: - handshakeStatus = runDelegatedTasks(sslEngine); cipherOut.flip(); while (cipherOut.hasRemaining()) { - channel.write(cipherOut); + int written = channel.write(cipherOut); + LOGGER.debug("Wrote {} byte(s)", written); } cipherOut.clear(); + if (result.getHandshakeStatus() == NEED_TASK) { + handshakeStatus = runDelegatedTasks(sslEngine); + } else { + handshakeStatus = result.getHandshakeStatus(); + } + break; case BUFFER_OVERFLOW: throw new SSLException("Buffer overflow during handshake"); default: - throw new SSLException("Unexpected status " + status); + throw new SSLException("Unexpected status " + result.getStatus()); } return handshakeStatus; } - static int bufferCopy(ByteBuffer from, ByteBuffer to) { - int maxTransfer = Math.min(to.remaining(), from.remaining()); - - ByteBuffer temporaryBuffer = from.duplicate(); - temporaryBuffer.limit(temporaryBuffer.position() + maxTransfer); - to.put(temporaryBuffer); - - from.position(from.position() + maxTransfer); - - return maxTransfer; - } - public static void write(WritableByteChannel socketChannel, SSLEngine engine, ByteBuffer plainOut, ByteBuffer cypherOut) throws IOException { while (plainOut.hasRemaining()) { cypherOut.clear(); diff --git a/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java b/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java index 7c23a3c0e6..37cf436db4 100644 --- a/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java +++ b/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -28,9 +28,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.net.ssl.SSLContext; import java.io.IOException; -import java.security.NoSuchAlgorithmException; import java.util.Map; import java.util.UUID; import java.util.concurrent.TimeoutException; @@ -348,7 +346,4 @@ protected String generateExchangeName() { return "exchange" + UUID.randomUUID().toString(); } - protected SSLContext getSSLContext() throws NoSuchAlgorithmException { - return TestUtils.getSSLContext(); - } } diff --git a/src/test/java/com/rabbitmq/client/test/TestUtils.java b/src/test/java/com/rabbitmq/client/test/TestUtils.java index 7544893760..c488fcff6d 100644 --- a/src/test/java/com/rabbitmq/client/test/TestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/TestUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -26,19 +26,15 @@ import org.junit.runners.model.Statement; import org.slf4j.LoggerFactory; -import javax.net.ssl.SSLContext; import java.io.IOException; import java.net.ServerSocket; -import java.security.NoSuchAlgorithmException; import java.time.Duration; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.concurrent.Callable; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import java.util.function.BooleanSupplier; import static org.junit.Assert.assertTrue; @@ -109,22 +105,6 @@ public static void abort(Connection connection) { } } - public static SSLContext getSSLContext() throws NoSuchAlgorithmException { - SSLContext c = null; - - // pick the first protocol available, preferring TLSv1.2, then TLSv1, - // falling back to SSLv3 if running on an ancient/crippled JDK - for (String proto : Arrays.asList("TLSv1.2", "TLSv1", "SSLv3")) { - try { - c = SSLContext.getInstance(proto); - return c; - } catch (NoSuchAlgorithmException x) { - // keep trying - } - } - throw new NoSuchAlgorithmException(); - } - public static TestRule atLeast38() { return new BrokerVersionTestRule("3.8.0"); } @@ -361,4 +341,27 @@ public interface CallableFunction { } + public static boolean basicGetBasicConsume(Connection connection, String queue, final CountDownLatch latch, int msgSize) + throws Exception { + Channel channel = connection.createChannel(); + channel.queueDeclare(queue, false, true, false, null); + channel.queuePurge(queue); + + channel.basicPublish("", queue, null, new byte[msgSize]); + + String tag = channel.basicConsume(queue, false, new DefaultConsumer(channel) { + + @Override + public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { + getChannel().basicAck(envelope.getDeliveryTag(), false); + latch.countDown(); + } + }); + + boolean messageReceived = latch.await(20, TimeUnit.SECONDS); + + channel.basicCancel(tag); + + return messageReceived; + } } diff --git a/src/test/java/com/rabbitmq/client/test/ssl/BadVerifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/BadVerifiedConnection.java index 9137213578..fe33af7dec 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/BadVerifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/BadVerifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,20 +15,13 @@ package com.rabbitmq.client.test.ssl; -import com.rabbitmq.client.test.TestUtils; import org.junit.Test; -import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLHandshakeException; -import javax.net.ssl.TrustManagerFactory; -import java.io.FileInputStream; import java.io.IOException; -import java.security.*; -import java.security.cert.CertificateException; import java.util.concurrent.TimeoutException; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; /** @@ -39,44 +32,10 @@ public class BadVerifiedConnection extends UnverifiedConnection { public void openConnection() throws IOException, TimeoutException { try { - String keystorePath = System.getProperty("test-keystore.empty"); - assertNotNull(keystorePath); - String keystorePasswd = System.getProperty("test-keystore.password"); - assertNotNull(keystorePasswd); - char [] keystorePassword = keystorePasswd.toCharArray(); - - KeyStore tks = KeyStore.getInstance("JKS"); - tks.load(new FileInputStream(keystorePath), keystorePassword); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(tks); - - String p12Path = System.getProperty("test-client-cert.path"); - assertNotNull(p12Path); - String p12Passwd = System.getProperty("test-client-cert.password"); - assertNotNull(p12Passwd); - KeyStore ks = KeyStore.getInstance("PKCS12"); - char [] p12Password = p12Passwd.toCharArray(); - ks.load(new FileInputStream(p12Path), p12Password); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, p12Password); - - SSLContext c = getSSLContext(); - c.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - connectionFactory = TestUtils.connectionFactory(); + SSLContext c = TlsTestUtils.badVerifiedSslContext(); connectionFactory.useSslProtocol(c); - } catch (NoSuchAlgorithmException ex) { - throw new IOException(ex.toString()); - } catch (KeyManagementException ex) { - throw new IOException(ex.toString()); - } catch (KeyStoreException ex) { - throw new IOException(ex.toString()); - } catch (CertificateException ex) { - throw new IOException(ex.toString()); - } catch (UnrecoverableKeyException ex) { - throw new IOException(ex.toString()); + } catch (Exception ex) { + throw new IOException(ex); } try { diff --git a/src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java b/src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java index 014c02cfdd..acbfe48260 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -24,17 +24,11 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLHandshakeException; -import javax.net.ssl.TrustManagerFactory; -import java.io.FileInputStream; -import java.security.KeyStore; import java.util.function.Consumer; -import static com.rabbitmq.client.test.TestUtils.getSSLContext; import static java.util.Collections.singletonList; -import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -73,32 +67,7 @@ private static Consumer enableHostnameVerification() { @BeforeClass public static void initCrypto() throws Exception { - String keystorePath = System.getProperty("test-keystore.ca"); - assertNotNull(keystorePath); - String keystorePasswd = System.getProperty("test-keystore.password"); - assertNotNull(keystorePasswd); - char[] keystorePassword = keystorePasswd.toCharArray(); - - KeyStore tks = KeyStore.getInstance("JKS"); - tks.load(new FileInputStream(keystorePath), keystorePassword); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(tks); - - String p12Path = System.getProperty("test-client-cert.path"); - assertNotNull(p12Path); - String p12Passwd = System.getProperty("test-client-cert.password"); - assertNotNull(p12Passwd); - - KeyStore ks = KeyStore.getInstance("PKCS12"); - char[] p12Password = p12Passwd.toCharArray(); - ks.load(new FileInputStream(p12Path), p12Password); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, p12Password); - - sslContext = getSSLContext(); - sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + sslContext = TlsTestUtils.verifiedSslContext(); } @Test(expected = SSLHandshakeException.class) diff --git a/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java index 29fe35899e..37048739e2 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -18,6 +18,10 @@ import com.rabbitmq.client.*; import com.rabbitmq.client.impl.nio.NioParams; import com.rabbitmq.client.test.BrokerTestCase; +import com.rabbitmq.client.test.TestUtils; +import java.util.concurrent.atomic.AtomicReference; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; import org.junit.Test; import org.slf4j.LoggerFactory; @@ -28,6 +32,8 @@ import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; +import static com.rabbitmq.client.test.TestUtils.basicGetBasicConsume; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; @@ -76,6 +82,29 @@ public void connectionGetConsume() throws Exception { assertTrue("Message has not been received", messagesReceived); } + @Test + public void connectionGetConsumeProtocols() throws Exception { + String [] protocols = new String[] {"TLSv1.2", "TLSv1.3"}; + for (String protocol : protocols) { + SSLContext sslContext = SSLContext.getInstance(protocol); + sslContext.init(null, new TrustManager[] {new TrustEverythingTrustManager()}, null); + ConnectionFactory cf = TestUtils.connectionFactory(); + cf.useSslProtocol(sslContext); + cf.useNio(); + AtomicReference engine = new AtomicReference<>(); + cf.setNioParams(new NioParams() + .setSslEngineConfigurator(sslEngine -> engine.set(sslEngine))); + try (Connection c = cf.newConnection()) { + CountDownLatch latch = new CountDownLatch(1); + basicGetBasicConsume(c, QUEUE, latch, 100); + boolean messagesReceived = latch.await(5, TimeUnit.SECONDS); + assertTrue("Message has not been received", messagesReceived); + assertThat(engine.get()).isNotNull(); + assertThat(engine.get().getEnabledProtocols()).contains(protocol); + } + } + } + @Test public void socketChannelConfigurator() throws Exception { ConnectionFactory connectionFactory = new ConnectionFactory(); connectionFactory.useNio(); @@ -119,28 +148,4 @@ private void sendAndVerifyMessage(int size) throws Exception { assertTrue("Message has not been received", messageReceived); } - private boolean basicGetBasicConsume(Connection connection, String queue, final CountDownLatch latch, int msgSize) - throws Exception { - Channel channel = connection.createChannel(); - channel.queueDeclare(queue, false, false, false, null); - channel.queuePurge(queue); - - channel.basicPublish("", queue, null, new byte[msgSize]); - - String tag = channel.basicConsume(queue, false, new DefaultConsumer(channel) { - - @Override - public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { - getChannel().basicAck(envelope.getDeliveryTag(), false); - latch.countDown(); - } - }); - - boolean messageReceived = latch.await(20, TimeUnit.SECONDS); - - channel.basicCancel(tag); - - return messageReceived; - } - } diff --git a/src/test/java/com/rabbitmq/client/test/ssl/TlsConnectionLogging.java b/src/test/java/com/rabbitmq/client/test/ssl/TlsConnectionLogging.java index 49b9ac3ad9..4298f18a9a 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/TlsConnectionLogging.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/TlsConnectionLogging.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2021 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -66,7 +66,7 @@ public static Function> nio() { @Test public void certificateInfoAreProperlyExtracted() throws Exception { - SSLContext sslContext = TestUtils.getSSLContext(); + SSLContext sslContext = TlsTestUtils.getSSLContext(); sslContext.init(null, new TrustManager[]{new AlwaysTrustTrustManager()}, null); ConnectionFactory connectionFactory = TestUtils.connectionFactory(); connectionFactory.useSslProtocol(sslContext); diff --git a/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java b/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java new file mode 100644 index 0000000000..891bec7f04 --- /dev/null +++ b/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java @@ -0,0 +1,115 @@ +// Copyright (c) 2021 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.test.ssl; + +import static org.junit.Assert.assertNotNull; + +import java.io.FileInputStream; +import java.security.KeyStore; +import java.security.NoSuchAlgorithmException; +import java.util.Arrays; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManagerFactory; + +class TlsTestUtils { + + private TlsTestUtils() {} + + static SSLContext badVerifiedSslContext() throws Exception { + return verifiedSslContext(() -> getSSLContext(), emptyKeystoreCa()); + } + + static SSLContext verifiedSslContext() throws Exception { + return verifiedSslContext(() -> getSSLContext(), keystoreCa()); + } + + static SSLContext verifiedSslContext(CallableSupplier sslContextSupplier) throws Exception { + return verifiedSslContext(sslContextSupplier, keystoreCa()); + } + + static SSLContext verifiedSslContext(CallableSupplier sslContextSupplier, String keystorePath) throws Exception { + // for local testing, run ./mvnw test-compile -Dtest-tls-certs.dir=/tmp/tls-gen/basic + // (generates the Java keystores) + assertNotNull(keystorePath); + String keystorePasswd = keystorePassword(); + assertNotNull(keystorePasswd); + char [] keystorePassword = keystorePasswd.toCharArray(); + + KeyStore tks = KeyStore.getInstance("JKS"); + tks.load(new FileInputStream(keystorePath), keystorePassword); + + TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); + tmf.init(tks); + + String p12Path = clientCertPath(); + assertNotNull(p12Path); + String p12Passwd = clientCertPassword(); + assertNotNull(p12Passwd); + KeyStore ks = KeyStore.getInstance("PKCS12"); + char [] p12Password = p12Passwd.toCharArray(); + ks.load(new FileInputStream(p12Path), p12Password); + + KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); + kmf.init(ks, p12Password); + + SSLContext c = sslContextSupplier.get(); + c.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + return c; + } + + static String keystoreCa() { + return System.getProperty("test-keystore.ca", "./target/ca.keystore"); + } + + static String emptyKeystoreCa() { + return System.getProperty("test-keystore.empty", "./target/empty.keystore"); + } + + static String keystorePassword() { + return System.getProperty("test-keystore.password", "bunnies"); + } + + static String clientCertPath() { + return System.getProperty("test-client-cert.path", "/tmp/tls-gen/basic/client/keycert.p12"); + } + + static String clientCertPassword() { + return System.getProperty("test-client-cert.password", ""); + } + + public static SSLContext getSSLContext() throws NoSuchAlgorithmException { + SSLContext c; + + // pick the first protocol available, preferring TLSv1.2, then TLSv1, + // falling back to SSLv3 if running on an ancient/crippled JDK + for (String proto : Arrays.asList("TLSv1.3", "TLSv1.2", "TLSv1", "SSLv3")) { + try { + c = SSLContext.getInstance(proto); + return c; + } catch (NoSuchAlgorithmException x) { + // keep trying + } + } + throw new NoSuchAlgorithmException(); + } + + @FunctionalInterface + interface CallableSupplier { + + T get() throws Exception; + } +} diff --git a/src/test/java/com/rabbitmq/client/test/ssl/UnverifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/UnverifiedConnection.java index a14a257c24..39e1e90ba5 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/UnverifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/UnverifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -21,8 +21,6 @@ import org.slf4j.LoggerFactory; import java.io.IOException; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; import java.util.concurrent.TimeoutException; import static org.junit.Assert.*; @@ -37,10 +35,8 @@ public void openConnection() throws IOException, TimeoutException { try { connectionFactory.useSslProtocol(); - } catch (NoSuchAlgorithmException ex) { - throw new IOException(ex.toString()); - } catch (KeyManagementException ex) { - throw new IOException(ex.toString()); + } catch (Exception ex) { + throw new IOException(ex); } int attempt = 0; diff --git a/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java index 50d4d9003b..0f82fb1194 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,25 +15,25 @@ package com.rabbitmq.client.test.ssl; -import static org.junit.Assert.assertNotNull; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; -import java.io.FileInputStream; +import com.rabbitmq.client.Connection; +import com.rabbitmq.client.impl.nio.NioParams; import java.io.IOException; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableKeyException; -import java.security.cert.CertificateException; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import javax.net.ssl.KeyManagerFactory; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManagerFactory; +import javax.net.ssl.SSLSocket; import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.test.TestUtils; +import org.junit.Test; import org.slf4j.LoggerFactory; /** @@ -45,44 +45,11 @@ public class VerifiedConnection extends UnverifiedConnection { public void openConnection() throws IOException, TimeoutException { try { - String keystorePath = System.getProperty("test-keystore.ca"); - assertNotNull(keystorePath); - String keystorePasswd = System.getProperty("test-keystore.password"); - assertNotNull(keystorePasswd); - char [] keystorePassword = keystorePasswd.toCharArray(); - - KeyStore tks = KeyStore.getInstance("JKS"); - tks.load(new FileInputStream(keystorePath), keystorePassword); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(tks); - - String p12Path = System.getProperty("test-client-cert.path"); - assertNotNull(p12Path); - String p12Passwd = System.getProperty("test-client-cert.password"); - assertNotNull(p12Passwd); - KeyStore ks = KeyStore.getInstance("PKCS12"); - char [] p12Password = p12Passwd.toCharArray(); - ks.load(new FileInputStream(p12Path), p12Password); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, p12Password); - - SSLContext c = getSSLContext(); - c.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - + SSLContext c = TlsTestUtils.verifiedSslContext(); connectionFactory = TestUtils.connectionFactory(); connectionFactory.useSslProtocol(c); - } catch (NoSuchAlgorithmException ex) { - throw new IOException(ex.toString()); - } catch (KeyManagementException ex) { - throw new IOException(ex.toString()); - } catch (KeyStoreException ex) { - throw new IOException(ex.toString()); - } catch (CertificateException ex) { - throw new IOException(ex.toString()); - } catch (UnrecoverableKeyException ex) { - throw new IOException(ex.toString()); + } catch (Exception ex) { + throw new IOException(ex); } int attempt = 0; @@ -99,4 +66,36 @@ public void openConnection() fail("Couldn't open TLS connection after 3 attempts"); } } + + @Test + public void connectionGetConsumeProtocols() throws Exception { + String [] protocols = new String[] {"TLSv1.2", "TLSv1.3"}; + for (String protocol : protocols) { + SSLContext sslContext = SSLContext.getInstance(protocol); + ConnectionFactory cf = TestUtils.connectionFactory(); + cf.useSslProtocol(TlsTestUtils.verifiedSslContext(() -> sslContext)); + AtomicReference> protocolsSupplier = new AtomicReference<>(); + if (TestUtils.USE_NIO) { + cf.useNio(); + cf.setNioParams(new NioParams() + .setSslEngineConfigurator(sslEngine -> { + protocolsSupplier.set(() -> sslEngine.getEnabledProtocols()); + })); + } else { + cf.setSocketConfigurator(socket -> { + SSLSocket s = (SSLSocket) socket; + protocolsSupplier.set(() -> s.getEnabledProtocols()); + }); + } + try (Connection c = cf.newConnection()) { + CountDownLatch latch = new CountDownLatch(1); + TestUtils.basicGetBasicConsume(c, VerifiedConnection.class.getName(), latch, 100); + boolean messagesReceived = latch.await(5, TimeUnit.SECONDS); + assertTrue("Message has not been received", messagesReceived); + assertThat(protocolsSupplier.get()).isNotNull(); + assertThat(protocolsSupplier.get().get()).contains(protocol); + } + } + } + } diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 4bd2e37606..ee88f442c2 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -5,7 +5,7 @@ - + \ No newline at end of file From 830bdc6a9cef7d74e2c09831d565d974bb4bd34f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 8 Nov 2021 09:32:24 +0100 Subject: [PATCH 031/657] Test TLS 1.3 only if available TLS 1.3 has not been backported to all Java version (e.g. on 9 and 10), so this commit checks if the protocol is available before running the test. References #715 (cherry picked from commit 23961d5d0557a13105e099d2a90d90c4e96ab006) --- .../client/test/ssl/NioTlsUnverifiedConnection.java | 8 +++++++- .../com/rabbitmq/client/test/ssl/TlsTestUtils.java | 12 ++++++++++++ .../rabbitmq/client/test/ssl/VerifiedConnection.java | 8 +++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java index 37048739e2..bc143bc811 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java @@ -19,7 +19,10 @@ import com.rabbitmq.client.impl.nio.NioParams; import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; +import java.util.Collection; import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; +import java.util.stream.Stream; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import org.junit.Test; @@ -84,7 +87,10 @@ public void connectionGetConsume() throws Exception { @Test public void connectionGetConsumeProtocols() throws Exception { - String [] protocols = new String[] {"TLSv1.2", "TLSv1.3"}; + Collection availableProtocols = TlsTestUtils.availableTlsProtocols(); + Collection protocols = Stream.of("TLSv1.2", "TLSv1.3") + .filter(p -> availableProtocols.contains(p)) + .collect(Collectors.toList()); for (String protocol : protocols) { SSLContext sslContext = SSLContext.getInstance(protocol); sslContext.init(null, new TrustManager[] {new TrustEverythingTrustManager()}, null); diff --git a/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java b/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java index 891bec7f04..6e633ce664 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java @@ -21,6 +21,8 @@ import java.security.KeyStore; import java.security.NoSuchAlgorithmException; import java.util.Arrays; +import java.util.Collection; +import java.util.stream.Collectors; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; @@ -107,6 +109,16 @@ public static SSLContext getSSLContext() throws NoSuchAlgorithmException { throw new NoSuchAlgorithmException(); } + static Collection availableTlsProtocols() { + try { + String[] protocols = SSLContext.getDefault().getSupportedSSLParameters().getProtocols(); + return Arrays.stream(protocols).filter(p -> p.toLowerCase().startsWith("tls")).collect( + Collectors.toList()); + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException(e); + } + } + @FunctionalInterface interface CallableSupplier { diff --git a/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java index 0f82fb1194..9accac4459 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java @@ -22,12 +22,15 @@ import com.rabbitmq.client.Connection; import com.rabbitmq.client.impl.nio.NioParams; import java.io.IOException; +import java.util.Collection; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; +import java.util.stream.Collectors; +import java.util.stream.Stream; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocket; @@ -69,7 +72,10 @@ public void openConnection() @Test public void connectionGetConsumeProtocols() throws Exception { - String [] protocols = new String[] {"TLSv1.2", "TLSv1.3"}; + Collection availableProtocols = TlsTestUtils.availableTlsProtocols(); + Collection protocols = Stream.of("TLSv1.2", "TLSv1.3") + .filter(p -> availableProtocols.contains(p)) + .collect(Collectors.toList()); for (String protocol : protocols) { SSLContext sslContext = SSLContext.getInstance(protocol); ConnectionFactory cf = TestUtils.connectionFactory(); From 7e830e9c9641bf49bdadc73715e9dc9ca12913a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 8 Nov 2021 09:46:22 +0100 Subject: [PATCH 032/657] Fix usage of NioParams setter in test References #396,#715 --- .../client/test/ssl/NioTlsUnverifiedConnection.java | 5 +++-- .../com/rabbitmq/client/test/ssl/VerifiedConnection.java | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java index bc143bc811..132cac31cc 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java @@ -98,8 +98,9 @@ public void connectionGetConsumeProtocols() throws Exception { cf.useSslProtocol(sslContext); cf.useNio(); AtomicReference engine = new AtomicReference<>(); - cf.setNioParams(new NioParams() - .setSslEngineConfigurator(sslEngine -> engine.set(sslEngine))); + NioParams nioParams = new NioParams(); + nioParams.setSslEngineConfigurator(sslEngine -> engine.set(sslEngine)); + cf.setNioParams(nioParams); try (Connection c = cf.newConnection()) { CountDownLatch latch = new CountDownLatch(1); basicGetBasicConsume(c, QUEUE, latch, 100); diff --git a/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java index 9accac4459..1df24d83a9 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java @@ -83,10 +83,11 @@ public void connectionGetConsumeProtocols() throws Exception { AtomicReference> protocolsSupplier = new AtomicReference<>(); if (TestUtils.USE_NIO) { cf.useNio(); - cf.setNioParams(new NioParams() - .setSslEngineConfigurator(sslEngine -> { - protocolsSupplier.set(() -> sslEngine.getEnabledProtocols()); - })); + NioParams nioParams = new NioParams(); + nioParams.setSslEngineConfigurator( + sslEngine -> protocolsSupplier.set(() -> sslEngine.getEnabledProtocols()) + ); + cf.setNioParams(nioParams); } else { cf.setSocketConfigurator(socket -> { SSLSocket s = (SSLSocket) socket; From 2002ba6c11345ec5604c7a0c221c2660b6a4d872 Mon Sep 17 00:00:00 2001 From: pivotal-rabbitmq-ci Date: Mon, 8 Nov 2021 10:27:56 +0000 Subject: [PATCH 033/657] [maven-release-plugin] prepare release v5.14.0.RC1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 721405e4a5..d3147ea977 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.14.0-SNAPSHOT + 5.14.0.RC1 jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:git@github.com:rabbitmq/rabbitmq-java-client.git - HEAD + v5.14.0.RC1 From 6b80f188d89b0b00750ccb5e859cbf65a4ce32ca Mon Sep 17 00:00:00 2001 From: pivotal-rabbitmq-ci Date: Mon, 8 Nov 2021 10:27:58 +0000 Subject: [PATCH 034/657] [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 d3147ea977..721405e4a5 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.14.0.RC1 + 5.14.0-SNAPSHOT jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:git@github.com:rabbitmq/rabbitmq-java-client.git - v5.14.0.RC1 + HEAD From fba1fd92a9190399461287072973b33593b749ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 8 Nov 2021 11:30:10 +0100 Subject: [PATCH 035/657] Set release version to 5.14.0.RC2 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index 19d9bee27b..cb85e0b3e9 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.14.0.RC1" +RELEASE_VERSION="5.14.0.RC2" DEVELOPMENT_VERSION="5.14.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From 17de251bf381943f39f558f1bd97900c847bcecd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 15 Nov 2021 10:04:21 +0100 Subject: [PATCH 036/657] Set release version to 5.14.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index cb85e0b3e9..a93c142519 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.14.0.RC2" -DEVELOPMENT_VERSION="5.14.0-SNAPSHOT" +RELEASE_VERSION="5.14.0" +DEVELOPMENT_VERSION="5.15.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From dd03c79f4d30f32e4871188b52f0148b24846ad2 Mon Sep 17 00:00:00 2001 From: pivotal-rabbitmq-ci Date: Mon, 15 Nov 2021 09:09:20 +0000 Subject: [PATCH 037/657] [maven-release-plugin] prepare release v5.14.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 721405e4a5..04bbaf2a16 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.14.0-SNAPSHOT + 5.14.0 jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:git@github.com:rabbitmq/rabbitmq-java-client.git - HEAD + v5.14.0 From 69336683f91b2ac75bf80eecfb49974c2be7333b Mon Sep 17 00:00:00 2001 From: pivotal-rabbitmq-ci Date: Mon, 15 Nov 2021 09:09:22 +0000 Subject: [PATCH 038/657] [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 04bbaf2a16..32984a40fe 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.14.0 + 5.15.0-SNAPSHOT jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:git@github.com:rabbitmq/rabbitmq-java-client.git - v5.14.0 + HEAD From 412cfa8b8bc647a5fa73c17dcb9085290987cad0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 15 Nov 2021 15:56:45 +0100 Subject: [PATCH 039/657] Bump Micrometer to 1.8.0 References #717 (cherry picked from commit 3d1c55c4c82ca112d304f4f9e87582d7052be07d) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 32984a40fe..a95126b0ec 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.7.32 4.2.4 - 1.7.5 + 1.8.0 2.13.0 1.2.6 4.13.2 From 08039edeb7de7deb20a61b4dbc57b3c72a4803f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 15 Nov 2021 15:57:28 +0100 Subject: [PATCH 040/657] Bump logback to 1.2.7 (test dependency) (cherry picked from commit 45f761eb7ce041bb1fd0eaf88282e68f0a3d2d4d) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a95126b0ec..d51ed53f39 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ 4.2.4 1.8.0 2.13.0 - 1.2.6 + 1.2.7 4.13.2 4.0.0 3.21.0 From 670f271c23336bce08f3421ae120828607016211 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 13 Dec 2021 11:23:34 +0100 Subject: [PATCH 041/657] Bump Maven Groovy Plugin to 2.1.1 To avoid error on Java 18, it fails because of the usage of the SecurityManager (deprecated). (cherry picked from commit ba4ebbaaf17bad8ebc7503bc01a38fc711930bf7) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d51ed53f39..57187f8679 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 2.3 3.1.0 3.0.1 - 2.0 + 2.1.1 2.4.8 1.5 1.12 From 1106a8ba45a91cefa2242630336dc9a6b97848a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 13 Dec 2021 13:57:40 +0100 Subject: [PATCH 042/657] Use count down latch in test To avoid using Thread#stop(), which is deprecated since 1998. The test does not explain why or if Thread#stop() is necessary to the test. It's unlikely as the target thread has stopped already when stop is called in the test. (cherry picked from commit 6aaa203aa979307e7dc9326b7d9f0f077d8cc390) --- .../rabbitmq/client/test/Bug20004Test.java | 89 ++++++++----------- 1 file changed, 39 insertions(+), 50 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/test/Bug20004Test.java b/src/test/java/com/rabbitmq/client/test/Bug20004Test.java index 63e237d4b1..d14e1d3e74 100644 --- a/src/test/java/com/rabbitmq/client/test/Bug20004Test.java +++ b/src/test/java/com/rabbitmq/client/test/Bug20004Test.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,66 +15,55 @@ package com.rabbitmq.client.test; -import org.junit.Test; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; import java.io.IOException; - -import static org.junit.Assert.*; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import org.junit.Test; /** - * Test for bug 20004 - deadlock through internal synchronization on - * the channel object. This is more properly a unit test, but since it - * requires a connection to a broker, it's grouped with the functional - * tests. - *

- * Test calls channel.queueDeclare, while synchronising on channel, from - * an independent thread. + * Test for bug 20004 - deadlock through internal synchronization on the channel object. This is + * more properly a unit test, but since it requires a connection to a broker, it's grouped with the + * functional tests. + * + *

Test calls channel.queueDeclare, while synchronising on channel, from an independent thread. */ public class Bug20004Test extends BrokerTestCase { - private volatile Exception caughtException = null; - private volatile boolean completed = false; - private volatile boolean created = false; + private volatile Exception caughtException = null; + private volatile boolean created = false; - protected void releaseResources() - throws IOException - { - if (created) { - channel.queueDelete("Bug20004Test"); - } + protected void releaseResources() throws IOException { + if (created) { + channel.queueDelete("Bug20004Test"); } + } - @SuppressWarnings("deprecation") - @Test public void bug20004() throws IOException - { - final Bug20004Test testInstance = this; + @Test + public void bug20004() throws InterruptedException { + final Bug20004Test testInstance = this; + CountDownLatch completedLatch = new CountDownLatch(1); - Thread declaringThread = new Thread(new Runnable() { - public void run() { - try { - synchronized (channel) { - channel.queueDeclare("Bug20004Test", false, false, false, null); - testInstance.created = true; - } - } catch (Exception e) { - testInstance.caughtException = e; + Thread declaringThread = + new Thread( + () -> { + try { + synchronized (channel) { + channel.queueDeclare("Bug20004Test", false, false, false, null); + testInstance.created = true; } - testInstance.completed = true; - } - }); - declaringThread.start(); + } catch (Exception e) { + testInstance.caughtException = e; + } + completedLatch.countDown(); + }); + declaringThread.start(); - // poll (100ms) for `completed`, up to 5s - long endTime = System.currentTimeMillis() + 5000; - while (!completed && (System.currentTimeMillis() < endTime)) { - try { - Thread.sleep(100); - } catch (InterruptedException ie) {} - } + boolean completed = completedLatch.await(5, TimeUnit.SECONDS); - declaringThread.stop(); // see bug 20012. - - assertTrue("Deadlock detected?", completed); - assertNull("queueDeclare threw an exception", caughtException); - assertTrue("unknown sequence of events", created); - } + assertTrue("Deadlock detected?", completed); + assertNull("queueDeclare threw an exception", caughtException); + assertTrue("unknown sequence of events", created); + } } From 3f541ead56b8190d80fe3965397c3afb109b9f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 3 Jan 2022 10:53:02 +0100 Subject: [PATCH 043/657] Bump dependencies References #717 (cherry picked from commit 7eb4d3fe32a85234c629ef4493238fc677be0655) --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 57187f8679..40469c0241 100644 --- a/pom.xml +++ b/pom.xml @@ -55,9 +55,9 @@ UTF-8 1.7.32 - 4.2.4 - 1.8.0 - 2.13.0 + 4.2.7 + 1.8.1 + 2.13.1 1.2.7 4.13.2 4.0.0 From a7c5d5dc5d5cc0266709eb3e4ebaa869a73e894e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 3 Jan 2022 10:53:51 +0100 Subject: [PATCH 044/657] Bump test dependencies (cherry picked from commit 32dfd0fb338a3ff1db2c79dfeb42c9fd451284a0) --- pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 40469c0241..dae3fc505c 100644 --- a/pom.xml +++ b/pom.xml @@ -58,12 +58,12 @@ 4.2.7 1.8.1 2.13.1 - 1.2.7 + 1.2.10 4.13.2 - 4.0.0 - 3.21.0 + 4.2.0 + 3.22.0 9.4.44.v20210927 - 1.69 + 1.70 3.2.0 2.5.3 From b04e8172f9ad1e4a9eb2cad01161dadfd74525f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 12 Jan 2022 16:56:41 +0100 Subject: [PATCH 045/657] Enforce connection timeout in NIO TLS handshake The handshake is in blocking mode and reading from a channel in this mode does not honor so_timeout but using temporary channels based on the socket input/output streams offers a decent workaround for this stage. Fixes #719 (cherry picked from commit 2751d463918b201f36afd1356408272f544816ab) --- pom.xml | 8 ++ .../nio/SocketChannelFrameHandlerFactory.java | 16 +++- .../client/impl/nio/SslEngineHelper.java | 9 +- .../test/ssl/NioTlsUnverifiedConnection.java | 89 ++++++++++++++++--- 4 files changed, 101 insertions(+), 21 deletions(-) diff --git a/pom.xml b/pom.xml index dae3fc505c..038648aea8 100644 --- a/pom.xml +++ b/pom.xml @@ -64,6 +64,7 @@ 3.22.0 9.4.44.v20210927 1.70 + 0.10 3.2.0 2.5.3 @@ -759,6 +760,13 @@ ${bouncycastle.version} test + + com.github.netcrusherorg + netcrusher-core + ${netcrusher.version} + test + + diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java index 10f550d70a..5e5b9016d1 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -21,6 +21,9 @@ import com.rabbitmq.client.impl.AbstractFrameHandlerFactory; import com.rabbitmq.client.impl.FrameHandler; import com.rabbitmq.client.impl.TlsUtils; +import java.nio.channels.Channels; +import java.nio.channels.ReadableByteChannel; +import java.nio.channels.WritableByteChannel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -95,14 +98,23 @@ public FrameHandler create(Address addr, String connectionName) throws IOExcepti channel.connect(address); + if (ssl) { + int initialSoTimeout = channel.socket().getSoTimeout(); + channel.socket().setSoTimeout(this.connectionTimeout); sslEngine.beginHandshake(); try { - boolean handshake = SslEngineHelper.doHandshake(channel, sslEngine); + ReadableByteChannel wrappedReadChannel = Channels.newChannel( + channel.socket().getInputStream()); + WritableByteChannel wrappedWriteChannel = Channels.newChannel( + channel.socket().getOutputStream()); + boolean handshake = SslEngineHelper.doHandshake( + wrappedWriteChannel, wrappedReadChannel, sslEngine); if (!handshake) { LOGGER.error("TLS connection failed"); throw new SSLException("TLS handshake failed"); } + channel.socket().setSoTimeout(initialSoTimeout); } catch (SSLHandshakeException e) { LOGGER.error("TLS connection failed: {}", e.getMessage()); throw e; diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java index bcefe8b205..b7a535da87 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -21,7 +21,6 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.ReadableByteChannel; -import java.nio.channels.SocketChannel; import java.nio.channels.WritableByteChannel; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,7 +37,7 @@ public class SslEngineHelper { private static final Logger LOGGER = LoggerFactory.getLogger(SslEngineHelper.class); - public static boolean doHandshake(SocketChannel socketChannel, SSLEngine engine) throws IOException { + public static boolean doHandshake(WritableByteChannel writeChannel, ReadableByteChannel readChannel, SSLEngine engine) throws IOException { ByteBuffer plainOut = ByteBuffer.allocate(engine.getSession().getApplicationBufferSize()); ByteBuffer plainIn = ByteBuffer.allocate(engine.getSession().getApplicationBufferSize()); @@ -58,11 +57,11 @@ public static boolean doHandshake(SocketChannel socketChannel, SSLEngine engine) break; case NEED_UNWRAP: LOGGER.debug("Unwrapping..."); - handshakeStatus = unwrap(cipherIn, plainIn, socketChannel, engine); + handshakeStatus = unwrap(cipherIn, plainIn, readChannel, engine); break; case NEED_WRAP: LOGGER.debug("Wrapping..."); - handshakeStatus = wrap(plainOut, cipherOut, socketChannel, engine); + handshakeStatus = wrap(plainOut, cipherOut, writeChannel, engine); break; case FINISHED: break; diff --git a/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java index 132cac31cc..4010bc444e 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,31 +15,39 @@ package com.rabbitmq.client.test.ssl; -import com.rabbitmq.client.*; +import static com.rabbitmq.client.test.TestUtils.basicGetBasicConsume; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import com.rabbitmq.client.Connection; +import com.rabbitmq.client.ConnectionFactory; +import com.rabbitmq.client.TrustEverythingTrustManager; import com.rabbitmq.client.impl.nio.NioParams; import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.SocketTimeoutException; import java.util.Collection; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import java.util.stream.Stream; import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; import javax.net.ssl.TrustManager; import org.junit.Test; +import org.netcrusher.core.reactor.NioReactor; +import org.netcrusher.tcp.TcpCrusher; +import org.netcrusher.tcp.TcpCrusherBuilder; import org.slf4j.LoggerFactory; -import javax.net.ssl.SSLEngine; -import java.io.IOException; -import java.util.concurrent.CountDownLatch; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; -import java.util.concurrent.atomic.AtomicBoolean; - -import static com.rabbitmq.client.test.TestUtils.basicGetBasicConsume; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; - /** * */ @@ -149,6 +157,59 @@ public void connectionGetConsumeProtocols() throws Exception { } } + @Test + public void connectionShouldEnforceConnectionTimeout() throws Exception { + int amqpPort = 5671; // assumes RabbitMQ server running on localhost; + int amqpProxyPort = TestUtils.randomNetworkPort(); + + int connectionTimeout = 3_000; + int handshakeTimeout = 1_000; + + try (NioReactor reactor = new NioReactor(); + TcpCrusher tcpProxy = + TcpCrusherBuilder.builder() + .withReactor(reactor) + .withBindAddress(new InetSocketAddress(amqpProxyPort)) + .withConnectAddress("localhost", amqpPort) + .build()) { + + tcpProxy.open(); + tcpProxy.freeze(); + + ConnectionFactory factory = new ConnectionFactory(); + factory.setHost("localhost"); + factory.setPort(amqpProxyPort); + + factory.useSslProtocol(); + factory.useNio(); + + factory.setConnectionTimeout(connectionTimeout); + factory.setHandshakeTimeout(handshakeTimeout); + + ExecutorService executorService = Executors.newSingleThreadExecutor(); + try { + CountDownLatch latch = new CountDownLatch(1); + executorService.submit( + () -> { + try { + factory.newConnection(); + latch.countDown(); + } catch (SocketTimeoutException e) { + latch.countDown(); + } catch (Exception e) { + // not supposed to happen + } + }); + + boolean connectionCreatedTimedOut = latch.await(10, TimeUnit.SECONDS); + assertThat(connectionCreatedTimedOut).isTrue(); + + } finally { + executorService.shutdownNow(); + } + } + } + private void sendAndVerifyMessage(int size) throws Exception { CountDownLatch latch = new CountDownLatch(1); boolean messageReceived = basicGetBasicConsume(connection, QUEUE, latch, size); From fcb9bf84fb759af478a3d74cd213787ed595bdc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 12 Jan 2022 17:03:48 +0100 Subject: [PATCH 046/657] Set timeout on NIO connection Fixes #720 (cherry picked from commit 510389efde7a206dc29e6de70ca4e01764ac4c68) --- .../client/impl/nio/SocketChannelFrameHandlerFactory.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java index 5e5b9016d1..a482ace825 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java @@ -58,12 +58,11 @@ public class SocketChannelFrameHandlerFactory extends AbstractFrameHandlerFactor private final List nioLoopContexts; - public SocketChannelFrameHandlerFactory(int connectionTimeout, NioParams nioParams, boolean ssl, SslContextFactory sslContextFactory) - throws IOException { + public SocketChannelFrameHandlerFactory(int connectionTimeout, NioParams nioParams, boolean ssl, SslContextFactory sslContextFactory) { super(connectionTimeout, null, ssl); this.nioParams = new NioParams(nioParams); this.sslContextFactory = sslContextFactory; - this.nioLoopContexts = new ArrayList(this.nioParams.getNbIoThreads()); + this.nioLoopContexts = new ArrayList<>(this.nioParams.getNbIoThreads()); for (int i = 0; i < this.nioParams.getNbIoThreads(); i++) { this.nioLoopContexts.add(new NioLoopContext(this, this.nioParams)); } @@ -96,7 +95,7 @@ public FrameHandler create(Address addr, String connectionName) throws IOExcepti nioParams.getSocketChannelConfigurator().configure(channel); } - channel.connect(address); + channel.socket().connect(address, this.connectionTimeout); if (ssl) { From 19948ded2b9f3942e63b9d0528384d757e62f368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 13 Jan 2022 14:52:24 +0100 Subject: [PATCH 047/657] Bump dependencies References #717 (cherry picked from commit 42c4d613c0111a7500b769d04905a5c35773d953) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 038648aea8..5b030eda5c 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.7.32 4.2.7 - 1.8.1 + 1.8.2 2.13.1 1.2.10 4.13.2 From 1dc6640cbe69214880aab0b782bb3ba7674afc06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 3 Feb 2022 10:43:53 +0100 Subject: [PATCH 048/657] Use publish confirms in visibility effect test The test started to fail on a 2-node 3.10 cluster while it was OK before. The test expected messages to be almost immediately available in the queues after publishing, which is not realistic, as publishing is asynchronous. This commit enables publish confirms and waits for the confirms to arrive before purging and checking the content of the queues, which is more realistic in terms of expectations. The bulk of the test remains asynchronous in case it would hang like it used to do sometimes. (cherry picked from commit 24fd5953bf81de43066d72a149c73b70b6c02edc) --- .../server/EffectVisibilityCrossNodeTest.java | 43 ++++++++++++++++--- 1 file changed, 37 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java b/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java index b4c9a0bc6a..0070d38c73 100644 --- a/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java +++ b/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java @@ -15,11 +15,15 @@ package com.rabbitmq.client.test.server; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import java.io.IOException; +import java.util.Iterator; +import java.util.Set; import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicReference; import org.junit.Test; import com.rabbitmq.client.test.functional.ClusteredTestBase; @@ -31,16 +35,20 @@ public class EffectVisibilityCrossNodeTest extends ClusteredTestBase { private final String[] queues = new String[QUEUES]; + ExecutorService executorService; + @Override protected void createResources() throws IOException { for (int i = 0; i < queues.length ; i++) { queues[i] = alternateChannel.queueDeclare("", false, false, true, null).getQueue(); alternateChannel.queueBind(queues[i], "amq.fanout", ""); } + executorService = Executors.newSingleThreadExecutor(); } @Override protected void releaseResources() throws IOException { + executorService.shutdownNow(); for (int i = 0; i < queues.length ; i++) { alternateChannel.queueDelete(queues[i]); } @@ -53,14 +61,41 @@ protected void releaseResources() throws IOException { private static final byte[] msg = "".getBytes(); @Test public void effectVisibility() throws Exception { - ExecutorService executorService = Executors.newSingleThreadExecutor(); - try { + AtomicReference confirmLatch = new AtomicReference<>(); + Set publishIds = ConcurrentHashMap.newKeySet(); + channel.addConfirmListener( + (deliveryTag, multiple) -> { + if (multiple) { + Iterator iterator = publishIds.iterator(); + while (iterator.hasNext()) { + long publishId = iterator.next(); + if (publishId <= deliveryTag) { + iterator.remove(); + } + } + } else { + publishIds.remove(deliveryTag); + } + if (publishIds.isEmpty()) { + confirmLatch.get().countDown(); + } + }, + (deliveryTag, multiple) -> {}); + // the test bulk is asynchronous because this test has a history of hanging Future task = executorService.submit(() -> { + // we use publish confirm to make sure messages made it to the queues + // before checking their content + channel.confirmSelect(); for (int i = 0; i < BATCHES; i++) { Thread.sleep(10); // to avoid flow control for the connection + confirmLatch.set(new CountDownLatch(1)); for (int j = 0; j < MESSAGES_PER_BATCH; j++) { + long publishId = channel.getNextPublishSeqNo(); channel.basicPublish("amq.fanout", "", null, msg); + publishIds.add(publishId); } + assertThat(confirmLatch.get().await(10, TimeUnit.SECONDS)).isTrue(); + publishIds.clear(); for (int j = 0; j < queues.length; j++) { assertEquals(MESSAGES_PER_BATCH, channel.queuePurge(queues[j]).getMessageCount()); } @@ -68,9 +103,5 @@ protected void releaseResources() throws IOException { return null; }); task.get(1, TimeUnit.MINUTES); - } finally { - executorService.shutdownNow(); - executorService.awaitTermination(1, TimeUnit.SECONDS); - } } } From 2f1cab3a2c4eec553739db862ec3aef59382863f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 3 Feb 2022 11:30:47 +0100 Subject: [PATCH 049/657] Report unconfirmed messages in test (cherry picked from commit e237496c8eb08965d54b3c25d3866cdaedf31a16) --- .../client/test/server/EffectVisibilityCrossNodeTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java b/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java index 0070d38c73..17ac78e5d2 100644 --- a/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java +++ b/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java @@ -24,6 +24,7 @@ import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicReference; +import org.junit.Assert; import org.junit.Test; import com.rabbitmq.client.test.functional.ClusteredTestBase; @@ -94,7 +95,10 @@ protected void releaseResources() throws IOException { channel.basicPublish("amq.fanout", "", null, msg); publishIds.add(publishId); } - assertThat(confirmLatch.get().await(10, TimeUnit.SECONDS)).isTrue(); + boolean confirmed = confirmLatch.get().await(10, TimeUnit.SECONDS); + if (!confirmed) { + Assert.fail("Messages not confirmed in 10 seconds: " + publishIds); + } publishIds.clear(); for (int j = 0; j < queues.length; j++) { assertEquals(MESSAGES_PER_BATCH, channel.queuePurge(queues[j]).getMessageCount()); From ad936582838e7934802abf2d89676147c1d14c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 3 Feb 2022 14:29:59 +0100 Subject: [PATCH 050/657] Register publish ID before sending message (cherry picked from commit 34b2f30a4bf6dac9cc3c24af752bd3de54aa4ce6) --- .../client/test/server/EffectVisibilityCrossNodeTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java b/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java index 17ac78e5d2..2a8dbe1df3 100644 --- a/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java +++ b/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java @@ -92,8 +92,8 @@ protected void releaseResources() throws IOException { confirmLatch.set(new CountDownLatch(1)); for (int j = 0; j < MESSAGES_PER_BATCH; j++) { long publishId = channel.getNextPublishSeqNo(); - channel.basicPublish("amq.fanout", "", null, msg); publishIds.add(publishId); + channel.basicPublish("amq.fanout", "", null, msg); } boolean confirmed = confirmLatch.get().await(10, TimeUnit.SECONDS); if (!confirmed) { From f9a6253f86f9893b836097f3d40b470e636e2a8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 3 Feb 2022 14:52:20 +0100 Subject: [PATCH 051/657] Retry until queue is fully purged The test remains flaky even with publish confirms. Purging the queue repeatedly until all published messages have been purged serves the same purpose of eventual visibility. (cherry picked from commit faeed579f4ecbed0664f10dbed04c774f8687aeb) --- .../server/EffectVisibilityCrossNodeTest.java | 69 +++++++------------ 1 file changed, 24 insertions(+), 45 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java b/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java index 2a8dbe1df3..bf3c56bf58 100644 --- a/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java +++ b/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java @@ -15,16 +15,11 @@ package com.rabbitmq.client.test.server; -import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import java.io.IOException; -import java.util.Iterator; -import java.util.Set; import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicReference; -import org.junit.Assert; import org.junit.Test; import com.rabbitmq.client.test.functional.ClusteredTestBase; @@ -62,49 +57,33 @@ protected void releaseResources() throws IOException { private static final byte[] msg = "".getBytes(); @Test public void effectVisibility() throws Exception { - AtomicReference confirmLatch = new AtomicReference<>(); - Set publishIds = ConcurrentHashMap.newKeySet(); - channel.addConfirmListener( - (deliveryTag, multiple) -> { - if (multiple) { - Iterator iterator = publishIds.iterator(); - while (iterator.hasNext()) { - long publishId = iterator.next(); - if (publishId <= deliveryTag) { - iterator.remove(); - } - } - } else { - publishIds.remove(deliveryTag); - } - if (publishIds.isEmpty()) { - confirmLatch.get().countDown(); + // the test bulk is asynchronous because this test has a history of hanging + Future task = + executorService.submit( + () -> { + for (int i = 0; i < BATCHES; i++) { + Thread.sleep(10); // to avoid flow control for the connection + for (int j = 0; j < MESSAGES_PER_BATCH; j++) { + channel.basicPublish("amq.fanout", "", null, msg); } - }, - (deliveryTag, multiple) -> {}); - // the test bulk is asynchronous because this test has a history of hanging - Future task = executorService.submit(() -> { - // we use publish confirm to make sure messages made it to the queues - // before checking their content - channel.confirmSelect(); - for (int i = 0; i < BATCHES; i++) { - Thread.sleep(10); // to avoid flow control for the connection - confirmLatch.set(new CountDownLatch(1)); - for (int j = 0; j < MESSAGES_PER_BATCH; j++) { - long publishId = channel.getNextPublishSeqNo(); - publishIds.add(publishId); - channel.basicPublish("amq.fanout", "", null, msg); - } - boolean confirmed = confirmLatch.get().await(10, TimeUnit.SECONDS); - if (!confirmed) { - Assert.fail("Messages not confirmed in 10 seconds: " + publishIds); - } - publishIds.clear(); - for (int j = 0; j < queues.length; j++) { - assertEquals(MESSAGES_PER_BATCH, channel.queuePurge(queues[j]).getMessageCount()); + for (int j = 0; j < queues.length; j++) { + String queue = queues[j]; + long timeout = 10 * 1000; + long waited = 0; + int purged = 0; + while (waited < timeout) { + purged += channel.queuePurge(queue).getMessageCount(); + if (purged == MESSAGES_PER_BATCH) { + break; } + Thread.sleep(10); + waited += 10; + } + assertEquals("Queue " + queue + " should have been purged after 10 seconds", + MESSAGES_PER_BATCH, purged); } - return null; + } + return null; }); task.get(1, TimeUnit.MINUTES); } From 1e96924fe0f01a75d11f0f5f763a7b38ccab95d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 4 Feb 2022 09:05:36 +0100 Subject: [PATCH 052/657] Log test execution start and end CI jobs hang regularly, this could help to tell whether the cause is the tests themselves or something in the CI environment. (cherry picked from commit 8d9f1ff8ce115cf719b571a10281403870e7966d) --- src/test/resources/logback-test.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index ee88f442c2..596182704c 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -5,6 +5,8 @@ + + From dddf081c84f7cab594057bf2bba29e9cefa4ea89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 7 Feb 2022 11:18:22 +0100 Subject: [PATCH 053/657] Add logging to topic permissions test Test tends to hang on CI. (cherry picked from commit f2e5a24bf078bfb3d95cc68dee221080bca7704f) --- .../client/test/server/TopicPermissions.java | 15 +++++++++++++++ src/test/resources/logback-test.xml | 1 + 2 files changed, 16 insertions(+) diff --git a/src/test/java/com/rabbitmq/client/test/server/TopicPermissions.java b/src/test/java/com/rabbitmq/client/test/server/TopicPermissions.java index 5b79de1387..323b9cba65 100644 --- a/src/test/java/com/rabbitmq/client/test/server/TopicPermissions.java +++ b/src/test/java/com/rabbitmq/client/test/server/TopicPermissions.java @@ -25,36 +25,45 @@ import java.io.IOException; import java.util.concurrent.Callable; import java.util.concurrent.TimeoutException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import static org.junit.Assert.fail; public class TopicPermissions extends BrokerTestCase { + private static final Logger LOGGER = LoggerFactory.getLogger(TopicPermissions.class); + String protectedTopic = "protected.topic"; String notProtectedTopic = "not.protected.topic"; String noneTopicExchange = "not.a.topic"; @Override protected boolean shouldRun() throws IOException { + LOGGER.debug("Checking if test should run"); return Host.isRabbitMqCtlCommandAvailable("set_topic_permissions"); } @Override protected void createResources() throws IOException, TimeoutException { + LOGGER.debug("Creating AMQP resources"); channel.exchangeDeclare(protectedTopic, BuiltinExchangeType.TOPIC); channel.exchangeDeclare(notProtectedTopic, BuiltinExchangeType.TOPIC); channel.exchangeDeclare(noneTopicExchange, BuiltinExchangeType.DIRECT); + LOGGER.debug("Setting permissions"); Host.rabbitmqctl("set_topic_permissions -p / guest " + protectedTopic + " \"^{username}\" \"^{username}\""); Host.rabbitmqctl("set_topic_permissions -p / guest " + noneTopicExchange + " \"^{username}\" \"^{username}\""); } @Override protected void releaseResources() throws IOException { + LOGGER.debug("Deleting AMQP resources"); channel.exchangeDelete(protectedTopic); channel.exchangeDelete(notProtectedTopic); channel.exchangeDelete(noneTopicExchange); + LOGGER.debug("Clearing permissions"); Host.rabbitmqctl("clear_topic_permissions -p / guest"); } @@ -107,14 +116,18 @@ public void topicPermissions() throws IOException { } void assertAccessOk(String description, Callable action) { + LOGGER.debug("Running '" + description + "'"); try { action.call(); } catch(Exception e) { fail(description + " (" + e.getMessage()+")"); + } finally { + LOGGER.debug("'" + description + "' done"); } } void assertAccessRefused(String description, Callable action) throws IOException { + LOGGER.debug("Running '" + description + "'"); try { action.call(); fail(description); @@ -126,6 +139,8 @@ void assertAccessRefused(String description, Callable action) throws IOExc openChannel(); } catch(Exception e) { fail("Unexpected exception: " + e.getMessage()); + } finally { + LOGGER.debug("'" + description + "' done"); } } } diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 596182704c..90ebf5307e 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -6,6 +6,7 @@ + From b78e803d41a231b891b4ade5fdff53abd54a643b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 7 Feb 2022 12:04:20 +0100 Subject: [PATCH 054/657] Handle process better in Host The method to check if a command exists asks for the help of this command now (instead of checking if the command name is in the output of rabbitmqctl). This way we just have to check the exit code (0 if the command exists). We also use a timeout to wait for the end of the process. A test hangs on the CI environment, these changes try to fix this. (cherry picked from commit 6b2251fe05684f39eca99eb846179df4c0d91e7e) --- src/test/java/com/rabbitmq/tools/Host.java | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/rabbitmq/tools/Host.java b/src/test/java/com/rabbitmq/tools/Host.java index e81aef9a93..74be79b66c 100644 --- a/src/test/java/com/rabbitmq/tools/Host.java +++ b/src/test/java/com/rabbitmq/tools/Host.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -28,12 +28,17 @@ import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.impl.NetworkConnection; import com.rabbitmq.client.test.TestUtils; +import java.util.concurrent.TimeUnit; import java.util.function.Predicate; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Host { + private static final Logger LOGGER = LoggerFactory.getLogger(Host.class); + private static final String DOCKER_PREFIX = "DOCKER:"; private static final Pattern CONNECTION_NAME_PATTERN = Pattern.compile("\"connection_name\",\"(?[a-zA-Z0-9\\-]+)?\""); @@ -78,7 +83,14 @@ private static int waitForExitValue(Process pr) { public static Process executeCommandIgnoringErrors(String command) throws IOException { Process pr = executeCommandProcess(command); - waitForExitValue(pr); + boolean exited = false; + try { + exited = pr.waitFor(30, TimeUnit.SECONDS); + } catch (InterruptedException e) { + } + if (!exited) { + LOGGER.warn("Command '{}' did not finish in 30 seconds", command); + } return pr; } @@ -101,9 +113,9 @@ private static Process executeCommandProcess(String command) throws IOException } public static boolean isRabbitMqCtlCommandAvailable(String command) throws IOException { - Process process = rabbitmqctlIgnoreErrors(""); - String stderr = capture(process.getErrorStream()); - return stderr.contains(command); + Process process = rabbitmqctlIgnoreErrors(command + " --help"); + int exitValue = process.exitValue(); + return exitValue == 0; } public static Process rabbitmqctl(String command) throws IOException { From 8da31a37673c6058e16bcc7f4bb00dee9278cc6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 7 Feb 2022 14:30:53 +0100 Subject: [PATCH 055/657] Pump process inputs before checking completion Process completion methods can hang because internal buffers are full. This commit "pumps" the inputs before calling the completion method, which should help to finish properly the command call. (cherry picked from commit 17afacafdb58c37d987a5ad1eb1457c9ffbb7824) --- src/test/java/com/rabbitmq/tools/Host.java | 69 ++++++++++++++++++---- 1 file changed, 58 insertions(+), 11 deletions(-) diff --git a/src/test/java/com/rabbitmq/tools/Host.java b/src/test/java/com/rabbitmq/tools/Host.java index 74be79b66c..ee3b6a59f3 100644 --- a/src/test/java/com/rabbitmq/tools/Host.java +++ b/src/test/java/com/rabbitmq/tools/Host.java @@ -54,25 +54,68 @@ public static String capture(InputStream is) return buff.toString(); } - public static Process executeCommand(String command) throws IOException + public static ProcessState executeCommand(String command) throws IOException { Process pr = executeCommandProcess(command); + InputStreamPumpState inputState = new InputStreamPumpState(pr.getInputStream()); + InputStreamPumpState errorState = new InputStreamPumpState(pr.getErrorStream()); - int ev = waitForExitValue(pr); + int ev = waitForExitValue(pr, inputState, errorState); + inputState.pump(); + errorState.pump(); if (ev != 0) { - 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"); + "\nstdout:\n" + inputState.buffer.toString() + + "\nstderr:\n" + errorState.buffer.toString() + "\n"); } - return pr; + return new ProcessState(pr, inputState, errorState); + } + + static class ProcessState { + + private final Process process; + private final InputStreamPumpState inputState; + private final InputStreamPumpState errorState; + + ProcessState(Process process, InputStreamPumpState inputState, + InputStreamPumpState errorState) { + this.process = process; + this.inputState = inputState; + this.errorState = errorState; + } + + private 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() throws IOException { + String line; + while ((line = reader.readLine()) != null) { + buffer.append(line).append("\n"); + } + } + } - private static int waitForExitValue(Process pr) { + private static int waitForExitValue(Process pr, InputStreamPumpState inputState, + InputStreamPumpState errorState) throws IOException { while(true) { try { + inputState.pump(); + errorState.pump(); pr.waitFor(); break; } catch (InterruptedException ignored) {} @@ -83,6 +126,10 @@ private static int waitForExitValue(Process pr) { public static Process executeCommandIgnoringErrors(String command) throws IOException { Process pr = executeCommandProcess(command); + InputStreamPumpState inputState = new InputStreamPumpState(pr.getInputStream()); + InputStreamPumpState errorState = new InputStreamPumpState(pr.getErrorStream()); + inputState.pump(); + errorState.pump(); boolean exited = false; try { exited = pr.waitFor(30, TimeUnit.SECONDS); @@ -118,7 +165,7 @@ public static boolean isRabbitMqCtlCommandAvailable(String command) throws IOExc return exitValue == 0; } - public static Process rabbitmqctl(String command) throws IOException { + public static ProcessState rabbitmqctl(String command) throws IOException { return executeCommand(rabbitmqctlCommand() + rabbitmqctlNodenameArgument() + " " + command); @@ -142,7 +189,7 @@ public static void clearResourceAlarm(String source) throws IOException { rabbitmqctl("eval 'rabbit_alarm:clear_alarm({resource_limit, " + source + ", node()}).'"); } - public static Process invokeMakeTarget(String command) throws IOException { + public static ProcessState invokeMakeTarget(String command) throws IOException { File rabbitmqctl = new File(rabbitmqctlCommand()); return executeCommand(makeCommand() + " -C \'" + rabbitmqDir() + "\'" + @@ -307,7 +354,7 @@ public String toString() { } public static List listConnections() throws IOException { - String output = capture(rabbitmqctl("list_connections -q pid peer_port client_properties").getInputStream()); + String output = rabbitmqctl("list_connections -q pid peer_port client_properties").output(); // output (header line presence depends on broker version): // pid peer_port // 58713 From b53e5ca2bf8abdf6967be3b79b3c85e2736b32da Mon Sep 17 00:00:00 2001 From: Laurent Perez Date: Wed, 9 Feb 2022 15:14:19 +0100 Subject: [PATCH 056/657] topology : fix connection factory property evaluation (cherry picked from commit ed7a83aa1abe584025383f43ec6625b9cffa9cb3) --- .../java/com/rabbitmq/client/ConnectionFactoryConfigurator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/client/ConnectionFactoryConfigurator.java b/src/main/java/com/rabbitmq/client/ConnectionFactoryConfigurator.java index d59770380e..66f4a3742d 100644 --- a/src/main/java/com/rabbitmq/client/ConnectionFactoryConfigurator.java +++ b/src/main/java/com/rabbitmq/client/ConnectionFactoryConfigurator.java @@ -210,7 +210,7 @@ public static void load(ConnectionFactory cf, Map properties, St } String topologyRecovery = lookUp(TOPOLOGY_RECOVERY_ENABLED, properties, prefix); if (topologyRecovery != null) { - cf.setTopologyRecoveryEnabled(Boolean.getBoolean(topologyRecovery)); + cf.setTopologyRecoveryEnabled(Boolean.valueOf(topologyRecovery)); } String networkRecoveryInterval = lookUp(CONNECTION_RECOVERY_INTERVAL, properties, prefix); if (networkRecoveryInterval != null) { From 7e6c46c9462204dba54ce7a93f5ed3d87bece338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 16 Feb 2022 09:24:57 +0100 Subject: [PATCH 057/657] Bump dependencies References #717 (cherry picked from commit b613dc1f277de28de63caa6cd6e5bcdf2a0c0c10) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 5b030eda5c..27120dacd5 100644 --- a/pom.xml +++ b/pom.xml @@ -54,8 +54,8 @@ UTF-8 UTF-8 - 1.7.32 - 4.2.7 + 1.7.36 + 4.2.8 1.8.2 2.13.1 1.2.10 From ba9c54849bb26d645299eab6a4ecc93d1fb876f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 16 Feb 2022 09:25:57 +0100 Subject: [PATCH 058/657] Bump test dependencies (cherry picked from commit 99c4e738b037a00b9eb1878847f4cc75e1188ccb) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 27120dacd5..78534eb35b 100644 --- a/pom.xml +++ b/pom.xml @@ -60,9 +60,9 @@ 2.13.1 1.2.10 4.13.2 - 4.2.0 + 4.3.1 3.22.0 - 9.4.44.v20210927 + 9.4.45.v20220203 1.70 0.10 From 7e38ec9597ecd550f902a9201f6b03b065f6d7a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 21 Feb 2022 10:26:59 +0100 Subject: [PATCH 059/657] Add log before starting each test CI environment hangs sometimes, this should help diagnose if a test in particular is hanging. (cherry picked from commit 02fba0c106c6f3fe4ff6d4ec505a27c09bc78aca) --- .../com/rabbitmq/client/test/ClientTests.java | 4 +- .../client/test/RequiredPropertiesSuite.java | 11 +++++ .../com/rabbitmq/client/test/TestUtils.java | 46 ++++++++++++++++++- .../test/functional/FunctionalTests.java | 2 +- .../rabbitmq/client/test/ssl/SSLTests.java | 15 +++++- src/test/resources/logback-test.xml | 3 ++ 6 files changed, 75 insertions(+), 6 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/test/ClientTests.java b/src/test/java/com/rabbitmq/client/test/ClientTests.java index 681542ab70..b8550640ca 100644 --- a/src/test/java/com/rabbitmq/client/test/ClientTests.java +++ b/src/test/java/com/rabbitmq/client/test/ClientTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -27,7 +27,7 @@ import org.junit.runner.RunWith; import org.junit.runners.Suite; -@RunWith(Suite.class) +@RunWith(TestUtils.DefaultTestSuite.class) @Suite.SuiteClasses({ TableTest.class, LongStringTest.class, diff --git a/src/test/java/com/rabbitmq/client/test/RequiredPropertiesSuite.java b/src/test/java/com/rabbitmq/client/test/RequiredPropertiesSuite.java index b97a0b0af6..f8ab431800 100644 --- a/src/test/java/com/rabbitmq/client/test/RequiredPropertiesSuite.java +++ b/src/test/java/com/rabbitmq/client/test/RequiredPropertiesSuite.java @@ -1,18 +1,23 @@ package com.rabbitmq.client.test; import org.junit.runner.Runner; +import org.junit.runner.notification.RunNotifier; import org.junit.runners.Suite; import org.junit.runners.model.InitializationError; import org.junit.runners.model.RunnerBuilder; import java.util.ArrayList; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * */ public class RequiredPropertiesSuite extends Suite { + private static final Logger LOGGER = LoggerFactory.getLogger(RequiredPropertiesSuite.class); + public RequiredPropertiesSuite(Class klass, RunnerBuilder builder) throws InitializationError { super(klass, builder); } @@ -41,4 +46,10 @@ protected List getChildren() { return super.getChildren(); } } + + @Override + protected void runChild(Runner runner, RunNotifier notifier) { + LOGGER.info("Running test {}", runner.getDescription().getDisplayName()); + super.runChild(runner, notifier); + } } diff --git a/src/test/java/com/rabbitmq/client/test/TestUtils.java b/src/test/java/com/rabbitmq/client/test/TestUtils.java index c488fcff6d..0c0ea49a89 100644 --- a/src/test/java/com/rabbitmq/client/test/TestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/TestUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -19,11 +19,18 @@ import com.rabbitmq.client.impl.NetworkConnection; import com.rabbitmq.client.impl.recovery.AutorecoveringConnection; import com.rabbitmq.tools.Host; +import java.util.List; import org.assertj.core.api.Assertions; import org.junit.AssumptionViolatedException; import org.junit.rules.TestRule; import org.junit.runner.Description; +import org.junit.runner.Runner; +import org.junit.runner.notification.RunNotifier; +import org.junit.runners.Suite; +import org.junit.runners.model.InitializationError; +import org.junit.runners.model.RunnerBuilder; import org.junit.runners.model.Statement; +import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; @@ -40,6 +47,8 @@ public class TestUtils { + private static final Logger LOGGER = LoggerFactory.getLogger(TestUtils.class); + public static final boolean USE_NIO = System.getProperty("use.nio") != null; public static ConnectionFactory connectionFactory() { @@ -364,4 +373,39 @@ public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProp return messageReceived; } + + public static class DefaultTestSuite extends Suite { + + + public DefaultTestSuite(Class klass, RunnerBuilder builder) + throws InitializationError { + super(klass, builder); + } + + public DefaultTestSuite(RunnerBuilder builder, Class[] classes) + throws InitializationError { + super(builder, classes); + } + + protected DefaultTestSuite(Class klass, Class[] suiteClasses) + throws InitializationError { + super(klass, suiteClasses); + } + + protected DefaultTestSuite(RunnerBuilder builder, Class klass, Class[] suiteClasses) + throws InitializationError { + super(builder, klass, suiteClasses); + } + + @Override + protected void runChild(Runner runner, RunNotifier notifier) { + LOGGER.info("Running test {}", runner.getDescription().getDisplayName()); + super.runChild(runner, notifier); + } + + protected DefaultTestSuite(Class klass, List runners) + throws InitializationError { + super(klass, runners); + } + } } diff --git a/src/test/java/com/rabbitmq/client/test/functional/FunctionalTests.java b/src/test/java/com/rabbitmq/client/test/functional/FunctionalTests.java index db87a38695..892f4977ba 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/FunctionalTests.java +++ b/src/test/java/com/rabbitmq/client/test/functional/FunctionalTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ssl/SSLTests.java b/src/test/java/com/rabbitmq/client/test/ssl/SSLTests.java index 3d629d15ea..758d87118a 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/SSLTests.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/SSLTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -20,12 +20,15 @@ import com.rabbitmq.client.test.SslContextFactoryTest; import org.junit.runner.RunWith; import org.junit.runner.Runner; +import org.junit.runner.notification.RunNotifier; import org.junit.runners.Suite; import org.junit.runners.model.InitializationError; import org.junit.runners.model.RunnerBuilder; import java.util.ArrayList; import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @RunWith(SSLTests.SslSuite.class) @Suite.SuiteClasses({ @@ -40,6 +43,8 @@ }) public class SSLTests { + private static final Logger LOGGER = LoggerFactory.getLogger(SSLTests.class); + // initialize system properties static{ new AbstractRMQTestSuite(){}; @@ -70,11 +75,17 @@ protected SslSuite(Class klass, List runners) throws InitializationEr @Override protected List getChildren() { if(!AbstractRMQTestSuite.requiredProperties() && !AbstractRMQTestSuite.isSSLAvailable()) { - return new ArrayList(); + return new ArrayList<>(); } else { return super.getChildren(); } } + + @Override + protected void runChild(Runner runner, RunNotifier notifier) { + LOGGER.info("Running test {}", runner.getDescription().getDisplayName()); + super.runChild(runner, notifier); + } } } diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 90ebf5307e..5874c1c8c4 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -5,6 +5,9 @@ + + + From 04b060dbb28b61ff70af522403be3ad1d9e3d3c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 25 Feb 2022 16:24:33 +0100 Subject: [PATCH 060/657] Copy element-list to package-list in Javadoc deployment For Java8-generated Javadoc to link correctly to the library Javadoc whatever Java version used to generate it. See https://bugs.openjdk.java.net/browse/JDK-8211194. (cherry picked from commit 04bc4caed4a89b9da8e8815d1771e00ed189a79d) --- deploy-javadoc.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deploy-javadoc.sh b/deploy-javadoc.sh index 74878215e9..46cdb09398 100755 --- a/deploy-javadoc.sh +++ b/deploy-javadoc.sh @@ -5,6 +5,11 @@ TAG=$(git describe --exact-match --tags $(git log -n1 --pretty='%h')) make deps ./mvnw -q clean javadoc:javadoc -Dmaven.javadoc.failOnError=false + +if [ -e target/site/apidocs/element-list ] + then cp target/site/apidocs/element-list target/site/apidocs/package-list +fi + git co gh-pages rm -rf $DEPLOY_DIRECTORY/* cp -r target/site/apidocs/* $DEPLOY_DIRECTORY From 896fc56d6c61e6ffa23be27648a6971b67b48fad Mon Sep 17 00:00:00 2001 From: David Ansari Date: Sun, 27 Feb 2022 15:19:59 +0100 Subject: [PATCH 061/657] Add tests for any-with-x and all-with-x for x-match binding argument in headers exchange (cherry picked from commit 7e92c2df240f326c4afff3eb803cf1efeda65f9f) --- .../functional/HeadersExchangeValidation.java | 6 +++ .../client/test/functional/Routing.java | 45 +++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java b/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java index b2eeee7719..e62dd04d0b 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java +++ b/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java @@ -47,6 +47,12 @@ public class HeadersExchangeValidation extends BrokerTestCase { arguments.put("x-match", "any"); succeedBind(queue, arguments); + + arguments.put("x-match", "all-with-x"); + succeedBind(queue, arguments); + + arguments.put("x-match", "any-with-x"); + succeedBind(queue, arguments); } private void failBind(String queue, HashMap arguments) { diff --git a/src/test/java/com/rabbitmq/client/test/functional/Routing.java b/src/test/java/com/rabbitmq/client/test/functional/Routing.java index 050eb379b0..45161acddc 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Routing.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Routing.java @@ -170,6 +170,7 @@ private void checkGet(String queue, boolean messageExpected) spec.put("h1", "12345"); spec.put("h2", "bar"); spec.put("h3", null); + spec.put("x-key-1", "bindings starting with x- get filtered out"); spec.put("x-match", "all"); channel.queueBind(Q1, "amq.match", "", spec); spec.put("x-match", "any"); @@ -226,6 +227,10 @@ private void checkGet(String queue, boolean messageExpected) map.put("h2", "quux"); channel.basicPublish("amq.match", "", props.build(), "8".getBytes()); + map.clear(); + map.put("x-key-1", "bindings starting with x- get filtered out"); + channel.basicPublish("amq.match", "", props.build(), "9".getBytes()); + checkGet(Q1, true); // 4 checkGet(Q1, false); @@ -240,6 +245,46 @@ private void checkGet(String queue, boolean messageExpected) checkGet(Q2, false); } + @Test public void headersWithXRouting() throws Exception { + Map spec = new HashMap(); + spec.put("x-key-1", "value-1"); + spec.put("x-key-2", "value-2"); + spec.put("x-match", "all-with-x"); + channel.queueBind(Q1, "amq.match", "", spec); + spec.put("x-match", "any-with-x"); + channel.queueBind(Q2, "amq.match", "", spec); + + AMQP.BasicProperties.Builder props = new AMQP.BasicProperties.Builder(); + channel.basicPublish("amq.match", "", props.build(), "0".getBytes()); + + Map map = new HashMap(); + props.headers(map); + + map.clear(); + map.put("x-key-1", "value-1"); + channel.basicPublish("amq.match", "", props.build(), "1".getBytes()); + + map.clear(); + map.put("x-key-1", "value-1"); + map.put("x-key-2", "value-2"); + channel.basicPublish("amq.match", "", props.build(), "2".getBytes()); + + map.clear(); + map.put("x-key-1", "value-1"); + map.put("x-key-2", "value-2"); + map.put("x-key-3", "value-3"); + channel.basicPublish("amq.match", "", props.build(), "3".getBytes()); + + checkGet(Q1, true); // 2 + checkGet(Q1, true); // 3 + checkGet(Q1, false); + + checkGet(Q2, true); // 1 + checkGet(Q2, true); // 2 + checkGet(Q2, true); // 3 + checkGet(Q2, false); + } + @Test public void basicReturn() throws IOException { channel.addReturnListener(makeReturnListener()); returnCell = new BlockingCell(); From f5cf5cb0e6075b3bfc4005f89788a85d4f66118b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 28 Feb 2022 09:57:24 +0100 Subject: [PATCH 062/657] Add test condition to test x-match=all-with-x Broker version >= 3.10. References #725 (cherry picked from commit 0b7d8f0b778aa1bbd7eb13e517abf84b2782fafe) --- .../com/rabbitmq/client/test/TestUtils.java | 57 +++++++++++++++++++ .../functional/HeadersExchangeValidation.java | 13 +++-- .../client/test/functional/Routing.java | 13 ++++- 3 files changed, 76 insertions(+), 7 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/test/TestUtils.java b/src/test/java/com/rabbitmq/client/test/TestUtils.java index 0c0ea49a89..86605d71f9 100644 --- a/src/test/java/com/rabbitmq/client/test/TestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/TestUtils.java @@ -19,6 +19,11 @@ import com.rabbitmq.client.impl.NetworkConnection; import com.rabbitmq.client.impl.recovery.AutorecoveringConnection; import com.rabbitmq.tools.Host; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.reflect.Method; import java.util.List; import org.assertj.core.api.Assertions; import org.junit.AssumptionViolatedException; @@ -130,6 +135,10 @@ public static boolean isVersion38orLater(Connection connection) { return atLeastVersion("3.8.0", connection); } + public static boolean isVersion310orLater(Connection connection) { + return atLeastVersion("3.10.0", connection); + } + private static boolean atLeastVersion(String expectedVersion, Connection connection) { String currentVersion = null; try { @@ -408,4 +417,52 @@ protected DefaultTestSuite(Class klass, List runners) super(klass, runners); } } + + @Target({ElementType.METHOD}) + @Retention(RetentionPolicy.RUNTIME) + public @interface TestExecutionCondition { + + Class[] value(); + + } + + interface ExecutionCondition { + + void check(Description description) throws Exception; + + } + + public static class BrokerAtLeast310Condition implements ExecutionCondition { + + private static final String VERSION = "3.10.0"; + + @Override + public void check(Description description) throws Exception { + try (Connection c = TestUtils.connectionFactory().newConnection()) { + if (!TestUtils.atLeastVersion(VERSION, c)) { + throw new AssumptionViolatedException("Broker version < " + VERSION + ", skipping."); + } + } + } + } + + public static class ExecutionConditionRule implements TestRule { + + @Override + public Statement apply(Statement base, Description description) { + return new Statement() { + @Override + public void evaluate() throws Throwable { + Method testMethod = description.getTestClass().getDeclaredMethod(description.getMethodName()); + TestExecutionCondition conditionAnnotation = testMethod.getAnnotation( + TestExecutionCondition.class); + if (conditionAnnotation != null) { + conditionAnnotation.value()[0].getConstructor().newInstance() + .check(description); + } + base.evaluate(); + } + }; + } + } } diff --git a/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java b/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java index e62dd04d0b..c82ed749b6 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java +++ b/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,6 +17,7 @@ import static org.junit.Assert.fail; +import com.rabbitmq.client.test.TestUtils; import java.io.IOException; import java.util.HashMap; @@ -48,11 +49,13 @@ public class HeadersExchangeValidation extends BrokerTestCase { arguments.put("x-match", "any"); succeedBind(queue, arguments); - arguments.put("x-match", "all-with-x"); - succeedBind(queue, arguments); + if (TestUtils.isVersion310orLater(connection)) { + arguments.put("x-match", "all-with-x"); + succeedBind(queue, arguments); - arguments.put("x-match", "any-with-x"); - succeedBind(queue, arguments); + arguments.put("x-match", "any-with-x"); + succeedBind(queue, arguments); + } } private void failBind(String queue, HashMap arguments) { diff --git a/src/test/java/com/rabbitmq/client/test/functional/Routing.java b/src/test/java/com/rabbitmq/client/test/functional/Routing.java index 45161acddc..30a643a918 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Routing.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Routing.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -21,6 +21,9 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.fail; +import com.rabbitmq.client.test.TestUtils.BrokerAtLeast310Condition; +import com.rabbitmq.client.test.TestUtils.ExecutionConditionRule; +import com.rabbitmq.client.test.TestUtils.TestExecutionCondition; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -28,6 +31,7 @@ import java.util.Map; import java.util.concurrent.TimeoutException; +import org.junit.Rule; import org.junit.Test; import com.rabbitmq.client.AMQP; @@ -36,10 +40,13 @@ import com.rabbitmq.client.ReturnListener; import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.utility.BlockingCell; +import org.junit.rules.TestRule; public class Routing extends BrokerTestCase { + @Rule public TestRule executionConditionRule = new ExecutionConditionRule(); + protected final String E = "MRDQ"; protected final String Q1 = "foo"; protected final String Q2 = "bar"; @@ -245,7 +252,9 @@ private void checkGet(String queue, boolean messageExpected) checkGet(Q2, false); } - @Test public void headersWithXRouting() throws Exception { + @Test + @TestExecutionCondition(BrokerAtLeast310Condition.class) + public void headersWithXRouting() throws Exception { Map spec = new HashMap(); spec.put("x-key-1", "value-1"); spec.put("x-key-2", "value-2"); From b8ecfaf96aa88e9643530dae8ecd9511134529f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 11 Mar 2022 11:38:17 +0100 Subject: [PATCH 063/657] Set -Dmaven.wagon.http.retryHandler.count=10 in .mvn/maven.config Trying to help download dependencing from CI. (cherry picked from commit 80440298e3179c28fcb1c4a398bd95b1858ce42b) --- .mvn/maven.config | 1 + 1 file changed, 1 insertion(+) create mode 100644 .mvn/maven.config diff --git a/.mvn/maven.config b/.mvn/maven.config new file mode 100644 index 0000000000..f373d1de10 --- /dev/null +++ b/.mvn/maven.config @@ -0,0 +1 @@ +-Dmaven.wagon.http.retryHandler.count=10 From c1735cafa0b7a4bae9547b5a7d8e5443f09b07ea Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Fri, 11 Mar 2022 18:50:23 +0400 Subject: [PATCH 064/657] Wording (cherry picked from commit 0c933cb2c659e014df60e07352f163ecbae1641a) Conflicts: src/main/java/com/rabbitmq/client/impl/AMQConnection.java --- src/main/java/com/rabbitmq/client/impl/AMQConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/AMQConnection.java b/src/main/java/com/rabbitmq/client/impl/AMQConnection.java index 2592345baa..61b7a678a9 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQConnection.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQConnection.java @@ -750,8 +750,8 @@ private void readFrame(Frame frame) throws IOException { /** private API */ public void handleHeartbeatFailure() { - Exception ex = new MissedHeartbeatException("Heartbeat missing with heartbeat = " + - _heartbeat + " seconds"); + Exception ex = new MissedHeartbeatException("Detected missed server heartbeats, heartbeat interval: " + + _heartbeat + " seconds, RabbitMQ node hostname: " + this.getHostAddress()); try { _exceptionHandler.handleUnexpectedConnectionDriverException(this, ex); shutdown(null, false, ex, true); From 659c21fdcc3e7d5f16e84468c6a184beaac8da16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 30 Mar 2022 15:15:13 +0200 Subject: [PATCH 065/657] Use available processor number for default thread count in consumer work service The current value is available processors times 2, which may be overkill nowadays. The commit also allows using the rabbitmq.amqp.client.availableProcessors system property value, which is convenient as it's configuration-based (no code changes required). Fixes #730 (cherry picked from commit 49c5e2cf5c55bf0a775550004a7e168eeea6d413) --- .../client/impl/ConsumerWorkService.java | 15 ++++++--- .../java/com/rabbitmq/client/impl/Utils.java | 31 +++++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/rabbitmq/client/impl/Utils.java diff --git a/src/main/java/com/rabbitmq/client/impl/ConsumerWorkService.java b/src/main/java/com/rabbitmq/client/impl/ConsumerWorkService.java index b3810aae2f..f607e816e3 100644 --- a/src/main/java/com/rabbitmq/client/impl/ConsumerWorkService.java +++ b/src/main/java/com/rabbitmq/client/impl/ConsumerWorkService.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -22,10 +22,13 @@ import java.util.concurrent.ThreadFactory; import com.rabbitmq.client.Channel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; final public class ConsumerWorkService { + private static final Logger LOGGER = LoggerFactory.getLogger(ConsumerWorkService.class); private static final int MAX_RUNNABLE_BLOCK_SIZE = 16; - private static final int DEFAULT_NUM_THREADS = Runtime.getRuntime().availableProcessors() * 2; + private static final int DEFAULT_NUM_THREADS = Math.max(1, Utils.availableProcessors()); private final ExecutorService executor; private final boolean privateExecutor; private final WorkPool workPool; @@ -33,8 +36,12 @@ final public class ConsumerWorkService { public ConsumerWorkService(ExecutorService executor, ThreadFactory threadFactory, int queueingTimeout, int shutdownTimeout) { this.privateExecutor = (executor == null); - this.executor = (executor == null) ? Executors.newFixedThreadPool(DEFAULT_NUM_THREADS, threadFactory) - : executor; + if (executor == null) { + LOGGER.debug("Creating executor service with {} thread(s) for consumer work service", DEFAULT_NUM_THREADS); + this.executor = Executors.newFixedThreadPool(DEFAULT_NUM_THREADS, threadFactory); + } else { + this.executor = executor; + } this.workPool = new WorkPool<>(queueingTimeout); this.shutdownTimeout = shutdownTimeout; } diff --git a/src/main/java/com/rabbitmq/client/impl/Utils.java b/src/main/java/com/rabbitmq/client/impl/Utils.java new file mode 100644 index 0000000000..d3e3412ee4 --- /dev/null +++ b/src/main/java/com/rabbitmq/client/impl/Utils.java @@ -0,0 +1,31 @@ +// Copyright (c) 2022 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.impl; + +final class Utils { + + private static final int AVAILABLE_PROCESSORS = + Integer.parseInt( + System.getProperty( + "rabbitmq.amqp.client.availableProcessors", + String.valueOf(Runtime.getRuntime().availableProcessors()))); + + static int availableProcessors() { + return AVAILABLE_PROCESSORS; + } + + private Utils() {} +} From e2743af9d8a34bd87501a29076f5499a1ea1eb67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 8 Apr 2022 14:44:28 +0200 Subject: [PATCH 066/657] Bump optional dependencies References #717 --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 78534eb35b..a0bb91a56e 100644 --- a/pom.xml +++ b/pom.xml @@ -55,9 +55,9 @@ UTF-8 1.7.36 - 4.2.8 - 1.8.2 - 2.13.1 + 4.2.9 + 1.8.4 + 2.13.2.2 1.2.10 4.13.2 4.3.1 From 7d5099ed4b8327346c5e6d654e1d6c1211b342b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 8 Apr 2022 14:46:01 +0200 Subject: [PATCH 067/657] Bump test dependencies --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index a0bb91a56e..7c08b5647e 100644 --- a/pom.xml +++ b/pom.xml @@ -58,11 +58,11 @@ 4.2.9 1.8.4 2.13.2.2 - 1.2.10 + 1.2.11 4.13.2 - 4.3.1 + 4.4.0 3.22.0 - 9.4.45.v20220203 + 9.4.46.v20220331 1.70 0.10 From 96f5b0e23433a1620505cb8ba655940bd8f99a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 8 Apr 2022 15:04:34 +0200 Subject: [PATCH 068/657] Bump plugins --- pom.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index 7c08b5647e..b9b63f8ca3 100644 --- a/pom.xml +++ b/pom.xml @@ -66,24 +66,24 @@ 1.70 0.10 - 3.2.0 + 3.3.2 2.5.3 - 2.3 - 3.1.0 - 3.0.1 + 2.10.0 + 3.2.0 + 3.2.1 2.1.1 - 2.4.8 + 2.4.21 1.5 - 1.12 - 3.8.1 + 3.3.0 + 3.10.1 2.22.2 2.22.2 - 1.6 - 3.0.2 - 3.2.0 + 3.0.1 + 3.2.2 + 5.1.4 0.0.6 - 1.6.8 - 1.8 + 1.6.12 + 1.11 1.3 - javadoc-no-module-dir-java-11 - - [11,) - - - --no-module-directories - - - + + org.junit.jupiter + junit-jupiter-params test @@ -768,6 +778,18 @@ + + + + + org.junit + junit-bom + ${junit.jupiter.version} + pom + import + + + diff --git a/src/test/java/com/rabbitmq/client/AbstractJsonRpcTest.java b/src/test/java/com/rabbitmq/client/AbstractJsonRpcTest.java index 0b6bc20a68..ec9fbd2f39 100644 --- a/src/test/java/com/rabbitmq/client/AbstractJsonRpcTest.java +++ b/src/test/java/com/rabbitmq/client/AbstractJsonRpcTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -19,8 +19,8 @@ import com.rabbitmq.tools.jsonrpc.JsonRpcClient; import com.rabbitmq.tools.jsonrpc.JsonRpcMapper; import com.rabbitmq.tools.jsonrpc.JsonRpcServer; -import org.junit.After; -import org.junit.Before; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; import java.util.Date; @@ -35,7 +35,7 @@ public abstract class AbstractJsonRpcTest { abstract JsonRpcMapper createMapper(); - @Before + @BeforeEach public void init() throws Exception { clientConnection = TestUtils.connectionFactory().newConnection(); clientChannel = clientConnection.createChannel(); @@ -57,7 +57,7 @@ public void init() throws Exception { service = client.createProxy(RpcService.class); } - @After + @AfterEach public void tearDown() throws Exception { if (server != null) { server.terminateMainloop(); diff --git a/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java b/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java new file mode 100644 index 0000000000..07e27a6838 --- /dev/null +++ b/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java @@ -0,0 +1,237 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client; + +import static org.junit.jupiter.api.extension.ConditionEvaluationResult.disabled; +import static org.junit.jupiter.api.extension.ConditionEvaluationResult.enabled; + +import com.rabbitmq.client.test.TestUtils; +import com.rabbitmq.client.test.functional.FunctionalTestSuite; +import com.rabbitmq.client.test.server.HaTestSuite; +import com.rabbitmq.client.test.server.LastHaTestSuite; +import com.rabbitmq.client.test.server.ServerTestSuite; +import com.rabbitmq.client.test.ssl.SslTestSuite; +import com.rabbitmq.tools.Host; +import java.io.File; +import java.lang.reflect.Field; +import java.net.Socket; +import java.util.Properties; +import org.junit.jupiter.api.extension.AfterEachCallback; +import org.junit.jupiter.api.extension.BeforeAllCallback; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ConditionEvaluationResult; +import org.junit.jupiter.api.extension.ExecutionCondition; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.ExtensionContext.Namespace; +import org.junit.jupiter.api.extension.ExtensionContext.Store; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class AmqpClientTestExtension implements ExecutionCondition, BeforeAllCallback, + BeforeEachCallback, + AfterEachCallback { + + private static final Logger LOGGER = LoggerFactory.getLogger(AmqpClientTestExtension.class); + private static final Namespace NAMESPACE = Namespace.create(AmqpClientTestExtension.class); + + static { + Properties TESTS_PROPS = new Properties(System.getProperties()); + String make = System.getenv("MAKE"); + if (make != null) { + TESTS_PROPS.setProperty("make.bin", make); + } + try { + TESTS_PROPS.load(Host.class.getClassLoader().getResourceAsStream("config.properties")); + } catch (Exception e) { + System.out.println( + "\"build.properties\" or \"config.properties\" not found" + + " in classpath. Please copy \"build.properties\" and" + + " \"config.properties\" into src/test/resources. Ignore" + + " this message if running with ant."); + } finally { + System.setProperties(TESTS_PROPS); + } + } + + private static void maybeSetHaFieldValue(ExtensionContext context, boolean value) { + if (context.getTestClass().isPresent() && context.getTestInstance().isPresent()) { + try { + Field haField = findField(context.getTestClass().get(), "ha"); + if (haField != null) { + haField.setAccessible(true); + haField.set(context.getTestInstance().get(), value); + } + } catch (Exception e) { + // OK + } + } + } + + private static Field findField(Class clazz, String fieldName) { + try { + return clazz.getDeclaredField(fieldName); + } catch (NoSuchFieldException e) { + if (clazz.getSuperclass() != null) { + return findField(clazz.getSuperclass(), fieldName); + } + } + return null; + } + + private static boolean isFunctionalSuite(ExtensionContext context) { + return isTestSuite(context, FunctionalTestSuite.class); + } + + private static boolean isSslSuite(ExtensionContext context) { + return isTestSuite(context, SslTestSuite.class); + } + + private static boolean isServerSuite(ExtensionContext context) { + return isTestSuite(context, ServerTestSuite.class); + } + + private static boolean isHaSuite(ExtensionContext context) { + return isTestSuite(context, HaTestSuite.class); + } + + private static boolean isLastHaSuite(ExtensionContext context) { + return isTestSuite(context, LastHaTestSuite.class); + } + + private static boolean isTestSuite(ExtensionContext context, Class clazz) { + return context.getUniqueId().contains(clazz.getName()); + } + + public static boolean requiredProperties() { + /* Path to rabbitmqctl. */ + String rabbitmqctl = Host.rabbitmqctlCommand(); + if (rabbitmqctl == null) { + System.err.println( + "rabbitmqctl required; please set \"rabbitmqctl.bin\" system" + + " property"); + return false; + } + + return true; + } + + public static boolean isSSLAvailable() { + String sslClientCertsDir = System.getProperty("test-client-cert.path"); + String hostname = System.getProperty("broker.hostname"); + String port = System.getProperty("broker.sslport"); + if (sslClientCertsDir == null || hostname == null || port == null) { + return false; + } + + // If certificate is present and some server is listening on port 5671 + if (new File(sslClientCertsDir).exists() && + checkServerListening(hostname, Integer.parseInt(port))) { + return true; + } else { + return false; + } + } + + private static boolean checkServerListening(String host, int port) { + Socket s = null; + try { + s = new Socket(host, port); + return true; + } catch (Exception e) { + return false; + } finally { + if (s != null) { + try { + s.close(); + } catch (Exception e) { + } + } + } + } + + private static Store store(ExtensionContext context) { + return context.getRoot().getStore(NAMESPACE); + } + + private static boolean hasHaSuiteStarted(ExtensionContext context) { + return "true".equals(store(context).get("ha")); + } + + private static void markHaSuiteStarted(ExtensionContext context) { + store(context).put("ha", "true"); + } + + private static void markHaSuiteFinished(ExtensionContext context) { + store(context).remove("ha"); + } + + @Override + public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { + // HA test suite must be checked first because it contains other test suites + if (isHaSuite(context)) { + return requiredProperties() ? enabled("Required properties available") + : disabled("Required properties not available"); + } else if (isServerSuite(context)) { + return requiredProperties() ? enabled("Required properties available") + : disabled("Required properties not available"); + } else if (isFunctionalSuite(context)) { + return requiredProperties() ? enabled("Required properties available") + : disabled("Required properties not available"); + } else if (isSslSuite(context)) { + return requiredProperties() && isSSLAvailable() ? enabled( + "Required properties and TLS available") + : disabled("Required properties or TLS not available"); + } + return enabled("ok"); + } + + @Override + public void beforeAll(ExtensionContext context) throws Exception { + if (isHaSuite(context) && !hasHaSuiteStarted(context)) { + LOGGER.info("Starting HA test suite"); + Host.rabbitmqctl("set_policy HA '.*' '{\"ha-mode\":\"all\"}'"); + markHaSuiteStarted(context); + } + if (isLastHaSuite(context)) { + LOGGER.info("HA suite done, clearing HA state"); + Host.rabbitmqctl("clear_policy HA"); + markHaSuiteFinished(context); + } + } + + @Override + public void beforeEach(ExtensionContext context) { + LOGGER.info( + "Starting test: {}.{} (nio? {}, HA? {})", + context.getTestClass().get().getSimpleName(), context.getTestMethod().get().getName(), + TestUtils.USE_NIO, + hasHaSuiteStarted(context) + ); + if (isHaSuite(context)) { + maybeSetHaFieldValue(context, true); + } + } + + @Override + public void afterEach(ExtensionContext context) { + LOGGER.info("Test finished: {}.{}", + context.getTestClass().get().getSimpleName(), context.getTestMethod().get().getName()); + if (isHaSuite(context)) { + maybeSetHaFieldValue(context, false); + } + } + +} diff --git a/src/test/java/com/rabbitmq/client/JacksonJsonRpcTest.java b/src/test/java/com/rabbitmq/client/JacksonJsonRpcTest.java index e7a57021d4..f926061f94 100644 --- a/src/test/java/com/rabbitmq/client/JacksonJsonRpcTest.java +++ b/src/test/java/com/rabbitmq/client/JacksonJsonRpcTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -18,16 +18,16 @@ import com.rabbitmq.tools.jsonrpc.JacksonJsonRpcMapper; import com.rabbitmq.tools.jsonrpc.JsonRpcException; import com.rabbitmq.tools.jsonrpc.JsonRpcMapper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.lang.reflect.UndeclaredThrowableException; import java.util.Calendar; import java.util.Date; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; public class JacksonJsonRpcTest extends AbstractJsonRpcTest { diff --git a/src/test/java/com/rabbitmq/client/QueueingConsumer.java b/src/test/java/com/rabbitmq/client/QueueingConsumer.java index 33a033008f..9ecddaa67b 100644 --- a/src/test/java/com/rabbitmq/client/QueueingConsumer.java +++ b/src/test/java/com/rabbitmq/client/QueueingConsumer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/impl/AMQConnectionRefreshCredentialsTest.java b/src/test/java/com/rabbitmq/client/impl/AMQConnectionRefreshCredentialsTest.java index 989ee69ffa..a5fce8a561 100644 --- a/src/test/java/com/rabbitmq/client/impl/AMQConnectionRefreshCredentialsTest.java +++ b/src/test/java/com/rabbitmq/client/impl/AMQConnectionRefreshCredentialsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -18,12 +18,13 @@ import com.rabbitmq.client.Method; import com.rabbitmq.client.*; import com.rabbitmq.client.test.TestUtils; -import org.junit.ClassRule; -import org.junit.Test; -import org.junit.rules.TestRule; -import org.junit.runner.RunWith; +import com.rabbitmq.client.test.TestUtils.BrokerVersion; +import com.rabbitmq.client.test.TestUtils.BrokerVersionAtLeast; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.MockitoAnnotations; import java.io.IOException; import java.time.Duration; @@ -38,18 +39,27 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.*; -@RunWith(MockitoJUnitRunner.class) +@BrokerVersionAtLeast(BrokerVersion.RABBITMQ_3_8) public class AMQConnectionRefreshCredentialsTest { - @ClassRule - public static TestRule brokerVersionTestRule = TestUtils.atLeast38(); - @Mock CredentialsProvider credentialsProvider; @Mock CredentialsRefreshService refreshService; + AutoCloseable mocks; + + @BeforeEach + void init() { + mocks = MockitoAnnotations.openMocks(this); + } + + @AfterEach + void tearDown() throws Exception { + mocks.close(); + } + private static ConnectionFactory connectionFactoryThatSendsGarbageAfterUpdateSecret() { ConnectionFactory cf = new ConnectionFactory() { @Override diff --git a/src/test/java/com/rabbitmq/client/impl/DefaultCredentialsRefreshServiceTest.java b/src/test/java/com/rabbitmq/client/impl/DefaultCredentialsRefreshServiceTest.java index 3bd0cca640..2ad3681c52 100644 --- a/src/test/java/com/rabbitmq/client/impl/DefaultCredentialsRefreshServiceTest.java +++ b/src/test/java/com/rabbitmq/client/impl/DefaultCredentialsRefreshServiceTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,10 +15,11 @@ package com.rabbitmq.client.impl; -import org.junit.After; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mock; +import org.mockito.MockitoAnnotations; import org.mockito.junit.MockitoJUnitRunner; import org.mockito.stubbing.Answer; @@ -38,7 +39,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.*; -@RunWith(MockitoJUnitRunner.class) public class DefaultCredentialsRefreshServiceTest { @Mock @@ -49,11 +49,19 @@ public class DefaultCredentialsRefreshServiceTest { DefaultCredentialsRefreshService refreshService; - @After - public void tearDown() { + AutoCloseable mocks; + + @BeforeEach + void init() { + this.mocks = MockitoAnnotations.openMocks(this); + } + + @AfterEach + public void tearDown() throws Exception { if (refreshService != null) { refreshService.close(); } + mocks.close(); } @Test diff --git a/src/test/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProviderTest.java b/src/test/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProviderTest.java index 0a08125d8f..33614d78bd 100644 --- a/src/test/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProviderTest.java +++ b/src/test/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProviderTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -27,9 +27,9 @@ import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.util.ssl.SslContextFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; @@ -62,7 +62,7 @@ static boolean isJava13() { return javaVersion != null && javaVersion.startsWith("13."); } - @Before + @BeforeEach public void init() { if (isJava13()) { // for Java 13.0.7, see https://github.com/bcgit/bc-java/issues/941 @@ -70,7 +70,7 @@ public void init() { } } - @After + @AfterEach public void tearDown() throws Exception { if (isJava13()) { System.setProperty("keystore.pkcs12.keyProtectionAlgorithm", ""); diff --git a/src/test/java/com/rabbitmq/client/impl/RefreshProtectedCredentialsProviderTest.java b/src/test/java/com/rabbitmq/client/impl/RefreshProtectedCredentialsProviderTest.java index a65ed3b6ca..dfed27341d 100644 --- a/src/test/java/com/rabbitmq/client/impl/RefreshProtectedCredentialsProviderTest.java +++ b/src/test/java/com/rabbitmq/client/impl/RefreshProtectedCredentialsProviderTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,7 +15,7 @@ package com.rabbitmq.client.impl; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.time.Duration; import java.util.Set; diff --git a/src/test/java/com/rabbitmq/client/impl/ValueWriterTest.java b/src/test/java/com/rabbitmq/client/impl/ValueWriterTest.java index ea0d94c683..54a9acfe55 100644 --- a/src/test/java/com/rabbitmq/client/impl/ValueWriterTest.java +++ b/src/test/java/com/rabbitmq/client/impl/ValueWriterTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,49 +15,43 @@ package com.rabbitmq.client.impl; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.*; import java.math.BigDecimal; import java.math.BigInteger; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatThrownBy; public class ValueWriterTest { - @Test(expected = IllegalArgumentException.class) - public void writingOverlyLargeBigDecimalShouldFail() - throws IOException { - - OutputStream outputStream = new OutputStream() { - @Override - public void write(int b) { - } - }; - - DataOutputStream dataOutputStream = new DataOutputStream(outputStream); - - ValueWriter valueWriter = new ValueWriter(dataOutputStream); - - valueWriter.writeFieldValue(new BigDecimal(Integer.MAX_VALUE).add(new BigDecimal(1))); - + @Test + public void writingOverlyLargeBigDecimalShouldFail() { + assertThatThrownBy(() -> { + OutputStream outputStream = new OutputStream() { + @Override + public void write(int b) { + } + }; + DataOutputStream dataOutputStream = new DataOutputStream(outputStream); + ValueWriter valueWriter = new ValueWriter(dataOutputStream); + valueWriter.writeFieldValue(new BigDecimal(Integer.MAX_VALUE).add(new BigDecimal(1))); + }).isInstanceOf(IllegalArgumentException.class); } - @Test(expected = IllegalArgumentException.class) - public void writingOverlyLargeScaleInBigDecimalShouldFail() - throws IOException { - - OutputStream outputStream = new OutputStream() { - @Override - public void write(int b) { - } - }; - - DataOutputStream dataOutputStream = new DataOutputStream(outputStream); - - ValueWriter valueWriter = new ValueWriter(dataOutputStream); - - valueWriter.writeFieldValue(new BigDecimal(BigInteger.ONE, 500)); + @Test + public void writingOverlyLargeScaleInBigDecimalShouldFail() { + assertThatThrownBy(() -> { + OutputStream outputStream = new OutputStream() { + @Override + public void write(int b) { + } + }; + DataOutputStream dataOutputStream = new DataOutputStream(outputStream); + ValueWriter valueWriter = new ValueWriter(dataOutputStream); + valueWriter.writeFieldValue(new BigDecimal(BigInteger.ONE, 500)); + }).isInstanceOf(IllegalArgumentException.class); } @Test diff --git a/src/test/java/com/rabbitmq/client/impl/WorkPoolTests.java b/src/test/java/com/rabbitmq/client/impl/WorkPoolTests.java index 4cc054ca88..54a49da485 100644 --- a/src/test/java/com/rabbitmq/client/impl/WorkPoolTests.java +++ b/src/test/java/com/rabbitmq/client/impl/WorkPoolTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,15 +15,15 @@ package com.rabbitmq.client.impl; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.ArrayList; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Unit tests for {@link WorkPool} @@ -34,9 +34,8 @@ public class WorkPoolTests { /** * Test unknown key tolerated silently - * @throws Exception untested */ - @Test public void unknownKey() throws Exception{ + @Test public void unknownKey() { assertFalse(this.pool.addWorkItem("test", new Object())); } @@ -58,16 +57,15 @@ public class WorkPoolTests { assertEquals(1, workList.size()); assertEquals(one, workList.get(0)); - assertTrue("Should be made ready", this.pool.finishWorkBlock(key)); + assertTrue(this.pool.finishWorkBlock(key), "Should be made ready"); workList.clear(); key = this.pool.nextWorkBlock(workList, 1); - assertEquals("Work client key wrong", "test", key); - assertEquals("Wrong work delivered", two, workList.get(0)); - - assertFalse("Should not be made ready after this.", this.pool.finishWorkBlock(key)); + assertEquals("test", key, "Work client key wrong"); + assertEquals(two, workList.get(0), "Wrong work delivered"); - assertNull("Shouldn't be more work", this.pool.nextWorkBlock(workList, 1)); + assertFalse(this.pool.finishWorkBlock(key), "Should not be made ready after this."); + assertNull(this.pool.nextWorkBlock(workList, 1), "Shouldn't be more work"); } /** diff --git a/src/test/java/com/rabbitmq/client/test/AMQBuilderApiTest.java b/src/test/java/com/rabbitmq/client/test/AMQBuilderApiTest.java index 46241c38b3..a4b54c9fa7 100644 --- a/src/test/java/com/rabbitmq/client/test/AMQBuilderApiTest.java +++ b/src/test/java/com/rabbitmq/client/test/AMQBuilderApiTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -14,12 +14,12 @@ // info@rabbitmq.com. package com.rabbitmq.client.test; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Method; @@ -38,7 +38,7 @@ public class AMQBuilderApiTest extends BrokerTestCase .build() ).getMethod(); - assertTrue("Channel should still be open.", channel.isOpen()); + assertTrue(channel.isOpen(), "Channel should still be open."); assertTrue(retVal instanceof AMQP.Exchange.DeclareOk); retVal = channel.rpc(new AMQP.Exchange.Delete.Builder() @@ -46,7 +46,7 @@ public class AMQBuilderApiTest extends BrokerTestCase .build() ).getMethod(); - assertTrue("Channel should still be open.", channel.isOpen()); + assertTrue(channel.isOpen(), "Channel should still be open."); assertTrue(retVal instanceof AMQP.Exchange.DeleteOk); } @@ -59,14 +59,14 @@ public class AMQBuilderApiTest extends BrokerTestCase .build() ); - assertTrue("Channel should still be open.", channel.isOpen()); + assertTrue(channel.isOpen(), "Channel should still be open."); channel.asyncRpc(new AMQP.Exchange.Delete.Builder() .exchange(XCHG_NAME) .build() ); - assertTrue("Channel should still be open.", channel.isOpen()); + assertTrue(channel.isOpen(), "Channel should still be open."); } @Test public void illFormedBuilder() diff --git a/src/test/java/com/rabbitmq/client/test/AMQChannelTest.java b/src/test/java/com/rabbitmq/client/test/AMQChannelTest.java index 0ea1a89c60..091e1b14c2 100644 --- a/src/test/java/com/rabbitmq/client/test/AMQChannelTest.java +++ b/src/test/java/com/rabbitmq/client/test/AMQChannelTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -23,9 +23,9 @@ import com.rabbitmq.client.impl.AMQCommand; import com.rabbitmq.client.impl.AMQConnection; import com.rabbitmq.client.impl.AMQImpl; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.concurrent.Callable; @@ -41,11 +41,11 @@ public class AMQChannelTest { ScheduledExecutorService scheduler; - @Before public void init() { + @BeforeEach public void init() { scheduler = Executors.newSingleThreadScheduledExecutor(); } - @After public void tearDown() { + @AfterEach public void tearDown() { scheduler.shutdownNow(); } diff --git a/src/test/java/com/rabbitmq/client/test/AMQConnectionTest.java b/src/test/java/com/rabbitmq/client/test/AMQConnectionTest.java index e36631de7c..de50c74542 100644 --- a/src/test/java/com/rabbitmq/client/test/AMQConnectionTest.java +++ b/src/test/java/com/rabbitmq/client/test/AMQConnectionTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -20,9 +20,9 @@ import com.rabbitmq.client.impl.ConnectionParams; import com.rabbitmq.client.impl.Frame; import com.rabbitmq.client.impl.FrameHandler; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.net.InetAddress; @@ -36,8 +36,8 @@ import java.util.concurrent.Executors; import java.util.concurrent.TimeoutException; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; /** * Test suite for AMQConnection. @@ -51,14 +51,14 @@ public class AMQConnectionTest { private ConnectionFactory factory; private MyExceptionHandler exceptionHandler; - @Before public void setUp() { + @BeforeEach public void setUp() { _mockFrameHandler = new MockFrameHandler(); factory = TestUtils.connectionFactory(); exceptionHandler = new MyExceptionHandler(); factory.setExceptionHandler(exceptionHandler); } - @After public void tearDown() { + @AfterEach public void tearDown() { factory = null; _mockFrameHandler = null; } @@ -159,8 +159,8 @@ public class AMQConnectionTest { } assertEquals(1, this._mockFrameHandler.countHeadersSent()); List exceptionList = exceptionHandler.getHandledExceptions(); - assertEquals("Only one exception expected", 1, exceptionList.size()); - assertEquals("Wrong type of exception returned.", SocketTimeoutException.class, exceptionList.get(0).getClass()); + assertEquals(1, exceptionList.size(), "Only one exception expected"); + assertEquals(SocketTimeoutException.class, exceptionList.get(0).getClass(), "Wrong type of exception returned."); } @Test public void clientProvidedConnectionName() throws IOException, TimeoutException { diff --git a/src/test/java/com/rabbitmq/client/test/AbstractRMQTestSuite.java b/src/test/java/com/rabbitmq/client/test/AbstractRMQTestSuite.java deleted file mode 100644 index 922b6b9931..0000000000 --- a/src/test/java/com/rabbitmq/client/test/AbstractRMQTestSuite.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. -// -// This software, the RabbitMQ Java client library, is triple-licensed under the -// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 -// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see -// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.test; - -import com.rabbitmq.tools.Host; - -import java.io.File; -import java.io.IOException; -import java.net.Socket; -import java.util.Properties; - -public abstract class AbstractRMQTestSuite { - - static { - Properties TESTS_PROPS = new Properties(System.getProperties()); - String make = System.getenv("MAKE"); - if (make != null) - TESTS_PROPS.setProperty("make.bin", make); - try { - TESTS_PROPS.load(Host.class.getClassLoader().getResourceAsStream("config.properties")); - } catch (Exception e) { - System.out.println( - "\"build.properties\" or \"config.properties\" not found" + - " in classpath. Please copy \"build.properties\" and" + - " \"config.properties\" into src/test/resources. Ignore" + - " this message if running with ant."); - } finally { - System.setProperties(TESTS_PROPS); - } - } - - public static boolean requiredProperties() { - /* Path to rabbitmqctl. */ - String rabbitmqctl = Host.rabbitmqctlCommand(); - if (rabbitmqctl == null) { - System.err.println( - "rabbitmqctl required; please set \"rabbitmqctl.bin\" system" + - " property"); - return false; - } - - return true; - } - - public static boolean isSSLAvailable() { - String sslClientCertsDir = System.getProperty("test-client-cert.path"); - String hostname = System.getProperty("broker.hostname"); - String port = System.getProperty("broker.sslport"); - if (sslClientCertsDir == null || hostname == null || port == null) - return false; - - // If certificate is present and some server is listening on port 5671 - if (new File(sslClientCertsDir).exists() && - checkServerListening(hostname, Integer.parseInt(port))) { - return true; - } else - return false; - } - - private static boolean checkServerListening(String host, int port) { - Socket s = null; - try { - s = new Socket(host, port); - return true; - } catch (Exception e) { - return false; - } finally { - if (s != null) - try { - s.close(); - } catch (Exception e) { - } - } - } -} diff --git a/src/test/java/com/rabbitmq/client/test/AddressTest.java b/src/test/java/com/rabbitmq/client/test/AddressTest.java index 631dc5d986..bc9e860e8b 100644 --- a/src/test/java/com/rabbitmq/client/test/AddressTest.java +++ b/src/test/java/com/rabbitmq/client/test/AddressTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,11 +16,12 @@ package com.rabbitmq.client.test; import com.rabbitmq.client.Address; -import org.junit.Test; +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @@ -73,10 +74,11 @@ public class AddressTest { assertEquals(addr("[::1]", 5673), Address.parseAddress("[::1]:5673")); } - @Test(expected = IllegalArgumentException.class) + @Test public void parseUnquotedIPv6() { // using a non-quoted IPv6 addresses with a port - Address.parseAddress("::1:5673"); + Assertions.assertThatThrownBy(() -> Address.parseAddress("::1:5673")) + .isInstanceOf(IllegalArgumentException.class); } private Address addr(String addr) { diff --git a/src/test/java/com/rabbitmq/client/test/AmqpUriTest.java b/src/test/java/com/rabbitmq/client/test/AmqpUriTest.java index d5be86e4ee..f81ee0ea5c 100644 --- a/src/test/java/com/rabbitmq/client/test/AmqpUriTest.java +++ b/src/test/java/com/rabbitmq/client/test/AmqpUriTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,8 +15,8 @@ package com.rabbitmq.client.test; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import java.net.URISyntaxException; import java.security.KeyManagementException; @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.ConnectionFactory; diff --git a/src/test/java/com/rabbitmq/client/test/BlockingCellTest.java b/src/test/java/com/rabbitmq/client/test/BlockingCellTest.java index b5c7e9a3b0..03334570a6 100644 --- a/src/test/java/com/rabbitmq/client/test/BlockingCellTest.java +++ b/src/test/java/com/rabbitmq/client/test/BlockingCellTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,12 +17,12 @@ package com.rabbitmq.client.test; import com.rabbitmq.utility.BlockingCell; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class BlockingCellTest { diff --git a/src/test/java/com/rabbitmq/client/test/BrokenFramesTest.java b/src/test/java/com/rabbitmq/client/test/BrokenFramesTest.java index 0ea3a02793..c0be492ae7 100644 --- a/src/test/java/com/rabbitmq/client/test/BrokenFramesTest.java +++ b/src/test/java/com/rabbitmq/client/test/BrokenFramesTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -23,9 +23,9 @@ import com.rabbitmq.client.impl.AMQImpl.Basic.Publish; import com.rabbitmq.client.impl.Frame; import com.rabbitmq.client.impl.FrameHandler; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.net.InetAddress; @@ -35,19 +35,19 @@ import java.util.List; import java.util.concurrent.Executors; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class BrokenFramesTest { private MyFrameHandler myFrameHandler; private ConnectionFactory factory; - @Before public void setUp() { + @BeforeEach public void setUp() { myFrameHandler = new MyFrameHandler(); factory = TestUtils.connectionFactory(); } - @After public void tearDown() { + @AfterEach public void tearDown() { factory = null; myFrameHandler = null; } diff --git a/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java b/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java index 871a157b6b..46763e78cc 100644 --- a/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java +++ b/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java @@ -17,46 +17,24 @@ import com.rabbitmq.client.*; import com.rabbitmq.client.impl.nio.NioParams; -import com.rabbitmq.client.test.TestUtils.TestDescription; import com.rabbitmq.tools.Host; -import org.junit.After; -import org.junit.Before; -import org.junit.Rule; -import org.junit.rules.TestRule; -import org.junit.rules.TestWatcher; -import org.junit.runner.Description; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; import java.io.IOException; import java.util.Map; import java.util.UUID; import java.util.concurrent.TimeoutException; -import static org.junit.Assert.*; -import static org.junit.Assume.*; +import static org.junit.jupiter.api.Assertions.*; public class BrokerTestCase { - @Rule - public TestDescription testDescription = new TestDescription(); + private boolean ha = false; - private static final Logger LOGGER = LoggerFactory.getLogger(BrokerTestCase.class); - - @Rule - public TestRule watcher = new TestWatcher() { - protected void starting(Description description) { - LOGGER.info( - "Starting test: {}.{} (nio? {})", - description.getTestClass().getSimpleName(), description.getMethodName(), TestUtils.USE_NIO - ); - } - - @Override - protected void finished(Description description) { - LOGGER.info("Test finished: {}.{}", description.getTestClass().getSimpleName(), description.getMethodName()); - } - }; + protected volatile TestInfo testInfo; protected ConnectionFactory connectionFactory = newConnectionFactory(); @@ -80,16 +58,19 @@ protected boolean isAutomaticRecoveryEnabled() { protected Connection connection; protected Channel channel; - @Before public void setUp() - throws IOException, TimeoutException { - assumeTrue(shouldRun()); + @BeforeEach + public void setUp(TestInfo testInfo) throws IOException, TimeoutException { + + + Assumptions.assumeTrue(shouldRun()); + this.testInfo = testInfo; openConnection(); openChannel(); createResources(); } - @After public void tearDown() + @AfterEach public void tearDown(TestInfo testInfo) throws IOException, TimeoutException { if(shouldRun()) { closeChannel(); @@ -135,9 +116,9 @@ protected void releaseResources() protected void restart() throws IOException, TimeoutException { - tearDown(); + tearDown(this.testInfo); bareRestart(); - setUp(); + setUp(this.testInfo); } protected void bareRestart() @@ -342,13 +323,13 @@ protected void unblock() throws IOException, InterruptedException { } protected String generateQueueName() { - return name("queue", this.testDescription.getDescription().getTestClass(), - this.testDescription.getDescription().getMethodName()); + return name("queue", this.testInfo.getTestClass().get(), + this.testInfo.getTestMethod().get().getName()); } protected String generateExchangeName() { - return name("exchange", this.testDescription.getDescription().getTestClass(), - this.testDescription.getDescription().getMethodName()); + return name("exchange", this.testInfo.getTestClass().get(), + this.testInfo.getTestMethod().get().getName()); } private static String name(String prefix, Class testClass, String testMethodName) { @@ -358,6 +339,8 @@ private static String name(String prefix, Class testClass, String testMethodN prefix, testClass.getSimpleName(), testMethodName, uuid.substring(uuid.length() / 2)); } - + protected boolean ha() { + return this.ha; + } } diff --git a/src/test/java/com/rabbitmq/client/test/Bug20004Test.java b/src/test/java/com/rabbitmq/client/test/Bug20004Test.java index d14e1d3e74..a62598165b 100644 --- a/src/test/java/com/rabbitmq/client/test/Bug20004Test.java +++ b/src/test/java/com/rabbitmq/client/test/Bug20004Test.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,13 +15,13 @@ package com.rabbitmq.client.test; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Test for bug 20004 - deadlock through internal synchronization on the channel object. This is @@ -62,8 +62,8 @@ public void bug20004() throws InterruptedException { boolean completed = completedLatch.await(5, TimeUnit.SECONDS); - assertTrue("Deadlock detected?", completed); - assertNull("queueDeclare threw an exception", caughtException); - assertTrue("unknown sequence of events", created); + assertTrue(completed, "Deadlock detected?"); + assertNull(caughtException, "queueDeclare threw an exception"); + assertTrue(created, "unknown sequence of events"); } } diff --git a/src/test/java/com/rabbitmq/client/test/ChannelAsyncCompletableFutureTest.java b/src/test/java/com/rabbitmq/client/test/ChannelAsyncCompletableFutureTest.java index a871d49455..b3e5592dd4 100644 --- a/src/test/java/com/rabbitmq/client/test/ChannelAsyncCompletableFutureTest.java +++ b/src/test/java/com/rabbitmq/client/test/ChannelAsyncCompletableFutureTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -19,15 +19,15 @@ import com.rabbitmq.client.DefaultConsumer; import com.rabbitmq.client.Envelope; import com.rabbitmq.client.impl.AMQImpl; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.UUID; import java.util.concurrent.*; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ChannelAsyncCompletableFutureTest extends BrokerTestCase { diff --git a/src/test/java/com/rabbitmq/client/test/ChannelNTest.java b/src/test/java/com/rabbitmq/client/test/ChannelNTest.java index 1568881016..c615c3bfe0 100644 --- a/src/test/java/com/rabbitmq/client/test/ChannelNTest.java +++ b/src/test/java/com/rabbitmq/client/test/ChannelNTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,9 +17,9 @@ import com.rabbitmq.client.Method; import com.rabbitmq.client.impl.*; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import java.io.IOException; @@ -36,13 +36,13 @@ public class ChannelNTest { ConsumerWorkService consumerWorkService; ExecutorService executorService; - @Before + @BeforeEach public void init() { executorService = Executors.newSingleThreadExecutor(); consumerWorkService = new ConsumerWorkService(executorService, null, 1000, 1000); } - @After + @AfterEach public void tearDown() { consumerWorkService.shutdown(); executorService.shutdownNow(); diff --git a/src/test/java/com/rabbitmq/client/test/ChannelNumberAllocationTests.java b/src/test/java/com/rabbitmq/client/test/ChannelNumberAllocationTests.java index aa916529d7..76ecd0abda 100644 --- a/src/test/java/com/rabbitmq/client/test/ChannelNumberAllocationTests.java +++ b/src/test/java/com/rabbitmq/client/test/ChannelNumberAllocationTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -18,16 +18,16 @@ import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class ChannelNumberAllocationTests { static final int CHANNEL_COUNT = 100; @@ -41,11 +41,11 @@ public int compare(Channel x, Channel y){ Connection connection; - @Before public void setUp() throws Exception{ + @BeforeEach public void setUp() throws Exception{ connection = TestUtils.connectionFactory().newConnection(); } - @After public void tearDown() throws Exception{ + @AfterEach public void tearDown() throws Exception{ connection.close(); connection = null; } @@ -81,10 +81,10 @@ public int compare(Channel x, Channel y){ // In the current implementation the allocated numbers need not be increasing Collections.sort(channels, COMPARATOR); - assertEquals("Didn't create the right number of channels!", CHANNEL_COUNT, channels.size()); + assertEquals(CHANNEL_COUNT, channels.size(), "Didn't create the right number of channels!"); for(int i = 1; i < CHANNEL_COUNT; ++i) { - assertTrue("Channel numbers should be distinct." - , channels.get(i-1).getChannelNumber() < channels.get(i).getChannelNumber() + assertTrue(channels.get(i-1).getChannelNumber() < channels.get(i).getChannelNumber(), + "Channel numbers should be distinct." ); } } diff --git a/src/test/java/com/rabbitmq/client/test/ChannelRpcTimeoutIntegrationTest.java b/src/test/java/com/rabbitmq/client/test/ChannelRpcTimeoutIntegrationTest.java index 2e9c4bf9ed..d2f3aafcba 100644 --- a/src/test/java/com/rabbitmq/client/test/ChannelRpcTimeoutIntegrationTest.java +++ b/src/test/java/com/rabbitmq/client/test/ChannelRpcTimeoutIntegrationTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,9 +17,9 @@ import com.rabbitmq.client.*; import com.rabbitmq.client.impl.*; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import javax.net.SocketFactory; import java.io.IOException; @@ -36,12 +36,12 @@ public class ChannelRpcTimeoutIntegrationTest { ConnectionFactory factory; - @Before + @BeforeEach public void setUp() { factory = TestUtils.connectionFactory(); } - @After + @AfterEach public void tearDown() { factory = null; } diff --git a/src/test/java/com/rabbitmq/client/test/ClientTests.java b/src/test/java/com/rabbitmq/client/test/ClientTestSuite.java similarity index 90% rename from src/test/java/com/rabbitmq/client/test/ClientTests.java rename to src/test/java/com/rabbitmq/client/test/ClientTestSuite.java index b8550640ca..9a06f67f5d 100644 --- a/src/test/java/com/rabbitmq/client/test/ClientTests.java +++ b/src/test/java/com/rabbitmq/client/test/ClientTestSuite.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -13,7 +13,6 @@ // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.test; import com.rabbitmq.client.JacksonJsonRpcTest; @@ -24,11 +23,12 @@ import com.rabbitmq.client.impl.ValueWriterTest; import com.rabbitmq.client.impl.*; import com.rabbitmq.utility.IntAllocatorTests; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -@RunWith(TestUtils.DefaultTestSuite.class) -@Suite.SuiteClasses({ +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; + +@Suite +@SelectClasses({ TableTest.class, LongStringTest.class, BlockingCellTest.class, @@ -83,11 +83,6 @@ RefreshCredentialsTest.class, AMQConnectionRefreshCredentialsTest.class }) -public class ClientTests { - - // initialize system properties - static{ - new AbstractRMQTestSuite(){}; - } +public class ClientTestSuite { } diff --git a/src/test/java/com/rabbitmq/client/test/ClientVersionTest.java b/src/test/java/com/rabbitmq/client/test/ClientVersionTest.java index c2c39284e3..3b66ec34fa 100644 --- a/src/test/java/com/rabbitmq/client/test/ClientVersionTest.java +++ b/src/test/java/com/rabbitmq/client/test/ClientVersionTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,7 +16,7 @@ package com.rabbitmq.client.test; import com.rabbitmq.client.impl.ClientVersion; -import org.junit.Test; +import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; diff --git a/src/test/java/com/rabbitmq/client/test/ClonePropertiesTest.java b/src/test/java/com/rabbitmq/client/test/ClonePropertiesTest.java index aae4d10e28..0ba413e9e8 100644 --- a/src/test/java/com/rabbitmq/client/test/ClonePropertiesTest.java +++ b/src/test/java/com/rabbitmq/client/test/ClonePropertiesTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,10 +17,10 @@ import com.rabbitmq.client.AMQP.BasicProperties; import com.rabbitmq.client.MessageProperties; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class ClonePropertiesTest { diff --git a/src/test/java/com/rabbitmq/client/test/CloseInMainLoop.java b/src/test/java/com/rabbitmq/client/test/CloseInMainLoop.java index 00e9570136..b340f472c4 100644 --- a/src/test/java/com/rabbitmq/client/test/CloseInMainLoop.java +++ b/src/test/java/com/rabbitmq/client/test/CloseInMainLoop.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,7 +15,7 @@ package com.rabbitmq.client.test; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.concurrent.CountDownLatch; @@ -25,7 +25,7 @@ import javax.net.SocketFactory; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; diff --git a/src/test/java/com/rabbitmq/client/test/ConfirmBase.java b/src/test/java/com/rabbitmq/client/test/ConfirmBase.java index 144ab68564..425965b17a 100644 --- a/src/test/java/com/rabbitmq/client/test/ConfirmBase.java +++ b/src/test/java/com/rabbitmq/client/test/ConfirmBase.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,7 +15,7 @@ package com.rabbitmq.client.test; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.concurrent.ExecutionException; @@ -25,8 +25,8 @@ import java.util.concurrent.TimeoutException; import com.rabbitmq.client.ShutdownSignalException; +import org.opentest4j.AssertionFailedError; -import junit.framework.AssertionFailedError; public class ConfirmBase extends BrokerTestCase { protected void waitForConfirms() throws Exception diff --git a/src/test/java/com/rabbitmq/client/test/ConnectionFactoryTest.java b/src/test/java/com/rabbitmq/client/test/ConnectionFactoryTest.java index 09af1b3c36..39cc92493d 100644 --- a/src/test/java/com/rabbitmq/client/test/ConnectionFactoryTest.java +++ b/src/test/java/com/rabbitmq/client/test/ConnectionFactoryTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,7 +17,7 @@ import com.rabbitmq.client.*; import com.rabbitmq.client.impl.*; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.List; diff --git a/src/test/java/com/rabbitmq/client/test/ConnectionTest.java b/src/test/java/com/rabbitmq/client/test/ConnectionTest.java index 8fb1c82059..e7233d6e86 100644 --- a/src/test/java/com/rabbitmq/client/test/ConnectionTest.java +++ b/src/test/java/com/rabbitmq/client/test/ConnectionTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,11 +17,12 @@ import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import org.assertj.core.api.Assertions; +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.MethodSource; import org.mockito.Mock; import org.mockito.stubbing.OngoingStubbing; @@ -29,16 +30,13 @@ import java.util.NoSuchElementException; import java.util.Optional; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.mockito.MockitoAnnotations.openMocks; -@RunWith(Parameterized.class) public class ConnectionTest { - @Parameterized.Parameter - public TestConfigurator configurator; @Mock MyConnection c = mock(MyConnection.class); @Mock @@ -46,23 +44,23 @@ public class ConnectionTest { AutoCloseable mocks; - @Parameterized.Parameters public static Object[] configurators() { return new Object[]{new NotNumberedChannelCreationCallback(), new NumberedChannelCreationCallback()}; } - @Before + @BeforeEach public void init() { mocks = openMocks(this); } - @After + @AfterEach public void tearDown() throws Exception { mocks.close(); } - @Test - public void openChannelWithNonNullChannelShouldReturnNonEmptyOptional() throws Exception { + @ParameterizedTest + @MethodSource("configurators") + public void openChannelWithNonNullChannelShouldReturnNonEmptyOptional(TestConfigurator configurator) throws Exception { configurator.mockAndWhenChannel(c).thenReturn(ch); configurator.mockAndWhenOptional(c).thenCallRealMethod(); Optional optional = configurator.open(c); @@ -70,20 +68,24 @@ public void openChannelWithNonNullChannelShouldReturnNonEmptyOptional() throws E assertSame(ch, optional.get()); } - @Test(expected = NoSuchElementException.class) - public void openChannelWithNullChannelShouldReturnEmptyOptional() throws Exception { + @ParameterizedTest + @MethodSource("configurators") + public void openChannelWithNullChannelShouldReturnEmptyOptional(TestConfigurator configurator) throws Exception { configurator.mockAndWhenChannel(c).thenReturn(null); configurator.mockAndWhenOptional(c).thenCallRealMethod(); - Optional optional = configurator.open(c); - assertFalse(optional.isPresent()); - optional.get(); + Assertions.assertThatThrownBy(() -> { + Optional optional = configurator.open(c); + assertFalse(optional.isPresent()); + optional.get(); + }).isInstanceOf(NoSuchElementException.class); } - @Test(expected = IOException.class) - public void openChannelShouldPropagateIoException() throws Exception { + @ParameterizedTest + @MethodSource("configurators") + public void openChannelShouldPropagateIoException(TestConfigurator configurator) throws Exception { configurator.mockAndWhenChannel(c).thenThrow(IOException.class); configurator.mockAndWhenOptional(c).thenCallRealMethod(); - configurator.open(c); + Assertions.assertThatThrownBy(() -> configurator.open(c)).isInstanceOf(IOException.class); } interface TestConfigurator { diff --git a/src/test/java/com/rabbitmq/client/test/DefaultRetryHandlerTest.java b/src/test/java/com/rabbitmq/client/test/DefaultRetryHandlerTest.java index ae841b430b..363c7285c8 100644 --- a/src/test/java/com/rabbitmq/client/test/DefaultRetryHandlerTest.java +++ b/src/test/java/com/rabbitmq/client/test/DefaultRetryHandlerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -23,9 +23,9 @@ import com.rabbitmq.client.impl.recovery.RecordedQueue; import com.rabbitmq.client.impl.recovery.RetryContext; import com.rabbitmq.client.impl.recovery.RetryHandler; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mock; import org.mockito.verification.VerificationMode; @@ -33,8 +33,8 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.BiPredicate; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.intThat; @@ -75,12 +75,12 @@ public class DefaultRetryHandlerTest { AutoCloseable mocks; - @Before + @BeforeEach public void init() { mocks = openMocks(this); } - @After + @AfterEach public void tearDown() throws Exception { mocks.close(); } diff --git a/src/test/java/com/rabbitmq/client/test/DnsRecordIpAddressResolverTests.java b/src/test/java/com/rabbitmq/client/test/DnsRecordIpAddressResolverTests.java index 5c38d5c8da..c339bf34e8 100644 --- a/src/test/java/com/rabbitmq/client/test/DnsRecordIpAddressResolverTests.java +++ b/src/test/java/com/rabbitmq/client/test/DnsRecordIpAddressResolverTests.java @@ -3,13 +3,13 @@ import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.DnsRecordIpAddressResolver; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.net.UnknownHostException; import java.util.concurrent.TimeoutException; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; /** * diff --git a/src/test/java/com/rabbitmq/client/test/DnsSrvRecordAddressResolverTest.java b/src/test/java/com/rabbitmq/client/test/DnsSrvRecordAddressResolverTest.java index 4950cc2323..839fb16fe4 100644 --- a/src/test/java/com/rabbitmq/client/test/DnsSrvRecordAddressResolverTest.java +++ b/src/test/java/com/rabbitmq/client/test/DnsSrvRecordAddressResolverTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,7 +17,7 @@ import com.rabbitmq.client.Address; import com.rabbitmq.client.DnsSrvRecordAddressResolver; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.Arrays; diff --git a/src/test/java/com/rabbitmq/client/test/FrameBuilderTest.java b/src/test/java/com/rabbitmq/client/test/FrameBuilderTest.java index 38fd654f3f..3e8b462f3d 100644 --- a/src/test/java/com/rabbitmq/client/test/FrameBuilderTest.java +++ b/src/test/java/com/rabbitmq/client/test/FrameBuilderTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -19,10 +19,11 @@ import com.rabbitmq.client.MalformedFrameException; import com.rabbitmq.client.impl.Frame; import com.rabbitmq.client.impl.nio.FrameBuilder; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.mockito.Mock; -import org.mockito.junit.MockitoJUnitRunner; +import org.mockito.MockitoAnnotations; import java.io.IOException; import java.nio.ByteBuffer; @@ -34,7 +35,6 @@ /** * */ -@RunWith(MockitoJUnitRunner.class) public class FrameBuilderTest { @Mock @@ -44,6 +44,18 @@ public class FrameBuilderTest { FrameBuilder builder; + AutoCloseable mocks; + + @BeforeEach + void init() { + this.mocks = MockitoAnnotations.openMocks(this); + } + + @AfterEach + void tearDown() throws Exception { + mocks.close(); + } + @Test public void buildFrameInOneGo() throws IOException { buffer = ByteBuffer.wrap(new byte[] { 1, 0, 0, 0, 0, 0, 3, 1, 2, 3, end() }); diff --git a/src/test/java/com/rabbitmq/client/test/FrameTest.java b/src/test/java/com/rabbitmq/client/test/FrameTest.java index e78ec48a70..fae132263b 100644 --- a/src/test/java/com/rabbitmq/client/test/FrameTest.java +++ b/src/test/java/com/rabbitmq/client/test/FrameTest.java @@ -3,7 +3,7 @@ import com.rabbitmq.client.AMQP; import com.rabbitmq.client.impl.Frame; import com.rabbitmq.client.impl.nio.ByteBufferOutputStream; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.DataOutputStream; import java.io.IOException; diff --git a/src/test/java/com/rabbitmq/client/test/GeneratedClassesTest.java b/src/test/java/com/rabbitmq/client/test/GeneratedClassesTest.java index 78919bbca6..d8b139e7d7 100644 --- a/src/test/java/com/rabbitmq/client/test/GeneratedClassesTest.java +++ b/src/test/java/com/rabbitmq/client/test/GeneratedClassesTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,14 +17,14 @@ import com.rabbitmq.client.AMQP; import com.rabbitmq.client.impl.AMQImpl; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.Calendar; import java.util.Date; import static java.util.Collections.singletonMap; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; /** * diff --git a/src/test/java/com/rabbitmq/client/test/JavaNioTest.java b/src/test/java/com/rabbitmq/client/test/JavaNioTest.java index 0d143e86e8..925c31ed55 100644 --- a/src/test/java/com/rabbitmq/client/test/JavaNioTest.java +++ b/src/test/java/com/rabbitmq/client/test/JavaNioTest.java @@ -5,9 +5,9 @@ import com.rabbitmq.client.impl.nio.DefaultByteBufferFactory; import com.rabbitmq.client.impl.nio.NioParams; import org.assertj.core.api.Condition; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.nio.ByteBuffer; @@ -16,8 +16,8 @@ import java.util.concurrent.atomic.AtomicInteger; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @@ -28,14 +28,14 @@ public class JavaNioTest { private Connection testConnection; - @Before + @BeforeEach public void init() throws Exception { ConnectionFactory connectionFactory = new ConnectionFactory(); connectionFactory.useNio(); testConnection = connectionFactory.newConnection(); } - @After + @AfterEach public void tearDown() throws Exception { if (testConnection != null) { testConnection.createChannel().queueDelete(QUEUE); @@ -52,7 +52,7 @@ public void connection() throws Exception { try { connection = basicGetBasicConsume(connectionFactory, "nio.queue", latch); boolean messagesReceived = latch.await(5, TimeUnit.SECONDS); - assertTrue("Message has not been received", messagesReceived); + assertTrue(messagesReceived, "Message has not been received"); } finally { safeClose(connection); } @@ -71,7 +71,7 @@ public void twoConnections() throws IOException, TimeoutException, InterruptedEx connection2 = basicGetBasicConsume(connectionFactory, "nio.queue.2", latch); boolean messagesReceived = latch.await(5, TimeUnit.SECONDS); - assertTrue("Messages have not been received", messagesReceived); + assertTrue(messagesReceived, "Messages have not been received"); } finally { safeClose(connection1); safeClose(connection2); @@ -91,7 +91,7 @@ public void twoConnectionsWithNioExecutor() throws IOException, TimeoutException connection2 = basicGetBasicConsume(connectionFactory, "nio.queue.2", latch); boolean messagesReceived = latch.await(5, TimeUnit.SECONDS); - assertTrue("Messages have not been received", messagesReceived); + assertTrue(messagesReceived, "Messages have not been received"); } finally { safeClose(connection1); safeClose(connection2); @@ -114,7 +114,7 @@ public void shutdownCompleted(ShutdownSignalException cause) { } }); safeClose(connection); - assertTrue("Shutdown listener should have been called", latch.await(5, TimeUnit.SECONDS)); + assertTrue(latch.await(5, TimeUnit.SECONDS), "Shutdown listener should have been called"); } finally { safeClose(connection); } @@ -194,7 +194,7 @@ public void customWriteQueue() throws Exception { private void sendAndVerifyMessage(Connection connection, int size) throws Exception { CountDownLatch latch = new CountDownLatch(1); boolean messageReceived = basicGetBasicConsume(connection, QUEUE, latch, size); - assertTrue("Message has not been received", messageReceived); + assertTrue(messageReceived, "Message has not been received"); } private Connection basicGetBasicConsume(ConnectionFactory connectionFactory, String queue, final CountDownLatch latch) diff --git a/src/test/java/com/rabbitmq/client/test/LambdaCallbackTest.java b/src/test/java/com/rabbitmq/client/test/LambdaCallbackTest.java index 0f30f4f83a..68390b0631 100644 --- a/src/test/java/com/rabbitmq/client/test/LambdaCallbackTest.java +++ b/src/test/java/com/rabbitmq/client/test/LambdaCallbackTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,7 +17,7 @@ import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.UUID; @@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public class LambdaCallbackTest extends BrokerTestCase { @@ -53,7 +53,7 @@ protected void releaseResources() throws IOException { Channel channel = connection.createChannel(); channel.addShutdownListener(cause -> latch.countDown()); } - assertTrue("Connection closed, shutdown listeners should have been called", latch.await(1, TimeUnit.SECONDS)); + assertTrue(latch.await(1, TimeUnit.SECONDS), "Connection closed, shutdown listeners should have been called"); } @Test public void confirmListener() throws Exception { @@ -64,14 +64,14 @@ protected void releaseResources() throws IOException { (deliveryTag, multiple) -> {} ); channel.basicPublish("", "whatever", null, "dummy".getBytes()); - assertTrue("Should have received publisher confirm", latch.await(1, TimeUnit.SECONDS)); + assertTrue(latch.await(1, TimeUnit.SECONDS), "Should have received publisher confirm"); } @Test public void returnListener() throws Exception { CountDownLatch latch = new CountDownLatch(1); channel.addReturnListener(returnMessage -> latch.countDown()); channel.basicPublish("", "notlikelytoexist", true, null, "dummy".getBytes()); - assertTrue("Should have received returned message", latch.await(1, TimeUnit.SECONDS)); + assertTrue(latch.await(1, TimeUnit.SECONDS), "Should have received returned message"); } @Test public void blockedListener() throws Exception { @@ -90,7 +90,7 @@ protected void releaseResources() throws IOException { block(); Channel ch = connection.createChannel(); ch.basicPublish("", "", null, "dummy".getBytes()); - assertTrue("Should have been blocked and unblocked", latch.await(10, TimeUnit.SECONDS)); + assertTrue(latch.await(10, TimeUnit.SECONDS), "Should have been blocked and unblocked"); } } @@ -104,9 +104,9 @@ protected void releaseResources() throws IOException { consumerTag -> cancelLatch.countDown() ); this.channel.basicPublish("", queue, null, "dummy".getBytes()); - assertTrue("deliver callback should have been called", consumingLatch.await(1, TimeUnit.SECONDS)); + assertTrue(consumingLatch.await(1, TimeUnit.SECONDS), "deliver callback should have been called"); this.channel.queueDelete(queue); - assertTrue("cancel callback should have been called", cancelLatch.await(1, TimeUnit.SECONDS)); + assertTrue(cancelLatch.await(1, TimeUnit.SECONDS), "cancel callback should have been called"); } } @@ -120,9 +120,9 @@ protected void releaseResources() throws IOException { (consumerTag, sig) -> shutdownLatch.countDown() ); this.channel.basicPublish("", queue, null, "dummy".getBytes()); - assertTrue("deliver callback should have been called", consumingLatch.await(1, TimeUnit.SECONDS)); + assertTrue(consumingLatch.await(1, TimeUnit.SECONDS), "deliver callback should have been called"); } - assertTrue("shutdown callback should have been called", shutdownLatch.await(1, TimeUnit.SECONDS)); + assertTrue(shutdownLatch.await(1, TimeUnit.SECONDS), "shutdown callback should have been called"); } @Test public void basicConsumeCancelDeliverShutdown() throws Exception { @@ -138,9 +138,9 @@ protected void releaseResources() throws IOException { (consumerTag, sig) -> shutdownLatch.countDown() ); this.channel.basicPublish("", queue, null, "dummy".getBytes()); - assertTrue("deliver callback should have been called", consumingLatch.await(1, TimeUnit.SECONDS)); + assertTrue(consumingLatch.await(1, TimeUnit.SECONDS), "deliver callback should have been called"); } - assertTrue("shutdown callback should have been called", shutdownLatch.await(1, TimeUnit.SECONDS)); + assertTrue(shutdownLatch.await(1, TimeUnit.SECONDS), "shutdown callback should have been called"); } } diff --git a/src/test/java/com/rabbitmq/client/test/LongStringTest.java b/src/test/java/com/rabbitmq/client/test/LongStringTest.java index 7c711b4fe4..82c6053116 100644 --- a/src/test/java/com/rabbitmq/client/test/LongStringTest.java +++ b/src/test/java/com/rabbitmq/client/test/LongStringTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,11 +17,11 @@ import com.rabbitmq.client.LongString; import com.rabbitmq.client.impl.LongStringHelper; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.UnsupportedEncodingException; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public class LongStringTest { diff --git a/src/test/java/com/rabbitmq/client/test/MetricsCollectorTest.java b/src/test/java/com/rabbitmq/client/test/MetricsCollectorTest.java index 965707ba12..2286f6611a 100644 --- a/src/test/java/com/rabbitmq/client/test/MetricsCollectorTest.java +++ b/src/test/java/com/rabbitmq/client/test/MetricsCollectorTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -26,11 +26,11 @@ import io.opentelemetry.sdk.metrics.data.LongPointData; import io.opentelemetry.sdk.metrics.data.MetricData; import io.opentelemetry.sdk.testing.junit4.OpenTelemetryRule; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import io.opentelemetry.sdk.testing.junit5.OpenTelemetryExtension; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.extension.RegisterExtension; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import java.io.IOException; import java.util.List; @@ -42,13 +42,11 @@ /** * */ -@RunWith(Parameterized.class) public class MetricsCollectorTest { - @ClassRule - public static final OpenTelemetryRule openTelemetryRule = OpenTelemetryRule.create(); + @RegisterExtension + static final OpenTelemetryExtension otelTesting = OpenTelemetryExtension.create(); - @Parameterized.Parameters public static Object[] data() { // need to resort to a factory, as this method is called only once // if creating the collector instance, it's reused across the test methods @@ -56,17 +54,15 @@ public static Object[] data() { return new Object[]{new StandardMetricsCollectorFactory(), new MicrometerMetricsCollectorFactory(), new OpenTelemetryMetricsCollectorFactory()}; } - @Parameterized.Parameter - public MetricsCollectorFactory factory; - - @Before + @BeforeEach public void reset() { // reset metrics - openTelemetryRule.clearMetrics(); + otelTesting.clearMetrics(); } - @Test - public void basicGetAndAck() { + @ParameterizedTest + @MethodSource("data") + public void basicGetAndAck(MetricsCollectorFactory factory) { AbstractMetricsCollector metrics = factory.create(); Connection connection = mock(Connection.class); when(connection.getId()).thenReturn("connection-1"); @@ -97,7 +93,9 @@ public void basicGetAndAck() { assertThat(acknowledgedMessages(metrics)).isEqualTo(1L+2L+1L); } - @Test public void basicConsumeAndAck() { + @ParameterizedTest + @MethodSource("data") + public void basicConsumeAndAck(MetricsCollectorFactory factory) { AbstractMetricsCollector metrics = factory.create(); Connection connection = mock(Connection.class); when(connection.getId()).thenReturn("connection-1"); @@ -136,7 +134,9 @@ public void basicGetAndAck() { assertThat(acknowledgedMessages(metrics)).isEqualTo(1L+2L+1L); } - @Test public void publishingAndPublishingFailures() { + @ParameterizedTest + @MethodSource("data") + public void publishingAndPublishingFailures(MetricsCollectorFactory factory) { AbstractMetricsCollector metrics = factory.create(); Channel channel = mock(Channel.class); @@ -164,7 +164,9 @@ public void basicGetAndAck() { assertThat(publishedMessages(metrics)).isEqualTo(2L); } - @Test public void publishingAcknowledgements() { + @ParameterizedTest + @MethodSource("data") + public void publishingAcknowledgements(MetricsCollectorFactory factory) { long anyDeliveryTag = 123L; AbstractMetricsCollector metrics = factory.create(); Channel channel = mock(Channel.class); @@ -184,7 +186,9 @@ public void basicGetAndAck() { assertThat(publishAck(metrics)).isEqualTo(2); } - @Test public void publishingNotAcknowledgements() { + @ParameterizedTest + @MethodSource("data") + public void publishingNotAcknowledgements(MetricsCollectorFactory factory) { long anyDeliveryTag = 123L; AbstractMetricsCollector metrics = factory.create(); Channel channel = mock(Channel.class); @@ -204,7 +208,9 @@ public void basicGetAndAck() { assertThat(publishNack(metrics)).isEqualTo(2L); } - @Test public void publishingUnrouted() { + @ParameterizedTest + @MethodSource("data") + public void publishingUnrouted(MetricsCollectorFactory factory) { AbstractMetricsCollector metrics = factory.create(); Channel channel = mock(Channel.class); // begins with no messages not-acknowledged @@ -220,7 +226,9 @@ public void basicGetAndAck() { assertThat(publishUnrouted(metrics)).isEqualTo(2L); } - @Test public void cleanStaleState() { + @ParameterizedTest + @MethodSource("data") + public void cleanStaleState(MetricsCollectorFactory factory) { AbstractMetricsCollector metrics = factory.create(); Connection openConnection = mock(Connection.class); when(openConnection.getId()).thenReturn("connection-1"); @@ -390,13 +398,13 @@ public AbstractMetricsCollector create() { static class OpenTelemetryMetricsCollectorFactory implements MetricsCollectorFactory { @Override public AbstractMetricsCollector create() { - return new OpenTelemetryMetricsCollector(openTelemetryRule.getOpenTelemetry()); + return new OpenTelemetryMetricsCollector(otelTesting.getOpenTelemetry()); } } static long getOpenTelemetryCounterMeterValue(String name) { // open telemetry metrics - List metrics = openTelemetryRule.getMetrics(); + List metrics = otelTesting.getMetrics(); // metric value return metrics.stream() .filter(metric -> metric.getName().equals(name)) diff --git a/src/test/java/com/rabbitmq/client/test/MicrometerMetricsCollectorTest.java b/src/test/java/com/rabbitmq/client/test/MicrometerMetricsCollectorTest.java index 125d185160..16c7fc12df 100644 --- a/src/test/java/com/rabbitmq/client/test/MicrometerMetricsCollectorTest.java +++ b/src/test/java/com/rabbitmq/client/test/MicrometerMetricsCollectorTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,12 +15,14 @@ package com.rabbitmq.client.test; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + import com.rabbitmq.client.impl.MicrometerMetricsCollector; import io.micrometer.core.instrument.Meter; import io.micrometer.core.instrument.simple.SimpleMeterRegistry; import org.assertj.core.api.Assertions; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; /** * @@ -31,7 +33,7 @@ public class MicrometerMetricsCollectorTest { MicrometerMetricsCollector collector; - @Before + @BeforeEach public void init() { registry = new SimpleMeterRegistry(); } @@ -52,9 +54,10 @@ public void tags() { } } - @Test(expected = IllegalArgumentException.class) + @Test public void tagsMustBeKeyValuePairs() { - collector = new MicrometerMetricsCollector(registry, "rabbitmq", "uri"); + assertThatThrownBy(() -> new MicrometerMetricsCollector(registry, "rabbitmq", "uri")) + .isInstanceOf(IllegalArgumentException.class); } } diff --git a/src/test/java/com/rabbitmq/client/test/MultiThreadedChannel.java b/src/test/java/com/rabbitmq/client/test/MultiThreadedChannel.java index 93a2d1c837..7893ab056b 100644 --- a/src/test/java/com/rabbitmq/client/test/MultiThreadedChannel.java +++ b/src/test/java/com/rabbitmq/client/test/MultiThreadedChannel.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,7 +17,7 @@ import java.util.concurrent.atomic.AtomicReference; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * Tests whether a Channel is safe for multi-threaded access diff --git a/src/test/java/com/rabbitmq/client/test/NioDeadlockOnConnectionClosing.java b/src/test/java/com/rabbitmq/client/test/NioDeadlockOnConnectionClosing.java index 0f3984ade7..9ca7dd156a 100644 --- a/src/test/java/com/rabbitmq/client/test/NioDeadlockOnConnectionClosing.java +++ b/src/test/java/com/rabbitmq/client/test/NioDeadlockOnConnectionClosing.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -18,9 +18,9 @@ import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.impl.nio.NioParams; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; import static com.rabbitmq.client.test.TestUtils.closeAllConnectionsAndWaitForRecovery; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @@ -44,7 +44,7 @@ public class NioDeadlockOnConnectionClosing { ConnectionFactory cf; List connections; - @Before + @BeforeEach public void setUp() { nioExecutorService = Executors.newFixedThreadPool(2); connectionShutdownExecutorService = Executors.newFixedThreadPool(2); @@ -60,7 +60,7 @@ public void setUp() { connections = new ArrayList<>(); } - @After + @AfterEach public void tearDown() throws Exception { for (Connection connection : connections) { try { diff --git a/src/test/java/com/rabbitmq/client/test/NoAutoRecoveryWhenTcpWindowIsFullTest.java b/src/test/java/com/rabbitmq/client/test/NoAutoRecoveryWhenTcpWindowIsFullTest.java index 247fdcfd57..ea0bf72c74 100644 --- a/src/test/java/com/rabbitmq/client/test/NoAutoRecoveryWhenTcpWindowIsFullTest.java +++ b/src/test/java/com/rabbitmq/client/test/NoAutoRecoveryWhenTcpWindowIsFullTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -27,10 +27,10 @@ import com.rabbitmq.client.impl.nio.NioParams; import com.rabbitmq.client.impl.recovery.AutorecoveringChannel; import com.rabbitmq.client.impl.recovery.AutorecoveringConnection; -import org.junit.After; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Test; +import com.rabbitmq.client.test.TestUtils.DisabledIfBrokerRunningOnDocker; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.net.Socket; @@ -42,7 +42,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; -import org.junit.rules.TestRule; import static org.assertj.core.api.Assertions.assertThat; @@ -66,11 +65,9 @@ * to the socket fails. *

*/ +@DisabledIfBrokerRunningOnDocker public class NoAutoRecoveryWhenTcpWindowIsFullTest { - @ClassRule - public static TestRule brokerOnDockerTestRule = TestUtils.brokerIsNotRunningOnDocker(); - private static final int NUM_MESSAGES_TO_PRODUCE = 50000; private static final int MESSAGE_PROCESSING_TIME_MS = 3000; private static final byte[] MESSAGE_CONTENT = ("MESSAGE CONTENT " + NUM_MESSAGES_TO_PRODUCE).getBytes(); @@ -83,7 +80,7 @@ public class NoAutoRecoveryWhenTcpWindowIsFullTest { private CountDownLatch consumerOkLatch; - @Before + @BeforeEach public void setUp() throws Exception { // we need several threads to publish, dispatch deliveries, handle RPC responses, etc. executorService = Executors.newFixedThreadPool(10); @@ -123,7 +120,7 @@ public void configure(Socket socket) throws IOException { consumerOkLatch = new CountDownLatch(2); } - @After + @AfterEach public void tearDown() throws IOException { closeConnectionIfOpen(consumingConnection); closeConnectionIfOpen(producingConnection); diff --git a/src/test/java/com/rabbitmq/client/test/PropertyFileInitialisationTest.java b/src/test/java/com/rabbitmq/client/test/PropertyFileInitialisationTest.java index 40138a26d6..24d3f808d8 100644 --- a/src/test/java/com/rabbitmq/client/test/PropertyFileInitialisationTest.java +++ b/src/test/java/com/rabbitmq/client/test/PropertyFileInitialisationTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,7 +17,7 @@ import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.ConnectionFactoryConfigurator; -import org.junit.Test; +import org.junit.jupiter.api.Test; import javax.net.ssl.SSLContext; import java.io.FileReader; diff --git a/src/test/java/com/rabbitmq/client/test/QueueingConsumerTests.java b/src/test/java/com/rabbitmq/client/test/QueueingConsumerTests.java index ba9d72e47b..4a4793952f 100644 --- a/src/test/java/com/rabbitmq/client/test/QueueingConsumerTests.java +++ b/src/test/java/com/rabbitmq/client/test/QueueingConsumerTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,10 +15,10 @@ package com.rabbitmq.client.test; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; import com.rabbitmq.client.ConsumerCancelledException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.concurrent.ArrayBlockingQueue; diff --git a/src/test/java/com/rabbitmq/client/test/RecoveryAwareAMQConnectionFactoryTest.java b/src/test/java/com/rabbitmq/client/test/RecoveryAwareAMQConnectionFactoryTest.java index 785b58ec53..2b40553778 100644 --- a/src/test/java/com/rabbitmq/client/test/RecoveryAwareAMQConnectionFactoryTest.java +++ b/src/test/java/com/rabbitmq/client/test/RecoveryAwareAMQConnectionFactoryTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -24,7 +24,7 @@ import com.rabbitmq.client.impl.FrameHandlerFactory; import com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnection; import com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.Arrays; @@ -32,7 +32,7 @@ import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.TimeoutException; -import static org.junit.Assert.assertSame; +import static org.junit.jupiter.api.Assertions.assertSame; import static org.mockito.Mockito.*; public class RecoveryAwareAMQConnectionFactoryTest { diff --git a/src/test/java/com/rabbitmq/client/test/RecoveryDelayHandlerTest.java b/src/test/java/com/rabbitmq/client/test/RecoveryDelayHandlerTest.java index be9958b487..035b96191d 100644 --- a/src/test/java/com/rabbitmq/client/test/RecoveryDelayHandlerTest.java +++ b/src/test/java/com/rabbitmq/client/test/RecoveryDelayHandlerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,7 +15,8 @@ package com.rabbitmq.client.test; -import static org.junit.Assert.assertEquals; +import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.util.Arrays; import java.util.Collections; @@ -24,7 +25,7 @@ import com.rabbitmq.client.RecoveryDelayHandler.DefaultRecoveryDelayHandler; import com.rabbitmq.client.RecoveryDelayHandler.ExponentialBackoffDelayHandler; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class RecoveryDelayHandlerTest { @@ -61,13 +62,15 @@ public void testExponentialBackoffDelayHandlerSequence() { assertEquals(2, handler.getDelay(Integer.MAX_VALUE)); } - @Test(expected=IllegalArgumentException.class) + @Test public void testExponentialBackoffDelayHandlerWithNullSequence() { - new ExponentialBackoffDelayHandler(null); + assertThatThrownBy(() -> new ExponentialBackoffDelayHandler(null)) + .isInstanceOf(IllegalArgumentException.class); } - @Test(expected=IllegalArgumentException.class) + @Test public void testExponentialBackoffDelayHandlerWithEmptySequence() { - new ExponentialBackoffDelayHandler(Collections.emptyList()); + assertThatThrownBy(() -> new ExponentialBackoffDelayHandler(Collections.emptyList())) + .isInstanceOf(IllegalArgumentException.class); } } diff --git a/src/test/java/com/rabbitmq/client/test/RefreshCredentialsTest.java b/src/test/java/com/rabbitmq/client/test/RefreshCredentialsTest.java index 0a0100cbc6..8e32dbc6c3 100644 --- a/src/test/java/com/rabbitmq/client/test/RefreshCredentialsTest.java +++ b/src/test/java/com/rabbitmq/client/test/RefreshCredentialsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -20,10 +20,10 @@ import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.impl.DefaultCredentialsRefreshService; import com.rabbitmq.client.impl.RefreshProtectedCredentialsProvider; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Test; -import org.junit.rules.TestRule; +import com.rabbitmq.client.test.TestUtils.BrokerVersion; +import com.rabbitmq.client.test.TestUtils.BrokerVersionAtLeast; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.time.Duration; import java.time.Instant; @@ -33,13 +33,12 @@ import static org.assertj.core.api.Assertions.assertThat; +@BrokerVersionAtLeast(BrokerVersion.RABBITMQ_3_8) public class RefreshCredentialsTest { - @ClassRule - public static TestRule brokerVersionTestRule = TestUtils.atLeast38(); DefaultCredentialsRefreshService refreshService; - @Before + @BeforeEach public void tearDown() { if (refreshService != null) { refreshService.close(); diff --git a/src/test/java/com/rabbitmq/client/test/RequiredPropertiesSuite.java b/src/test/java/com/rabbitmq/client/test/RequiredPropertiesSuite.java index f8ab431800..f0040e43ab 100644 --- a/src/test/java/com/rabbitmq/client/test/RequiredPropertiesSuite.java +++ b/src/test/java/com/rabbitmq/client/test/RequiredPropertiesSuite.java @@ -1,10 +1,5 @@ package com.rabbitmq.client.test; -import org.junit.runner.Runner; -import org.junit.runner.notification.RunNotifier; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -import org.junit.runners.model.RunnerBuilder; import java.util.ArrayList; import java.util.List; @@ -14,8 +9,9 @@ /** * */ -public class RequiredPropertiesSuite extends Suite { +public class RequiredPropertiesSuite { //extends Suite { +/* private static final Logger LOGGER = LoggerFactory.getLogger(RequiredPropertiesSuite.class); public RequiredPropertiesSuite(Class klass, RunnerBuilder builder) throws InitializationError { @@ -52,4 +48,6 @@ protected void runChild(Runner runner, RunNotifier notifier) { LOGGER.info("Running test {}", runner.getDescription().getDisplayName()); super.runChild(runner, notifier); } + + */ } diff --git a/src/test/java/com/rabbitmq/client/test/RpcTest.java b/src/test/java/com/rabbitmq/client/test/RpcTest.java index d535d9c8f7..5d95d0d448 100644 --- a/src/test/java/com/rabbitmq/client/test/RpcTest.java +++ b/src/test/java/com/rabbitmq/client/test/RpcTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -25,9 +25,9 @@ import com.rabbitmq.client.impl.recovery.TopologyRecoveryFilter; import com.rabbitmq.tools.Host; import org.assertj.core.api.Assertions; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.time.Duration; @@ -40,7 +40,7 @@ import java.util.concurrent.atomic.AtomicInteger; import static com.rabbitmq.client.test.TestUtils.waitAtMost; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class RpcTest { @@ -49,7 +49,7 @@ public class RpcTest { String queue = "rpc.queue"; RpcServer rpcServer; - @Before + @BeforeEach public void init() throws Exception { clientConnection = TestUtils.connectionFactory().newConnection(); clientChannel = clientConnection.createChannel(); @@ -58,7 +58,7 @@ public void init() throws Exception { serverChannel.queueDeclare(queue, false, false, false, null); } - @After + @AfterEach public void tearDown() throws Exception { if (rpcServer != null) { rpcServer.terminateMainloop(); @@ -241,7 +241,7 @@ public void handleRecoveryStarted(Recoverable recoverable) { } }); Host.closeConnection((NetworkConnection) connection); - assertTrue("Connection should have recovered by now", recoveryLatch.await(10, TimeUnit.SECONDS)); + assertTrue(recoveryLatch.await(10, TimeUnit.SECONDS), "Connection should have recovered by now"); client = new RpcClient(new RpcClientParams() .channel(channel).exchange("").routingKey(queue).timeout(1000)); response = client.doCall(null, "hello".getBytes()); @@ -289,7 +289,7 @@ public void handleRecoveryStarted(Recoverable recoverable) { } }); Host.closeConnection((NetworkConnection) connection); - assertTrue("Connection should have recovered by now", recoveryLatch.await(10, TimeUnit.SECONDS)); + assertTrue(recoveryLatch.await(10, TimeUnit.SECONDS), "Connection should have recovered by now"); try { new RpcClient(new RpcClientParams() .channel(channel).exchange("").routingKey(queue).timeout(1000)); diff --git a/src/test/java/com/rabbitmq/client/test/RpcTopologyRecordingTest.java b/src/test/java/com/rabbitmq/client/test/RpcTopologyRecordingTest.java index 3769218fd7..249eeb3f1b 100644 --- a/src/test/java/com/rabbitmq/client/test/RpcTopologyRecordingTest.java +++ b/src/test/java/com/rabbitmq/client/test/RpcTopologyRecordingTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,9 +17,6 @@ import com.rabbitmq.client.*; import com.rabbitmq.client.impl.AMQImpl; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; import java.io.IOException; import java.util.UUID; @@ -27,20 +24,18 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import static com.rabbitmq.client.test.TestUtils.closeAndWaitForRecovery; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; -@RunWith(Parameterized.class) public class RpcTopologyRecordingTest extends BrokerTestCase { - @Parameterized.Parameter - public RpcCall rpcCall; String exchange, queue, routingKey; String exchange2, queue2, routingKey2; - @Parameterized.Parameters public static Object[] data() { return new Object[]{ (RpcCall) (channel, method) -> channel.asyncCompletableRpc(method).get(5, TimeUnit.SECONDS), @@ -73,9 +68,10 @@ protected void releaseResources() throws IOException { channel.exchangeDelete(exchange2); } - @Test - public void topologyRecovery() throws Exception { - createTopology(); + @ParameterizedTest + @MethodSource("data") + public void topologyRecovery(RpcCall rpcCall) throws Exception { + createTopology(rpcCall); AtomicReference latch = new AtomicReference<>(new CountDownLatch(2)); DeliverCallback countDown = (ctag, message) -> latch.get().countDown(); @@ -98,9 +94,10 @@ public void topologyRecovery() throws Exception { assertTrue(latch.get().await(5, TimeUnit.SECONDS)); } - @Test - public void deletionAreProperlyRecorded() throws Exception { - createTopology(); + @ParameterizedTest + @MethodSource("data") + public void deletionAreProperlyRecorded(RpcCall rpcCall) throws Exception { + createTopology(rpcCall); AtomicReference latch = new AtomicReference<>(new CountDownLatch(2)); DeliverCallback countDown = (ctag, message) -> latch.get().countDown(); @@ -151,9 +148,10 @@ boolean exchangeExists(String exchange) throws TimeoutException { } } - @Test - public void bindingDeletionAreProperlyRecorded() throws Exception { - createTopology(); + @ParameterizedTest + @MethodSource("data") + public void bindingDeletionAreProperlyRecorded(RpcCall rpcCall) throws Exception { + createTopology(rpcCall); AtomicReference latch = new AtomicReference<>(new CountDownLatch(2)); DeliverCallback countDown = (ctag, message) -> latch.get().countDown(); @@ -167,7 +165,7 @@ public void bindingDeletionAreProperlyRecorded() throws Exception { assertTrue(latch.get().await(5, TimeUnit.SECONDS)); - unbind(); + unbind(rpcCall); latch.set(new CountDownLatch(2)); @@ -178,9 +176,9 @@ public void bindingDeletionAreProperlyRecorded() throws Exception { assertFalse(latch.get().await(2, TimeUnit.SECONDS)); } - private void createTopology() throws Exception { - createAndBind(exchange, queue, routingKey); - createAndBind(exchange2, queue2, routingKey2); + private void createTopology(RpcCall rpcCall) throws Exception { + createAndBind(rpcCall, exchange, queue, routingKey); + createAndBind(rpcCall, exchange2, queue2, routingKey2); rpcCall.call(channel, new AMQImpl.Exchange.Bind.Builder() .source(exchange) .destination(exchange2) @@ -189,7 +187,7 @@ private void createTopology() throws Exception { .build()); } - private void createAndBind(String e, String q, String rk) throws Exception { + private void createAndBind(RpcCall rpcCall, String e, String q, String rk) throws Exception { rpcCall.call(channel, new AMQImpl.Queue.Declare.Builder() .queue(q) .durable(false) @@ -212,7 +210,7 @@ private void createAndBind(String e, String q, String rk) throws Exception { .build()); } - private void unbind() throws Exception { + private void unbind(RpcCall rpcCall) throws Exception { rpcCall.call(channel, new AMQImpl.Queue.Unbind.Builder() .exchange(exchange) .queue(queue) diff --git a/src/test/java/com/rabbitmq/client/test/SharedThreadPoolTest.java b/src/test/java/com/rabbitmq/client/test/SharedThreadPoolTest.java index 747a2805e5..0e8317b987 100644 --- a/src/test/java/com/rabbitmq/client/test/SharedThreadPoolTest.java +++ b/src/test/java/com/rabbitmq/client/test/SharedThreadPoolTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,8 +15,8 @@ package com.rabbitmq.client.test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.concurrent.ExecutorService; @@ -24,7 +24,7 @@ import java.util.concurrent.TimeoutException; import com.rabbitmq.client.Connection; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.impl.AMQConnection; diff --git a/src/test/java/com/rabbitmq/client/test/SslContextFactoryTest.java b/src/test/java/com/rabbitmq/client/test/SslContextFactoryTest.java index 585e74f7a8..69a3eee1e8 100644 --- a/src/test/java/com/rabbitmq/client/test/SslContextFactoryTest.java +++ b/src/test/java/com/rabbitmq/client/test/SslContextFactoryTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -19,7 +19,7 @@ import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.SslContextFactory; import com.rabbitmq.client.TrustEverythingTrustManager; -import org.junit.Test; +import org.junit.jupiter.api.Test; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLHandshakeException; @@ -32,7 +32,7 @@ import java.util.Map; import java.util.function.Supplier; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; /** * diff --git a/src/test/java/com/rabbitmq/client/test/StrictExceptionHandlerTest.java b/src/test/java/com/rabbitmq/client/test/StrictExceptionHandlerTest.java index fbb3ad984b..c2a3f28aa9 100644 --- a/src/test/java/com/rabbitmq/client/test/StrictExceptionHandlerTest.java +++ b/src/test/java/com/rabbitmq/client/test/StrictExceptionHandlerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -23,7 +23,7 @@ import com.rabbitmq.client.DefaultConsumer; import com.rabbitmq.client.Envelope; import com.rabbitmq.client.impl.StrictExceptionHandler; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; diff --git a/src/test/java/com/rabbitmq/client/test/TableTest.java b/src/test/java/com/rabbitmq/client/test/TableTest.java index d39e871760..be808fa262 100644 --- a/src/test/java/com/rabbitmq/client/test/TableTest.java +++ b/src/test/java/com/rabbitmq/client/test/TableTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -18,7 +18,8 @@ import com.rabbitmq.client.impl.*; import java.sql.Timestamp; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.*; import java.math.BigDecimal; @@ -26,12 +27,12 @@ import java.util.HashMap; import java.util.Map; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; public class TableTest { - public byte [] marshal(Map table) + public byte [] marshal(Map table) throws IOException { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); diff --git a/src/test/java/com/rabbitmq/client/test/TestUtils.java b/src/test/java/com/rabbitmq/client/test/TestUtils.java index 2afffd8d33..8897bf23a9 100644 --- a/src/test/java/com/rabbitmq/client/test/TestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/TestUtils.java @@ -19,23 +19,17 @@ import com.rabbitmq.client.impl.NetworkConnection; import com.rabbitmq.client.impl.recovery.AutorecoveringConnection; import com.rabbitmq.tools.Host; +import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import java.lang.reflect.Method; -import java.util.List; +import java.util.function.Function; import org.assertj.core.api.Assertions; -import org.junit.AssumptionViolatedException; -import org.junit.rules.TestRule; -import org.junit.rules.TestWatcher; -import org.junit.runner.Description; -import org.junit.runner.Runner; -import org.junit.runner.notification.RunNotifier; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -import org.junit.runners.model.RunnerBuilder; -import org.junit.runners.model.Statement; +import org.junit.jupiter.api.extension.ConditionEvaluationResult; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.jupiter.api.extension.ExtensionContext.Namespace; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,7 +43,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; public class TestUtils { @@ -124,14 +118,6 @@ public static void abort(Connection connection) { } } - public static TestRule atLeast38() { - return new BrokerVersionTestRule("3.8.0"); - } - - public static TestRule brokerIsNotRunningOnDocker() { - return new BrokerIsNotOnDocker(); - } - public static boolean isVersion37orLater(Connection connection) { return atLeastVersion("3.7.0", connection); } @@ -145,11 +131,11 @@ public static boolean isVersion310orLater(Connection connection) { } private static boolean atLeastVersion(String expectedVersion, Connection connection) { - String currentVersion = null; + return atLeastVersion(expectedVersion, currentVersion(connection.getServerProperties().get("version").toString())); + } + + private static boolean atLeastVersion(String expectedVersion, String currentVersion) { try { - currentVersion = currentVersion( - connection.getServerProperties().get("version").toString() - ); return "0.0.0".equals(currentVersion) || versionCompare(currentVersion, expectedVersion) >= 0; } catch (RuntimeException e) { LoggerFactory.getLogger(TestUtils.class).warn("Unable to parse broker version {}", currentVersion, e); @@ -310,52 +296,6 @@ public static int randomNetworkPort() throws IOException { return port; } - private static class BrokerVersionTestRule implements TestRule { - - private final String version; - - public BrokerVersionTestRule(String version) { - this.version = version; - } - - @Override - public Statement apply(Statement base, Description description) { - return new Statement() { - @Override - public void evaluate() throws Throwable { - try (Connection c = TestUtils.connectionFactory().newConnection()) { - if (!TestUtils.atLeastVersion(version, c)) { - throw new AssumptionViolatedException("Broker version < " + version + ", skipping."); - } - } - base.evaluate(); - } - }; - } - } - - private static class BrokerIsNotOnDocker implements TestRule { - - @Override - public Statement apply(Statement base, Description description) { - return new Statement() { - @Override - public void evaluate() throws Throwable { - try { - if (Host.isOnDocker()) { - throw new AssumptionViolatedException("Broker is running on Docker"); - } - } catch (AssumptionViolatedException e) { - throw e; - } catch (Exception e) { - throw new AssumptionViolatedException("Could not check whether broker is running on Docker or not", e); - } - base.evaluate(); - } - }; - } - } - @FunctionalInterface public interface CallableFunction { @@ -387,6 +327,7 @@ public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProp return messageReceived; } + /* public static class DefaultTestSuite extends Suite { @@ -422,140 +363,132 @@ protected DefaultTestSuite(Class klass, List runners) } } - @Target({ElementType.METHOD}) - @Retention(RetentionPolicy.RUNTIME) - public @interface TestExecutionCondition { - - Class[] value(); + */ + public static void safeDelete(Connection connection, String queue) { + try { + Channel ch = connection.createChannel(); + ch.queueDelete(queue); + ch.close(); + } catch (Exception e) { + // OK + } } - interface ExecutionCondition { - - void check(Description description) throws Exception; - - } + private static class BaseBrokerVersionAtLeastCondition implements + org.junit.jupiter.api.extension.ExecutionCondition { - public static class BrokerAtLeast310Condition implements ExecutionCondition { + private final Function versionProvider; - private static final String VERSION = "3.10.0"; + private BaseBrokerVersionAtLeastCondition(Function versionProvider) { + this.versionProvider = versionProvider; + } @Override - public void check(Description description) throws Exception { - try (Connection c = TestUtils.connectionFactory().newConnection()) { - if (!TestUtils.atLeastVersion(VERSION, c)) { - throw new AssumptionViolatedException("Broker version < " + VERSION + ", skipping."); + public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { + if (!context.getTestMethod().isPresent()) { + return ConditionEvaluationResult.enabled("Apply only to methods"); + } + String expectedVersion = versionProvider.apply(context); + if (expectedVersion == null) { + return ConditionEvaluationResult.enabled("No broker version requirement"); + } else { + String brokerVersion = + context + .getRoot() + .getStore(Namespace.GLOBAL) + .getOrComputeIfAbsent( + "brokerVersion", + k -> { + try (Connection c = TestUtils.connectionFactory().newConnection()) { + return currentVersion( + c.getServerProperties().get("version").toString() + ); + } catch (Exception e) { + throw new RuntimeException(e); + } + }, + String.class); + + if (atLeastVersion(expectedVersion, brokerVersion)) { + return ConditionEvaluationResult.enabled( + "Broker version requirement met, expected " + + expectedVersion + + ", actual " + + brokerVersion); + } else { + return ConditionEvaluationResult.disabled( + "Broker version requirement not met, expected " + + expectedVersion + + ", actual " + + brokerVersion); } } } } - public static class ExecutionConditionRule implements TestRule { + private static class AnnotationBrokerVersionAtLeastCondition + extends BaseBrokerVersionAtLeastCondition { - @Override - public Statement apply(Statement base, Description description) { - return new Statement() { - @Override - public void evaluate() throws Throwable { - Method testMethod = description.getTestClass().getDeclaredMethod(description.getMethodName()); - TestExecutionCondition conditionAnnotation = testMethod.getAnnotation( - TestExecutionCondition.class); - if (conditionAnnotation != null) { - conditionAnnotation.value()[0].getConstructor().newInstance() - .check(description); - } - base.evaluate(); - } - }; + private AnnotationBrokerVersionAtLeastCondition() { + super( + context -> { + BrokerVersionAtLeast annotation = + context.getElement().get().getAnnotation(BrokerVersionAtLeast.class); + return annotation == null ? null : annotation.value().toString(); + }); } } - public static TestRule atLeastJava11() { - return new AtLeastJavaVersion(11); - } - - private static class AtLeastJavaVersion implements TestRule { + static class BrokerVersionAtLeast310Condition extends BaseBrokerVersionAtLeastCondition { - private final int expectedMinVersion; - - private AtLeastJavaVersion(int expectedMinVersion) { - this.expectedMinVersion = expectedMinVersion; + private BrokerVersionAtLeast310Condition() { + super(context -> "3.10.0"); } + } - @Override - public Statement apply(Statement base, Description description) { - return new Statement() { - @Override - public void evaluate() throws Throwable { - try { - int javaMajorVersion = javaMajorVersion(); - if (javaMajorVersion < expectedMinVersion) { - throw new AssumptionViolatedException("Java version is " + javaMajorVersion - + ", expecting at least " + expectedMinVersion); - } - } catch (AssumptionViolatedException e) { - throw e; - } catch (Exception e) { - throw new AssumptionViolatedException("Could determine Java version", e); - } - base.evaluate(); - } - }; - } + @Target({ElementType.TYPE, ElementType.METHOD}) + @Retention(RetentionPolicy.RUNTIME) + @Documented + @ExtendWith(AnnotationBrokerVersionAtLeastCondition.class) + public @interface BrokerVersionAtLeast { + + BrokerVersion value(); } - private static int javaMajorVersion() { - String javaVersion = System.getProperty("java.version"); - if (javaVersion == null || javaVersion.trim().isEmpty()) { - throw new IllegalStateException("JVM system property 'java.version' is undefined"); - } + public enum BrokerVersion { + RABBITMQ_3_8("3.8.0"), + RABBITMQ_3_10("3.10.0"); - if (javaVersion.startsWith("1.8")) { - return 8; - } + final String value; - try { - // from JUnit 5 JRE class - // java.lang.Runtime.version() is a static method available on Java 9+ - // that returns an instance of java.lang.Runtime.Version which has the - // following method: public int major() - Method versionMethod = Runtime.class.getMethod("version"); - Object version = versionMethod.invoke(null); - Method majorMethod = version.getClass().getMethod("major"); - int major = (int) majorMethod.invoke(version); - if (major < 9) { - throw new IllegalStateException("Invalid Java major version: " + major); - } - return major; - } catch (Exception ex) { - LOGGER.warn("Error while computing Java major version", ex); + BrokerVersion(String value) { + this.value = value; } - throw new IllegalStateException("Could not determine Java major version"); - } - public static void safeDelete(Connection connection, String queue) { - try { - Channel ch = connection.createChannel(); - ch.queueDelete(queue); - ch.close(); - } catch (Exception e) { - // OK + @Override + public String toString() { + return this.value; } } - public static class TestDescription extends TestWatcher { - - private volatile Description description; + static class DisabledIfBrokerRunningOnDockerCondition implements + org.junit.jupiter.api.extension.ExecutionCondition { @Override - protected void starting(Description d) { - description = d; - } - - public Description getDescription() { - return description; + public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { + if (Host.isOnDocker()) { + return ConditionEvaluationResult.enabled("Broker running on Docker"); + } else { + return ConditionEvaluationResult.enabled("Broker not running on Docker"); + } } } + @Target({ElementType.TYPE, ElementType.METHOD}) + @Retention(RetentionPolicy.RUNTIME) + @Documented + @ExtendWith(DisabledIfBrokerRunningOnDockerCondition.class) + @interface DisabledIfBrokerRunningOnDocker {} } diff --git a/src/test/java/com/rabbitmq/client/test/TestUtilsTest.java b/src/test/java/com/rabbitmq/client/test/TestUtilsTest.java index b73e8033cc..897296938d 100644 --- a/src/test/java/com/rabbitmq/client/test/TestUtilsTest.java +++ b/src/test/java/com/rabbitmq/client/test/TestUtilsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,7 +17,7 @@ import com.rabbitmq.client.Connection; import org.assertj.core.api.Assertions; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.HashMap; import java.util.Map; diff --git a/src/test/java/com/rabbitmq/client/test/TlsUtilsTest.java b/src/test/java/com/rabbitmq/client/test/TlsUtilsTest.java index f04d22dc1c..51a1b691e1 100644 --- a/src/test/java/com/rabbitmq/client/test/TlsUtilsTest.java +++ b/src/test/java/com/rabbitmq/client/test/TlsUtilsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,7 +15,7 @@ package com.rabbitmq.client.test; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.mockito.Mockito; import java.security.cert.CertificateParsingException; diff --git a/src/test/java/com/rabbitmq/client/test/TrafficListenerTest.java b/src/test/java/com/rabbitmq/client/test/TrafficListenerTest.java index ebc25349d4..db8d021194 100644 --- a/src/test/java/com/rabbitmq/client/test/TrafficListenerTest.java +++ b/src/test/java/com/rabbitmq/client/test/TrafficListenerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -21,9 +21,8 @@ import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.TrafficListener; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import java.util.List; import java.util.UUID; @@ -32,20 +31,16 @@ import java.util.concurrent.TimeUnit; import java.util.function.Consumer; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * */ -@RunWith(Parameterized.class) public class TrafficListenerTest { - @Parameterized.Parameter - public Consumer configurator; - @Parameterized.Parameters - public static Object[] data() { + static Object[] trafficListenerIsCalled() { return new Object[] { automaticRecoveryEnabled(), automaticRecoveryDisabled() }; } @@ -57,8 +52,9 @@ static Consumer automaticRecoveryDisabled() { return cf -> cf.setAutomaticRecoveryEnabled(false); } - @Test - public void trafficListenerIsCalled() throws Exception { + @ParameterizedTest + @MethodSource + public void trafficListenerIsCalled(Consumer configurator) throws Exception { ConnectionFactory cf = TestUtils.connectionFactory(); TestTrafficListener testTrafficListener = new TestTrafficListener(); cf.setTrafficListener(testTrafficListener); diff --git a/src/test/java/com/rabbitmq/client/test/TruncatedInputStreamTest.java b/src/test/java/com/rabbitmq/client/test/TruncatedInputStreamTest.java index 3adc9492a0..5d4a9d1273 100644 --- a/src/test/java/com/rabbitmq/client/test/TruncatedInputStreamTest.java +++ b/src/test/java/com/rabbitmq/client/test/TruncatedInputStreamTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,15 +16,15 @@ package com.rabbitmq.client.test; import com.rabbitmq.client.impl.TruncatedInputStream; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; /** * Some basic (retroactive) tests for TruncatedInputStream. @@ -40,12 +40,12 @@ public class TruncatedInputStreamTest { /** what length to truncate it to */ private static final int TRUNCATED_LENGTH = 3; - @Before public void setUp() throws Exception { + @BeforeEach public void setUp() throws Exception { InputStream baseStream = new ByteArrayInputStream(TEST_BYTES); _truncStream = new TruncatedInputStream(baseStream, TRUNCATED_LENGTH); } - @After public void tearDown() throws Exception { + @AfterEach public void tearDown() throws Exception { _truncStream = null; } diff --git a/src/test/java/com/rabbitmq/client/test/ValueOrExceptionTest.java b/src/test/java/com/rabbitmq/client/test/ValueOrExceptionTest.java index 1ae80029be..ac9a38b767 100644 --- a/src/test/java/com/rabbitmq/client/test/ValueOrExceptionTest.java +++ b/src/test/java/com/rabbitmq/client/test/ValueOrExceptionTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,9 +17,9 @@ import com.rabbitmq.utility.SensibleClone; import com.rabbitmq.utility.ValueOrException; -import org.junit.Test; +import org.junit.jupiter.api.Test; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class ValueOrExceptionTest { diff --git a/src/test/java/com/rabbitmq/client/test/functional/AbstractRejectTest.java b/src/test/java/com/rabbitmq/client/test/functional/AbstractRejectTest.java index 8c87db34f1..82b8b78035 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/AbstractRejectTest.java +++ b/src/test/java/com/rabbitmq/client/test/functional/AbstractRejectTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,9 +16,9 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.Arrays; @@ -29,27 +29,32 @@ import com.rabbitmq.client.GetResponse; import com.rabbitmq.client.QueueingConsumer; import com.rabbitmq.client.test.BrokerTestCase; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInfo; abstract class AbstractRejectTest extends BrokerTestCase { protected Channel secondaryChannel; + @BeforeEach @Override - public void setUp() + public void setUp(TestInfo info) throws IOException, TimeoutException { - super.setUp(); + super.setUp(info); secondaryChannel = connection.createChannel(); } + @AfterEach @Override - public void tearDown() + public void tearDown(TestInfo info) throws IOException, TimeoutException { if (secondaryChannel != null) { secondaryChannel.abort(); secondaryChannel = null; } - super.tearDown(); + super.tearDown(info); } protected long checkDelivery(QueueingConsumer.Delivery d, diff --git a/src/test/java/com/rabbitmq/client/test/functional/AlternateExchange.java b/src/test/java/com/rabbitmq/client/test/functional/AlternateExchange.java index 8f2dd6675a..816d9f70f5 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/AlternateExchange.java +++ b/src/test/java/com/rabbitmq/client/test/functional/AlternateExchange.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,7 +16,7 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; import java.util.HashMap; @@ -24,12 +24,14 @@ import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicBoolean; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.GetResponse; import com.rabbitmq.client.ReturnListener; import com.rabbitmq.client.test.BrokerTestCase; +import org.junit.jupiter.api.TestInfo; public class AlternateExchange extends BrokerTestCase { @@ -59,8 +61,9 @@ private static boolean[] expected(String key) { return expected; } - @Override public void setUp() throws IOException, TimeoutException { - super.setUp(); + @BeforeEach + @Override public void setUp(TestInfo info) throws IOException, TimeoutException { + super.setUp(info); channel.addReturnListener(new ReturnListener() { public void handleReturn(int replyCode, String replyText, @@ -131,7 +134,7 @@ protected void checkGet(boolean[] expected) throws IOException { for (int i = 0; i < resources.length; i++) { String q = resources[i]; GetResponse r = channel.basicGet(q, true); - assertEquals("check " + q , expected[i], r != null); + assertEquals(expected[i], r != null, "check " + q); } } diff --git a/src/test/java/com/rabbitmq/client/test/functional/BasicConsume.java b/src/test/java/com/rabbitmq/client/test/functional/BasicConsume.java index 06b5fb588f..38adbf71ee 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/BasicConsume.java +++ b/src/test/java/com/rabbitmq/client/test/functional/BasicConsume.java @@ -5,13 +5,13 @@ import com.rabbitmq.client.DefaultConsumer; import com.rabbitmq.client.Envelope; import com.rabbitmq.client.test.BrokerTestCase; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @@ -27,7 +27,7 @@ public class BasicConsume extends BrokerTestCase { channel.basicConsume(q, new CountDownLatchConsumer(channel, latch)); boolean nbOfExpectedMessagesHasBeenConsumed = latch.await(1, TimeUnit.SECONDS); - assertTrue("Not all the messages have been received", nbOfExpectedMessagesHasBeenConsumed); + assertTrue(nbOfExpectedMessagesHasBeenConsumed, "Not all the messages have been received"); } static class CountDownLatchConsumer extends DefaultConsumer { diff --git a/src/test/java/com/rabbitmq/client/test/functional/BasicGet.java b/src/test/java/com/rabbitmq/client/test/functional/BasicGet.java index e64dee9e9a..0956e8cc35 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/BasicGet.java +++ b/src/test/java/com/rabbitmq/client/test/functional/BasicGet.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,16 +15,16 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.concurrent.TimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AlreadyClosedException; import com.rabbitmq.client.Channel; diff --git a/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycle.java b/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycle.java index 91a5c54d49..a478748a7d 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycle.java +++ b/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycle.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,16 +16,16 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.concurrent.TimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.GetResponse; @@ -53,7 +53,7 @@ public class BindingLifecycle extends BindingLifecycleBase { channel.queuePurge(binding.q); GetResponse response = channel.basicGet(binding.q, true); - assertNull("The response SHOULD BE null", response); + assertNull(response, "The response SHOULD BE null"); deleteExchangeAndQueue(binding); } @@ -71,24 +71,24 @@ public class BindingLifecycle extends BindingLifecycleBase { GetResponse response = channel.basicGet(binding.q, false); assertFalse(response.getEnvelope().isRedeliver()); - assertNotNull("The response SHOULD NOT BE null", response); + assertNotNull(response, "The response SHOULD NOT BE null"); // If we purge the queue the unacked message should still be there on // recover. channel.queuePurge(binding.q); response = channel.basicGet(binding.q, true); - assertNull("The response SHOULD BE null", response); + assertNull(response, "The response SHOULD BE null"); channel.basicRecover(); response = channel.basicGet(binding.q, false); channel.basicRecover(); assertTrue(response.getEnvelope().isRedeliver()); - assertNotNull("The response SHOULD NOT BE null", response); + assertNotNull(response, "The response SHOULD NOT BE null"); // If we recover then purge the message should go away channel.queuePurge(binding.q); response = channel.basicGet(binding.q, true); - assertNull("The response SHOULD BE null", response); + assertNull(response, "The response SHOULD BE null"); deleteExchangeAndQueue(binding); } diff --git a/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycleBase.java b/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycleBase.java index 51c0e93585..c3b7995c27 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycleBase.java +++ b/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycleBase.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,9 +16,9 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.concurrent.TimeoutException; @@ -120,13 +120,13 @@ protected void restart() throws IOException, TimeoutException { protected void sendRoutable(Binding binding) throws IOException { channel.basicPublish(binding.x, binding.k, null, payload); GetResponse response = channel.basicGet(binding.q, true); - assertNotNull("The response should not be null", response); + assertNotNull(response, "The response should not be null"); } protected void sendUnroutable(Binding binding) throws IOException { channel.basicPublish(binding.x, binding.k, null, payload); GetResponse response = channel.basicGet(binding.q, true); - assertNull("The response SHOULD BE null", response); + assertNull(response, "The response SHOULD BE null"); } protected Binding setupExchangeAndRouteMessage(boolean durable) throws IOException { diff --git a/src/test/java/com/rabbitmq/client/test/functional/CcRoutes.java b/src/test/java/com/rabbitmq/client/test/functional/CcRoutes.java index ebb54164a3..b65d2ad740 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/CcRoutes.java +++ b/src/test/java/com/rabbitmq/client/test/functional/CcRoutes.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,11 +15,11 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.*; @@ -27,12 +27,14 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.AMQP.BasicProperties; import com.rabbitmq.client.GetResponse; import com.rabbitmq.client.test.BrokerTestCase; +import org.junit.jupiter.api.TestInfo; public class CcRoutes extends BrokerTestCase { @@ -44,8 +46,9 @@ public class CcRoutes extends BrokerTestCase { private List ccList; private List bccList; - @Override public void setUp() throws IOException, TimeoutException { - super.setUp(); + @BeforeEach + @Override public void setUp(TestInfo info) throws IOException, TimeoutException { + super.setUp(info); propsBuilder = new BasicProperties.Builder(); headers = new HashMap<>(); ccList = new ArrayList<>(); diff --git a/src/test/java/com/rabbitmq/client/test/functional/ClusteredTestBase.java b/src/test/java/com/rabbitmq/client/test/functional/ClusteredTestBase.java index 06f53f715a..2580ed0daf 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ClusteredTestBase.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ClusteredTestBase.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Confirm.java b/src/test/java/com/rabbitmq/client/test/functional/Confirm.java index 0c427bd261..0dbf5950c8 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Confirm.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Confirm.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,8 +16,10 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.*; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; @@ -35,6 +37,7 @@ import java.util.SortedSet; import java.util.TreeSet; import java.util.concurrent.TimeoutException; +import org.junit.jupiter.api.TestInfo; public class Confirm extends BrokerTestCase { @@ -42,9 +45,10 @@ public class Confirm extends BrokerTestCase private static final String TTL_ARG = "x-message-ttl"; + @BeforeEach @Override - public void setUp() throws IOException, TimeoutException { - super.setUp(); + public void setUp(TestInfo info) throws IOException, TimeoutException { + super.setUp(info); channel.confirmSelect(); channel.queueDeclare("confirm-test", true, true, false, null); channel.queueDeclare("confirm-durable-nonexclusive", true, false, diff --git a/src/test/java/com/rabbitmq/client/test/functional/ConnectionOpen.java b/src/test/java/com/rabbitmq/client/test/functional/ConnectionOpen.java index 22fe19e326..646f9e054d 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ConnectionOpen.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ConnectionOpen.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,9 +16,9 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.DataInputStream; import java.io.IOException; @@ -26,7 +26,7 @@ import java.util.concurrent.TimeoutException; import com.rabbitmq.client.test.TestUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.ConnectionFactory; @@ -49,13 +49,12 @@ public class ConnectionOpen { while (!command.handleFrame(fh.readFrame())) { } Method m = command.getMethod(); - assertTrue("First command must be Connection.start", - m instanceof AMQP.Connection.Start); + assertTrue(m instanceof AMQP.Connection.Start, "First command must be Connection.start"); AMQP.Connection.Start start = (AMQP.Connection.Start) m; - assertTrue("Version in Connection.start is <= what we sent", - start.getVersionMajor() < AMQP.PROTOCOL.MAJOR || + assertTrue(start.getVersionMajor() < AMQP.PROTOCOL.MAJOR || (start.getVersionMajor() == AMQP.PROTOCOL.MAJOR && - start.getVersionMinor() <= AMQP.PROTOCOL.MINOR)); + start.getVersionMinor() <= AMQP.PROTOCOL.MINOR), + "Version in Connection.start is <= what we sent"); } @Test public void crazyProtocolHeader() throws IOException { diff --git a/src/test/java/com/rabbitmq/client/test/functional/ConnectionRecovery.java b/src/test/java/com/rabbitmq/client/test/functional/ConnectionRecovery.java index f74ca5e3ae..0f9ff4a055 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ConnectionRecovery.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ConnectionRecovery.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -23,7 +23,7 @@ import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; import com.rabbitmq.tools.Host; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; diff --git a/src/test/java/com/rabbitmq/client/test/functional/ConsumerCancelNotification.java b/src/test/java/com/rabbitmq/client/test/functional/ConsumerCancelNotification.java index 1c68176d76..7d8631a100 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ConsumerCancelNotification.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ConsumerCancelNotification.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -20,7 +20,7 @@ import com.rabbitmq.client.DefaultConsumer; import com.rabbitmq.client.ShutdownSignalException; import com.rabbitmq.client.test.BrokerTestCase; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.concurrent.ArrayBlockingQueue; @@ -28,8 +28,8 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; public class ConsumerCancelNotification extends BrokerTestCase { diff --git a/src/test/java/com/rabbitmq/client/test/functional/ConsumerCount.java b/src/test/java/com/rabbitmq/client/test/functional/ConsumerCount.java index b0ba1c3206..eca4b57c48 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ConsumerCount.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ConsumerCount.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,11 +15,11 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.DefaultConsumer; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/functional/ConsumerPriorities.java b/src/test/java/com/rabbitmq/client/test/functional/ConsumerPriorities.java index 10bde1f0f1..db0ebc1212 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ConsumerPriorities.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ConsumerPriorities.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,10 +16,10 @@ package com.rabbitmq.client.test.functional; import com.rabbitmq.client.test.BrokerTestCase; -import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.Arrays; @@ -75,15 +75,15 @@ private void assertFailValidation(Map args) throws IOException { assertContents(highConsumer, COUNT, "high"); channel.basicCancel(high); assertTrue( - "High priority consumer should have been cancelled", - highConsumer.cancelLatch.await(CANCEL_OK_TIMEOUT_MS, TimeUnit.MILLISECONDS) + highConsumer.cancelLatch.await(CANCEL_OK_TIMEOUT_MS, TimeUnit.MILLISECONDS), + "High priority consumer should have been cancelled" ); publish(queue, COUNT, "med"); assertContents(medConsumer, COUNT, "med"); channel.basicCancel(med); assertTrue( - "Medium priority consumer should have been cancelled", - medConsumer.cancelLatch.await(CANCEL_OK_TIMEOUT_MS, TimeUnit.MILLISECONDS) + medConsumer.cancelLatch.await(CANCEL_OK_TIMEOUT_MS, TimeUnit.MILLISECONDS), + "Medium priority consumer should have been cancelled" ); publish(queue, COUNT, "low"); assertContents(lowConsumer, COUNT, "low"); diff --git a/src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java b/src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java index b88794cc06..5ac9e20895 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java +++ b/src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java @@ -20,7 +20,7 @@ import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; import java.util.concurrent.atomic.AtomicReference; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.*; @@ -29,7 +29,7 @@ import static com.rabbitmq.client.test.TestUtils.safeDelete; import static com.rabbitmq.client.test.TestUtils.waitAtMost; import static java.time.Duration.ofSeconds; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class DeadLetterExchange extends BrokerTestCase { @@ -424,8 +424,7 @@ public void handleDelivery(String consumerTag, Envelope envelope, return responseRefeference.get() != null; }); GetResponse getResponse = responseRefeference.get(); - assertNotNull("Message not dead-lettered", - getResponse); + assertNotNull(getResponse, "Message not dead-lettered"); assertEquals("test message", new String(getResponse.getBody())); BasicProperties props = getResponse.getProps(); Map headers = props.getHeaders(); @@ -459,7 +458,7 @@ public void handleDelivery(String consumerTag, Envelope envelope, return responseRefeference.get() != null; }); getResponse = responseRefeference.get(); - assertNotNull("Message not dead-lettered", getResponse); + assertNotNull(getResponse, "Message not dead-lettered"); assertEquals("test message", new String(getResponse.getBody())); headers = getResponse.getProps().getHeaders(); assertNotNull(headers); @@ -488,7 +487,7 @@ public void handleDelivery(String consumerTag, Envelope envelope, }); getResponse = responseRefeference.get(); - assertNotNull("Message not dead-lettered", getResponse); + assertNotNull(getResponse, "Message not dead-lettered"); assertEquals("test message", new String(getResponse.getBody())); headers = getResponse.getProps().getHeaders(); assertNotNull(headers); @@ -587,14 +586,14 @@ private void checkPromptArrival(AccumulatingMessageConsumer c, long epsilon = TTL / 5; for (int i = 0; i < count; i++) { byte[] body = c.nextDelivery(TTL + TTL + latency + epsilon); - assertNotNull("message #" + i + " did not expire", body); + assertNotNull(body, "message #" + i + " did not expire"); long now = System.currentTimeMillis(); long publishTime = Long.valueOf(new String(body)); long targetTime = publishTime + TTL + latency; - assertTrue("expiry outside bounds (+/- " + epsilon + "): " + - (now - targetTime), - (now >= targetTime - epsilon) && - (now <= targetTime + epsilon)); + assertTrue((now >= targetTime - epsilon) && + (now <= targetTime + epsilon), + "expiry outside bounds (+/- " + epsilon + "): " + + (now - targetTime)); } } @@ -666,13 +665,12 @@ private static void consumeN(Channel channel, String queue, int n, WithResponse for(int x = 0; x < n; x++) { GetResponse getResponse = channel.basicGet(queue, true); - assertNotNull("Messages not dead-lettered (" + (n-x) + " left)", - getResponse); + assertNotNull(getResponse, "Messages not dead-lettered (" + (n-x) + " left)"); assertEquals("test message", new String(getResponse.getBody())); withResponse.process(getResponse); } GetResponse getResponse = channel.basicGet(queue, true); - assertNull("expected empty queue", getResponse); + assertNull(getResponse, "expected empty queue"); } @SuppressWarnings("unchecked") diff --git a/src/test/java/com/rabbitmq/client/test/functional/DefaultExchange.java b/src/test/java/com/rabbitmq/client/test/functional/DefaultExchange.java index 7d0e9f7899..72c2793f9b 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/DefaultExchange.java +++ b/src/test/java/com/rabbitmq/client/test/functional/DefaultExchange.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,11 +15,11 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/functional/DirectReplyTo.java b/src/test/java/com/rabbitmq/client/test/functional/DirectReplyTo.java index 2cef783ba1..84911f447c 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/DirectReplyTo.java +++ b/src/test/java/com/rabbitmq/client/test/functional/DirectReplyTo.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,11 +15,11 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotSame; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.concurrent.BlockingQueue; @@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit; import com.rabbitmq.client.*; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.test.BrokerTestCase; @@ -92,7 +92,7 @@ private void declare(Connection connection, String q, boolean expectedExists) th } } - @Test public void consumeSuccess() throws IOException, InterruptedException { + @Test public void consumeSuccess() throws IOException { DefaultConsumer c = new DefaultConsumer(channel); String ctag = channel.basicConsume(QUEUE, true, c); channel.basicCancel(ctag); diff --git a/src/test/java/com/rabbitmq/client/test/functional/DoubleDeletion.java b/src/test/java/com/rabbitmq/client/test/functional/DoubleDeletion.java index 14f6dee293..c28bab794c 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/DoubleDeletion.java +++ b/src/test/java/com/rabbitmq/client/test/functional/DoubleDeletion.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -18,7 +18,7 @@ import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/functional/DurableOnTransient.java b/src/test/java/com/rabbitmq/client/test/functional/DurableOnTransient.java index cfc00d7b0a..3732ff55ac 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/DurableOnTransient.java +++ b/src/test/java/com/rabbitmq/client/test/functional/DurableOnTransient.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,11 +16,11 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.GetResponse; import com.rabbitmq.client.MessageProperties; diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExceptionHandling.java b/src/test/java/com/rabbitmq/client/test/functional/ExceptionHandling.java index 611a8eea82..700a6dda52 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExceptionHandling.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExceptionHandling.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,8 +15,8 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.concurrent.CountDownLatch; @@ -24,7 +24,7 @@ import java.util.concurrent.TimeoutException; import com.rabbitmq.client.test.TestUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExceptionMessages.java b/src/test/java/com/rabbitmq/client/test/functional/ExceptionMessages.java index 68f4da2204..672db4dfa8 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExceptionMessages.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExceptionMessages.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,13 +15,13 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AlreadyClosedException; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeclare.java b/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeclare.java index 7c1e6f2e76..b6976ee873 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeclare.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeclare.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,7 +16,7 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; import java.util.HashMap; @@ -24,7 +24,7 @@ import java.util.concurrent.TimeoutException; import com.rabbitmq.client.test.TestUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.BuiltinExchangeType; import com.rabbitmq.client.Channel; @@ -101,7 +101,7 @@ public void releaseResources() throws IOException { } private void doTestExchangeDeclaredWithEnumerationEquivalent(Channel channel) throws IOException, InterruptedException { - assertEquals("There are 4 standard exchange types", 4, BuiltinExchangeType.values().length); + assertEquals(4, BuiltinExchangeType.values().length, "There are 4 standard exchange types"); for (BuiltinExchangeType exchangeType : BuiltinExchangeType.values()) { channel.exchangeDeclare(NAME, exchangeType); verifyEquivalent(NAME, exchangeType.getType(), false, false, null); diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeleteIfUnused.java b/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeleteIfUnused.java index bbaf6b323c..299d95567f 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeleteIfUnused.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeleteIfUnused.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,12 +16,12 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.concurrent.TimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeletePredeclared.java b/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeletePredeclared.java index 28d4d667f6..4229c888ed 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeletePredeclared.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeletePredeclared.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExchangeEquivalenceBase.java b/src/test/java/com/rabbitmq/client/test/functional/ExchangeEquivalenceBase.java index 830a2b89e5..cfeed037d4 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExchangeEquivalenceBase.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExchangeEquivalenceBase.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,7 +15,7 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.Map; diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindings.java b/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindings.java index cc50182001..3416b334d6 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindings.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindings.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,12 +16,12 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.QueueingConsumer; import com.rabbitmq.client.QueueingConsumer.Delivery; diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindingsAutoDelete.java b/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindingsAutoDelete.java index ff8cb0a846..a6f01e20c4 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindingsAutoDelete.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindingsAutoDelete.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,11 +16,11 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/functional/FrameMax.java b/src/test/java/com/rabbitmq/client/test/functional/FrameMax.java index bfe1bcd826..bafceed32d 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/FrameMax.java +++ b/src/test/java/com/rabbitmq/client/test/functional/FrameMax.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,9 +16,9 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; @@ -32,7 +32,7 @@ import com.rabbitmq.client.impl.AMQBasicProperties; import com.rabbitmq.client.test.TestUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Address; diff --git a/src/test/java/com/rabbitmq/client/test/functional/FunctionalTests.java b/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java similarity index 84% rename from src/test/java/com/rabbitmq/client/test/functional/FunctionalTests.java rename to src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java index 892f4977ba..bbf06691e1 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/FunctionalTests.java +++ b/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,14 +17,12 @@ package com.rabbitmq.client.test.functional; import com.rabbitmq.client.impl.WorkPoolTests; -import com.rabbitmq.client.test.AbstractRMQTestSuite; import com.rabbitmq.client.test.Bug20004Test; -import com.rabbitmq.client.test.RequiredPropertiesSuite; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; -@RunWith(RequiredPropertiesSuite.class) -@Suite.SuiteClasses({ +@Suite +@SelectClasses({ ConnectionOpen.class, Heartbeat.class, Tables.class, @@ -81,11 +79,6 @@ TopologyRecoveryFiltering.class, TopologyRecoveryRetry.class }) -public class FunctionalTests { - - // initialize system properties - static{ - new AbstractRMQTestSuite(){}; - } +public class FunctionalTestSuite { } diff --git a/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java b/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java index c82ed749b6..49b0779c8c 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java +++ b/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,13 +15,13 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import com.rabbitmq.client.test.TestUtils; import java.io.IOException; import java.util.HashMap; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; diff --git a/src/test/java/com/rabbitmq/client/test/functional/Heartbeat.java b/src/test/java/com/rabbitmq/client/test/functional/Heartbeat.java index 62611f2a35..002c60b487 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Heartbeat.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Heartbeat.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -19,11 +19,11 @@ import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.impl.recovery.AutorecoveringConnection; import com.rabbitmq.client.test.BrokerTestCase; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class Heartbeat extends BrokerTestCase { diff --git a/src/test/java/com/rabbitmq/client/test/functional/InternalExchange.java b/src/test/java/com/rabbitmq/client/test/functional/InternalExchange.java index 43a571afc8..12bfc7c76d 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/InternalExchange.java +++ b/src/test/java/com/rabbitmq/client/test/functional/InternalExchange.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,12 +16,12 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.Arrays; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.GetResponse; diff --git a/src/test/java/com/rabbitmq/client/test/functional/InvalidAcks.java b/src/test/java/com/rabbitmq/client/test/functional/InvalidAcks.java index 217c55e1c9..08dc083f6f 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/InvalidAcks.java +++ b/src/test/java/com/rabbitmq/client/test/functional/InvalidAcks.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksBase.java b/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksBase.java index 1c249007bd..f24e848c63 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksBase.java +++ b/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksBase.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -20,7 +20,7 @@ import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; /** * See bug 21846: diff --git a/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksTx.java b/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksTx.java index 81fc7e61f7..2df62e23ed 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksTx.java +++ b/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksTx.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/MessageCount.java b/src/test/java/com/rabbitmq/client/test/functional/MessageCount.java index 3cb81344af..8ccef02846 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MessageCount.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MessageCount.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,11 +15,11 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/functional/Metrics.java b/src/test/java/com/rabbitmq/client/test/functional/Metrics.java index fdd8d64c00..0c745ebdff 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Metrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Metrics.java @@ -31,9 +31,7 @@ import com.rabbitmq.client.test.TestUtils; import com.rabbitmq.tools.Host; import java.util.UUID; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.lang.reflect.Field; @@ -49,6 +47,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import static com.rabbitmq.client.test.TestUtils.waitAtMost; import static org.assertj.core.api.Assertions.assertThat; @@ -56,17 +56,12 @@ /** * */ -@RunWith(Parameterized.class) public class Metrics extends BrokerTestCase { - @Parameterized.Parameters public static Object[] data() { return new Object[] { createConnectionFactory(), createAutoRecoveryConnectionFactory() }; } - @Parameterized.Parameter - public ConnectionFactory connectionFactory; - static final String QUEUE = "metrics.queue"; @Override @@ -79,7 +74,9 @@ protected void releaseResources() throws IOException { channel.queueDelete(QUEUE); } - @Test public void metrics() throws IOException, TimeoutException { + @ParameterizedTest + @MethodSource("data") + public void metrics(ConnectionFactory connectionFactory) throws IOException, TimeoutException { StandardMetricsCollector metrics = new StandardMetricsCollector(); connectionFactory.setMetricsCollector(metrics); Connection connection1 = null; @@ -138,7 +135,9 @@ protected void releaseResources() throws IOException { } } - @Test public void metricsPublisherUnrouted() throws IOException, TimeoutException { + @ParameterizedTest + @MethodSource("data") + public void metricsPublisherUnrouted(ConnectionFactory connectionFactory) throws IOException, TimeoutException { StandardMetricsCollector metrics = new StandardMetricsCollector(); connectionFactory.setMetricsCollector(metrics); Connection connection = null; @@ -162,7 +161,9 @@ protected void releaseResources() throws IOException { } } - @Test public void metricsPublisherAck() throws IOException, TimeoutException, InterruptedException { + @ParameterizedTest + @MethodSource("data") + public void metricsPublisherAck(ConnectionFactory connectionFactory) throws IOException, TimeoutException, InterruptedException { StandardMetricsCollector metrics = new StandardMetricsCollector(); connectionFactory.setMetricsCollector(metrics); Connection connection = null; @@ -182,7 +183,9 @@ protected void releaseResources() throws IOException { } } - @Test public void metricsAck() throws IOException, TimeoutException { + @ParameterizedTest + @MethodSource("data") + public void metricsAck(ConnectionFactory connectionFactory) throws IOException, TimeoutException { StandardMetricsCollector metrics = new StandardMetricsCollector(); connectionFactory.setMetricsCollector(metrics); @@ -248,7 +251,9 @@ protected void releaseResources() throws IOException { } } - @Test public void metricsReject() throws IOException, TimeoutException { + @ParameterizedTest + @MethodSource("data") + public void metricsReject(ConnectionFactory connectionFactory) throws IOException, TimeoutException { StandardMetricsCollector metrics = new StandardMetricsCollector(); connectionFactory.setMetricsCollector(metrics); @@ -275,7 +280,9 @@ protected void releaseResources() throws IOException { } } - @Test public void multiThreadedMetricsStandardConnection() throws InterruptedException, TimeoutException, IOException { + @ParameterizedTest + @MethodSource("data") + public void multiThreadedMetricsStandardConnection(ConnectionFactory connectionFactory) throws InterruptedException, TimeoutException, IOException { StandardMetricsCollector metrics = new StandardMetricsCollector(); connectionFactory.setMetricsCollector(metrics); int nbConnections = 3; @@ -385,7 +392,9 @@ protected void releaseResources() throws IOException { } } - @Test public void errorInChannel() throws IOException, TimeoutException { + @ParameterizedTest + @MethodSource("data") + public void errorInChannel(ConnectionFactory connectionFactory) throws IOException, TimeoutException { StandardMetricsCollector metrics = new StandardMetricsCollector(); connectionFactory.setMetricsCollector(metrics); diff --git a/src/test/java/com/rabbitmq/client/test/functional/Nack.java b/src/test/java/com/rabbitmq/client/test/functional/Nack.java index ce9b70ddd0..6bd47e6067 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Nack.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Nack.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,8 +16,8 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import com.rabbitmq.client.Channel; import com.rabbitmq.client.test.TestUtils; @@ -27,17 +27,14 @@ import java.util.Set; import java.util.UUID; -import org.junit.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.QueueingConsumer; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) public class Nack extends AbstractRejectTest { - @Parameterized.Parameters public static Object[] queueCreators() { return new Object[] { (CallableFunction) channel -> { @@ -52,9 +49,9 @@ public static Object[] queueCreators() { }}; } - @Parameterized.Parameter public TestUtils.CallableFunction queueCreator; - - @Test public void singleNack() throws Exception { + @ParameterizedTest + @MethodSource("queueCreators") + public void singleNack(TestUtils.CallableFunction queueCreator) throws Exception { String q = queueCreator.apply(channel); byte[] m1 = "1".getBytes(); @@ -89,7 +86,9 @@ public static Object[] queueCreators() { expectError(AMQP.PRECONDITION_FAILED); } - @Test public void multiNack() throws Exception { + @ParameterizedTest + @MethodSource("queueCreators") + public void multiNack(TestUtils.CallableFunction queueCreator) throws Exception { String q = queueCreator.apply(channel); byte[] m1 = "1".getBytes(); @@ -134,7 +133,9 @@ public static Object[] queueCreators() { expectError(AMQP.PRECONDITION_FAILED); } - @Test public void nackAll() throws Exception { + @ParameterizedTest + @MethodSource("queueCreators") + public void nackAll(TestUtils.CallableFunction queueCreator) throws Exception { String q = queueCreator.apply(channel); byte[] m1 = "1".getBytes(); @@ -173,7 +174,7 @@ private long checkDeliveries(QueueingConsumer c, byte[]... messages) for(int x = 0; x < messages.length; x++) { QueueingConsumer.Delivery delivery = c.nextDelivery(); String m = new String(delivery.getBody()); - assertTrue("Unexpected message", msgSet.remove(m)); + assertTrue(msgSet.remove(m), "Unexpected message"); checkDelivery(delivery, m.getBytes(), true); lastTag = delivery.getEnvelope().getDeliveryTag(); } diff --git a/src/test/java/com/rabbitmq/client/test/functional/NoRequeueOnCancel.java b/src/test/java/com/rabbitmq/client/test/functional/NoRequeueOnCancel.java index 41d68d94d5..f93f8f591b 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/NoRequeueOnCancel.java +++ b/src/test/java/com/rabbitmq/client/test/functional/NoRequeueOnCancel.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,16 +16,16 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import com.rabbitmq.client.*; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/functional/Nowait.java b/src/test/java/com/rabbitmq/client/test/functional/Nowait.java index 5f713fff61..b795f02482 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Nowait.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Nowait.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/PerConsumerPrefetch.java b/src/test/java/com/rabbitmq/client/test/functional/PerConsumerPrefetch.java index 4a36a22052..51149c613f 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/PerConsumerPrefetch.java +++ b/src/test/java/com/rabbitmq/client/test/functional/PerConsumerPrefetch.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -21,7 +21,7 @@ import java.util.Arrays; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.GetResponse; import com.rabbitmq.client.QueueingConsumer; diff --git a/src/test/java/com/rabbitmq/client/test/functional/PerMessageTTL.java b/src/test/java/com/rabbitmq/client/test/functional/PerMessageTTL.java index 1a93e6abe4..2b6bb3ed99 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/PerMessageTTL.java +++ b/src/test/java/com/rabbitmq/client/test/functional/PerMessageTTL.java @@ -16,12 +16,12 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.MessageProperties; @@ -58,8 +58,8 @@ protected AMQP.Queue.DeclareOk declareQueue(String name, Object ttlValue) throws QueueingConsumer c = new QueueingConsumer(channel); channel.basicConsume(TTL_QUEUE_NAME, c); - assertNotNull("Message unexpectedly expired", c.nextDelivery(100)); - assertNull("Message should have been expired!!", c.nextDelivery(100)); + assertNotNull(c.nextDelivery(100), "Message unexpectedly expired"); + assertNull(c.nextDelivery(100), "Message should have been expired!!"); } @Test public void restartingExpiry() throws Exception { @@ -74,7 +74,7 @@ protected AMQP.Queue.DeclareOk declareQueue(String name, Object ttlValue) throws restart(); Thread.sleep(Integer.parseInt(expiryDelay)); try { - assertNull("Message should have expired after broker restart", get()); + assertNull(get(), "Message should have expired after broker restart"); } finally { deleteQueue(TTL_QUEUE_NAME); } diff --git a/src/test/java/com/rabbitmq/client/test/functional/PerQueueTTL.java b/src/test/java/com/rabbitmq/client/test/functional/PerQueueTTL.java index 506ea50c8f..177a67cd58 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/PerQueueTTL.java +++ b/src/test/java/com/rabbitmq/client/test/functional/PerQueueTTL.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,13 +16,13 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.Collections; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.MessageProperties; diff --git a/src/test/java/com/rabbitmq/client/test/functional/PerQueueVsPerMessageTTL.java b/src/test/java/com/rabbitmq/client/test/functional/PerQueueVsPerMessageTTL.java index 58475877be..e835b42c0f 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/PerQueueVsPerMessageTTL.java +++ b/src/test/java/com/rabbitmq/client/test/functional/PerQueueVsPerMessageTTL.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,13 +15,13 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import java.io.IOException; import java.util.Collections; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; @@ -35,7 +35,7 @@ public class PerQueueVsPerMessageTTL extends PerMessageTTL { Thread.sleep(100); - assertNull("per-queue ttl should have removed message after 10ms!", get()); + assertNull(get(), "per-queue ttl should have removed message after 10ms"); } @Override diff --git a/src/test/java/com/rabbitmq/client/test/functional/Policies.java b/src/test/java/com/rabbitmq/client/test/functional/Policies.java index f4d1dd4988..602e2b57c4 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Policies.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Policies.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,9 +15,9 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.HashMap; @@ -25,12 +25,11 @@ import java.util.Map; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.Channel; import com.rabbitmq.client.GetResponse; import com.rabbitmq.client.test.BrokerTestCase; -import com.rabbitmq.client.test.server.HATests; import com.rabbitmq.tools.Host; public class Policies extends BrokerTestCase { @@ -184,7 +183,7 @@ private void setPolicy(String name, String pattern, String definition) throws IO // We need to override the HA policy that we use in HATests, so // priority 1. But we still want a valid test of HA, so add the // ha-mode definition. - if (HATests.HA_TESTS_RUNNING) { + if (ha()) { definition += ",\"ha-mode\":\"all\""; } Host.rabbitmqctl("set_policy --priority 1 " + name + " " + pattern + diff --git a/src/test/java/com/rabbitmq/client/test/functional/QosTests.java b/src/test/java/com/rabbitmq/client/test/functional/QosTests.java index 276a363f4e..b14d5526c3 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/QosTests.java +++ b/src/test/java/com/rabbitmq/client/test/functional/QosTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,10 +16,10 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.ArrayList; @@ -31,7 +31,7 @@ import java.util.Map; import java.util.concurrent.TimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; diff --git a/src/test/java/com/rabbitmq/client/test/functional/QueueExclusivity.java b/src/test/java/com/rabbitmq/client/test/functional/QueueExclusivity.java index 6148ebab27..83df293a10 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/QueueExclusivity.java +++ b/src/test/java/com/rabbitmq/client/test/functional/QueueExclusivity.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,13 +16,13 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.HashMap; import java.util.concurrent.TimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; diff --git a/src/test/java/com/rabbitmq/client/test/functional/QueueLease.java b/src/test/java/com/rabbitmq/client/test/functional/QueueLease.java index 284f6bd67d..46a31f8b3e 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/QueueLease.java +++ b/src/test/java/com/rabbitmq/client/test/functional/QueueLease.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,13 +16,13 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Consumer; diff --git a/src/test/java/com/rabbitmq/client/test/functional/QueueLifecycle.java b/src/test/java/com/rabbitmq/client/test/functional/QueueLifecycle.java index 8ee54671dc..ceedb520ad 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/QueueLifecycle.java +++ b/src/test/java/com/rabbitmq/client/test/functional/QueueLifecycle.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -20,14 +20,14 @@ import com.rabbitmq.client.Consumer; import com.rabbitmq.client.DefaultConsumer; import com.rabbitmq.client.test.BrokerTestCase; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeoutException; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; /** * Test queue auto-delete and exclusive semantics. diff --git a/src/test/java/com/rabbitmq/client/test/functional/QueueSizeLimit.java b/src/test/java/com/rabbitmq/client/test/functional/QueueSizeLimit.java index 8d34862543..c0c9350173 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/QueueSizeLimit.java +++ b/src/test/java/com/rabbitmq/client/test/functional/QueueSizeLimit.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,9 +16,9 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import java.io.IOException; import java.util.ArrayList; @@ -26,7 +26,7 @@ import java.util.List; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.GetResponse; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/functional/Recover.java b/src/test/java/com/rabbitmq/client/test/functional/Recover.java index 61d48973ce..a83c75c9ca 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Recover.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Recover.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,10 +16,10 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.Arrays; @@ -28,7 +28,7 @@ import java.util.concurrent.atomic.AtomicReference; import com.rabbitmq.client.*; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.test.BrokerTestCase; @@ -56,14 +56,12 @@ void verifyRedeliverOnRecover(RecoverCallback call) channel.basicConsume(queue, false, consumer); // require acks. channel.basicPublish("", queue, new AMQP.BasicProperties.Builder().build(), body); QueueingConsumer.Delivery delivery = consumer.nextDelivery(); - assertTrue("consumed message body not as sent", - Arrays.equals(body, delivery.getBody())); + assertTrue(Arrays.equals(body, delivery.getBody()), "consumed message body not as sent"); // Don't ack it, and get it redelivered to the same consumer call.recover(channel); QueueingConsumer.Delivery secondDelivery = consumer.nextDelivery(5000); - assertNotNull("timed out waiting for redelivered message", secondDelivery); - assertTrue("consumed (redelivered) message body not as sent", - Arrays.equals(body, delivery.getBody())); + assertNotNull(secondDelivery, "timed out waiting for redelivered message"); + assertTrue(Arrays.equals(body, delivery.getBody()), "consumed (redelivered) message body not as sent"); } void verifyNoRedeliveryWithAutoAck(RecoverCallback call) @@ -80,10 +78,9 @@ public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProp channel.basicConsume(queue, true, consumer); // auto ack. channel.basicPublish("", queue, new AMQP.BasicProperties.Builder().build(), body); assertTrue(latch.await(5, TimeUnit.SECONDS)); - assertTrue("consumed message body not as sent", - Arrays.equals(body, bodyReference.get())); + assertTrue(Arrays.equals(body, bodyReference.get()), "consumed message body not as sent"); call.recover(channel); - assertNull("should be no message available", channel.basicGet(queue, true)); + assertNull(channel.basicGet(queue, true), "should be no message available"); } final RecoverCallback recoverSync = new RecoverCallback() { diff --git a/src/test/java/com/rabbitmq/client/test/functional/Reject.java b/src/test/java/com/rabbitmq/client/test/functional/Reject.java index c2c5dd76bd..b8abaf0779 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Reject.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Reject.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,7 +16,7 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import com.rabbitmq.client.Channel; import com.rabbitmq.client.test.TestUtils; @@ -24,19 +24,16 @@ import java.util.Collections; import java.util.UUID; -import org.junit.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.QueueingConsumer; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; -@RunWith(Parameterized.class) public class Reject extends AbstractRejectTest { - @Parameterized.Parameters - public static Object[] queueCreators() { + public static Object[] reject() { return new Object[] { (CallableFunction) channel -> { String q = UUID.randomUUID().toString(); @@ -50,9 +47,9 @@ public static Object[] queueCreators() { }}; } - @Parameterized.Parameter public TestUtils.CallableFunction queueCreator; - - @Test public void reject() + @ParameterizedTest + @MethodSource + public void reject(TestUtils.CallableFunction queueCreator) throws Exception { String q = queueCreator.apply(channel); diff --git a/src/test/java/com/rabbitmq/client/test/functional/RequeueOnChannelClose.java b/src/test/java/com/rabbitmq/client/test/functional/RequeueOnChannelClose.java index 8e6c0c6f9e..250b74acf0 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/RequeueOnChannelClose.java +++ b/src/test/java/com/rabbitmq/client/test/functional/RequeueOnChannelClose.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/RequeueOnClose.java b/src/test/java/com/rabbitmq/client/test/functional/RequeueOnClose.java index e86ed31bdf..7fee64f715 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/RequeueOnClose.java +++ b/src/test/java/com/rabbitmq/client/test/functional/RequeueOnClose.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,8 +15,8 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.*; -import org.junit.Test; +import static org.junit.jupiter.api.Assertions.*; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.test.BrokerTestCase; @@ -84,9 +84,9 @@ private void publishAndGet(int count, boolean doAck) close(); open(); if (doAck) { - assertNull("Expected missing second basicGet (repeat="+repeat+")", getMessage()); + assertNull(getMessage(), "Expected missing second basicGet (repeat="+repeat+")"); } else { - assertNotNull("Expected present second basicGet (repeat="+repeat+")", getMessage()); + assertNotNull(getMessage(), "Expected present second basicGet (repeat="+repeat+")"); } close(); } @@ -146,10 +146,10 @@ private void publishLotsAndGet() close(); open(); for (int i = 0; i < MESSAGE_COUNT; i++) { - assertNotNull("only got " + i + " out of " + MESSAGE_COUNT + - " messages", channel.basicGet(Q, true)); + assertNotNull(channel.basicGet(Q, true), "only got " + i + " out of " + MESSAGE_COUNT + + " messages"); } - assertNull("got more messages than " + MESSAGE_COUNT + " expected", channel.basicGet(Q, true)); + assertNull(channel.basicGet(Q, true), "got more messages than " + MESSAGE_COUNT + " expected"); channel.queueDelete(Q); close(); closeConnection(); @@ -232,14 +232,13 @@ private void publishLotsAndConsumeSome(boolean ack, boolean cancelBeforeFinish) open(); int requeuedMsgCount = (ack) ? MESSAGE_COUNT - MESSAGES_TO_CONSUME : MESSAGE_COUNT; for (int i = 0; i < requeuedMsgCount; i++) { - assertNotNull("only got " + i + " out of " + requeuedMsgCount + " messages", - channel.basicGet(Q, true)); + assertNotNull(channel.basicGet(Q, true), "only got " + i + " out of " + requeuedMsgCount + " messages"); } int countMoreMsgs = 0; while (null != channel.basicGet(Q, true)) { countMoreMsgs++; } - assertTrue("got " + countMoreMsgs + " more messages than " + requeuedMsgCount + " expected", 0==countMoreMsgs); + assertTrue(0==countMoreMsgs, "got " + countMoreMsgs + " more messages than " + requeuedMsgCount + " expected"); channel.queueDelete(Q); close(); closeConnection(); diff --git a/src/test/java/com/rabbitmq/client/test/functional/RequeueOnConnectionClose.java b/src/test/java/com/rabbitmq/client/test/functional/RequeueOnConnectionClose.java index c212512a95..126c1bd71a 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/RequeueOnConnectionClose.java +++ b/src/test/java/com/rabbitmq/client/test/functional/RequeueOnConnectionClose.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Routing.java b/src/test/java/com/rabbitmq/client/test/functional/Routing.java index 30a643a918..9f681d75e6 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Routing.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Routing.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,14 +16,13 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.fail; -import com.rabbitmq.client.test.TestUtils.BrokerAtLeast310Condition; -import com.rabbitmq.client.test.TestUtils.ExecutionConditionRule; -import com.rabbitmq.client.test.TestUtils.TestExecutionCondition; +import com.rabbitmq.client.test.TestUtils.BrokerVersion; +import com.rabbitmq.client.test.TestUtils.BrokerVersionAtLeast; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; @@ -31,8 +30,7 @@ import java.util.Map; import java.util.concurrent.TimeoutException; -import org.junit.Rule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.AlreadyClosedException; @@ -40,13 +38,10 @@ import com.rabbitmq.client.ReturnListener; import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.utility.BlockingCell; -import org.junit.rules.TestRule; public class Routing extends BrokerTestCase { - @Rule public TestRule executionConditionRule = new ExecutionConditionRule(); - protected final String E = "MRDQ"; protected final String Q1 = "foo"; protected final String Q2 = "bar"; @@ -253,7 +248,7 @@ private void checkGet(String queue, boolean messageExpected) } @Test - @TestExecutionCondition(BrokerAtLeast310Condition.class) + @BrokerVersionAtLeast(BrokerVersion.RABBITMQ_3_10) public void headersWithXRouting() throws Exception { Map spec = new HashMap(); spec.put("x-key-1", "value-1"); diff --git a/src/test/java/com/rabbitmq/client/test/functional/SaslMechanisms.java b/src/test/java/com/rabbitmq/client/test/functional/SaslMechanisms.java index 631d21a2a5..c40718f732 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/SaslMechanisms.java +++ b/src/test/java/com/rabbitmq/client/test/functional/SaslMechanisms.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,7 +15,7 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.Arrays; @@ -23,7 +23,7 @@ import java.util.concurrent.TimeoutException; import com.rabbitmq.client.test.TestUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AuthenticationFailureException; import com.rabbitmq.client.Connection; diff --git a/src/test/java/com/rabbitmq/client/test/functional/TTLHandling.java b/src/test/java/com/rabbitmq/client/test/functional/TTLHandling.java index c07a675882..8d50b7e059 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/TTLHandling.java +++ b/src/test/java/com/rabbitmq/client/test/functional/TTLHandling.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,15 +15,15 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.fail; import com.rabbitmq.client.ShutdownSignalException; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.GetResponse; @@ -112,7 +112,7 @@ protected void releaseResources() throws IOException { Thread.sleep(1000); String what = get(); - assertNull("expected message " + what + " to have been removed", what); + assertNull(what, "expected message " + what + " to have been removed"); } @Test public void publishAndGetWithExpiry() throws Exception { @@ -183,7 +183,7 @@ protected void releaseResources() throws IOException { Thread.sleep(150); openChannel(); - assertNull("Re-queued message not expired", get()); + assertNull(get(), "Re-queued message not expired"); } @Test public void zeroTTLDelivery() throws Exception { diff --git a/src/test/java/com/rabbitmq/client/test/functional/Tables.java b/src/test/java/com/rabbitmq/client/test/functional/Tables.java index 6f8f1854a8..a1e405c7f8 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Tables.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Tables.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,8 +16,8 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.math.BigDecimal; @@ -29,7 +29,7 @@ import java.util.Map; import java.util.Set; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.AMQP.BasicProperties; @@ -87,18 +87,17 @@ private static void assertMapsEqual(Map a, Object va = a.get(k); Object vb = b.get(k); if (va instanceof byte[] && vb instanceof byte[]) { - assertTrue("unequal entry for key " + k, - Arrays.equals((byte[])va, (byte[])vb)); + assertTrue(Arrays.equals((byte[])va, (byte[])vb), "unequal entry for key " + k); } else if (va instanceof List && vb instanceof List) { Iterator vbi = ((List)vb).iterator(); for (Object vaEntry : (List)va) { Object vbEntry = vbi.next(); - assertEquals("arrays unequal at key " + k, vaEntry, vbEntry); + assertEquals(vaEntry, vbEntry, "arrays unequal at key " + k); } } else { - assertEquals("unequal entry for key " + k, va, vb); + assertEquals(va, vb, "unequal entry for key " + k); } } } diff --git a/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryFiltering.java b/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryFiltering.java index 3879359959..1af68242b4 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryFiltering.java +++ b/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryFiltering.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -30,7 +30,7 @@ import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; import java.util.UUID; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.time.Duration; @@ -40,8 +40,8 @@ import java.util.concurrent.atomic.AtomicInteger; import static com.rabbitmq.client.test.TestUtils.*; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @@ -117,12 +117,12 @@ public void topologyRecoveryFilteringBindings() throws Exception { closeAndWaitForRecovery((RecoverableConnection) c); - assertTrue("The message should have been received by now", sendAndConsumeMessage( + assertTrue(sendAndConsumeMessage( "topology.recovery.exchange", "recovered.binding", "topology.recovery.queue.1", c - )); - assertFalse("Binding shouldn't recover, no messages should have been received", sendAndConsumeMessage( + ), "The message should have been received by now"); + assertFalse(sendAndConsumeMessage( "topology.recovery.exchange", "filtered.binding", "topology.recovery.queue.2", c - )); + ), "Binding shouldn't recover, no messages should have been received"); } @Test @@ -166,8 +166,8 @@ public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProp waitAtMost(Duration.ofSeconds(5), () -> recoveredConsumerMessageCount.get() == initialCount + 1); ch.basicPublish("topology.recovery.exchange", "filtered.consumer", null, "".getBytes()); - assertFalse("Consumer shouldn't recover, no extra messages should have been received", - filteredConsumerLatch.await(5, TimeUnit.SECONDS)); + assertFalse(filteredConsumerLatch.await(5, TimeUnit.SECONDS), + "Consumer shouldn't recover, no extra messages should have been received"); } private static class SimpleTopologyRecoveryFilter implements TopologyRecoveryFilter { diff --git a/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryRetry.java b/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryRetry.java index c8d9c894a9..91a777ad1b 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryRetry.java +++ b/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryRetry.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -27,9 +27,9 @@ import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; import com.rabbitmq.tools.Host; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.HashMap; import java.util.UUID; @@ -39,7 +39,7 @@ import static com.rabbitmq.client.impl.recovery.TopologyRecoveryRetryLogic.RETRY_ON_QUEUE_NOT_FOUND_RETRY_HANDLER; import static com.rabbitmq.client.test.TestUtils.closeAllConnectionsAndWaitForRecovery; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * @@ -48,7 +48,7 @@ public class TopologyRecoveryRetry extends BrokerTestCase { private volatile Consumer backoffConsumer; - @Before + @BeforeEach public void init() { this.backoffConsumer = attempt -> { }; } diff --git a/src/test/java/com/rabbitmq/client/test/functional/Transactions.java b/src/test/java/com/rabbitmq/client/test/functional/Transactions.java index 3e3d66883b..b7890aed45 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Transactions.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Transactions.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,14 +16,14 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.concurrent.TimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.GetResponse; @@ -324,8 +324,7 @@ private long[] publishSelectAndGet(int n) basicAck(); channel.basicRecover(true); - assertNull("Acked uncommitted message redelivered", - basicGet(true)); + assertNull(basicGet(true), "Acked uncommitted message redelivered"); } @Test public void commitWithDeletedQueue() diff --git a/src/test/java/com/rabbitmq/client/test/functional/UnbindAutoDeleteExchange.java b/src/test/java/com/rabbitmq/client/test/functional/UnbindAutoDeleteExchange.java index 29c4faa2b4..08e0b8fbac 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/UnbindAutoDeleteExchange.java +++ b/src/test/java/com/rabbitmq/client/test/functional/UnbindAutoDeleteExchange.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,11 +15,11 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/functional/UnexpectedFrames.java b/src/test/java/com/rabbitmq/client/test/functional/UnexpectedFrames.java index e028c3cf47..fd36d11026 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/UnexpectedFrames.java +++ b/src/test/java/com/rabbitmq/client/test/functional/UnexpectedFrames.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -22,7 +22,7 @@ import com.rabbitmq.client.impl.recovery.AutorecoveringConnection; import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import javax.net.SocketFactory; import java.io.IOException; diff --git a/src/test/java/com/rabbitmq/client/test/functional/UserIDHeader.java b/src/test/java/com/rabbitmq/client/test/functional/UserIDHeader.java index d776029df5..1f0383fbde 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/UserIDHeader.java +++ b/src/test/java/com/rabbitmq/client/test/functional/UserIDHeader.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,14 +15,14 @@ package com.rabbitmq.client.test.functional; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.concurrent.TimeoutException; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.AlreadyClosedException; diff --git a/src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java b/src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java index a0e857d828..e304a71db6 100644 --- a/src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java +++ b/src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -19,14 +19,17 @@ import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; import com.rabbitmq.client.test.functional.ClusteredTestBase; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.concurrent.Callable; import java.util.concurrent.TimeoutException; +import org.junit.jupiter.api.TestInfo; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.fail; /** * This tests whether 'absent' queues - durable queues whose home node @@ -36,16 +39,18 @@ public class AbsentQueue extends ClusteredTestBase { private static final String Q = "absent-queue"; - @Override public void setUp() throws IOException, TimeoutException { - super.setUp(); + @BeforeEach + @Override public void setUp(TestInfo info) throws IOException, TimeoutException { + super.setUp(info); if (clusteredConnection != null) stopSecondary(); } - @Override public void tearDown() throws IOException, TimeoutException { + @AfterEach + @Override public void tearDown(TestInfo info) throws IOException, TimeoutException { if (clusteredConnection != null) startSecondary(); - super.tearDown(); + super.tearDown(info); } @Override protected void createResources() throws IOException { @@ -57,7 +62,7 @@ public class AbsentQueue extends ClusteredTestBase { } @Test public void notFound() throws Exception { - if (!HATests.HA_TESTS_RUNNING) { + if (!ha()) { // we don't care about this test in normal mode return; } @@ -73,9 +78,9 @@ protected void assertNotFound(Callable t) throws Exception { if (clusteredChannel == null) return; try { t.call(); - if (!HATests.HA_TESTS_RUNNING) fail("expected not_found"); + if (!ha()) fail("expected not_found"); } catch (IOException ioe) { - assertFalse(HATests.HA_TESTS_RUNNING); + assertFalse(ha()); checkShutdownSignal(AMQP.NOT_FOUND, ioe); channel = connection.createChannel(); } @@ -84,7 +89,7 @@ protected void assertNotFound(Callable t) throws Exception { private void waitPropagationInHa() throws IOException, InterruptedException { // can be necessary to wait a bit in HA mode - if (HATests.HA_TESTS_RUNNING) { + if (ha()) { long waited = 0; while(waited < 5000) { Channel tempChannel = connection.createChannel(); diff --git a/src/test/java/com/rabbitmq/client/test/server/AlternateExchangeEquivalence.java b/src/test/java/com/rabbitmq/client/test/server/AlternateExchangeEquivalence.java index 676dac7015..a978d06a48 100644 --- a/src/test/java/com/rabbitmq/client/test/server/AlternateExchangeEquivalence.java +++ b/src/test/java/com/rabbitmq/client/test/server/AlternateExchangeEquivalence.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -20,7 +20,7 @@ import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.test.functional.ExchangeEquivalenceBase; diff --git a/src/test/java/com/rabbitmq/client/test/server/BlockedConnection.java b/src/test/java/com/rabbitmq/client/test/server/BlockedConnection.java index 4856ea151b..a80b12387d 100644 --- a/src/test/java/com/rabbitmq/client/test/server/BlockedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/server/BlockedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,7 +16,7 @@ package com.rabbitmq.client.test.server; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.concurrent.CountDownLatch; @@ -24,7 +24,7 @@ import java.util.concurrent.TimeoutException; import com.rabbitmq.client.test.TestUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.BlockedListener; import com.rabbitmq.client.Channel; diff --git a/src/test/java/com/rabbitmq/client/test/server/Bug19219Test.java b/src/test/java/com/rabbitmq/client/test/server/Bug19219Test.java index e16d40d731..2506ef075a 100644 --- a/src/test/java/com/rabbitmq/client/test/server/Bug19219Test.java +++ b/src/test/java/com/rabbitmq/client/test/server/Bug19219Test.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,14 +15,14 @@ package com.rabbitmq.client.test.server; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.concurrent.CountDownLatch; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; diff --git a/src/test/java/com/rabbitmq/client/test/server/ChannelLimitNegotiation.java b/src/test/java/com/rabbitmq/client/test/server/ChannelLimitNegotiation.java index a890f2ca66..a008c5b44d 100644 --- a/src/test/java/com/rabbitmq/client/test/server/ChannelLimitNegotiation.java +++ b/src/test/java/com/rabbitmq/client/test/server/ChannelLimitNegotiation.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,10 +15,10 @@ package com.rabbitmq.client.test.server; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.concurrent.Executors; @@ -27,7 +27,7 @@ import com.rabbitmq.client.impl.recovery.AutorecoveringConnection; import com.rabbitmq.client.test.TestUtils; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Connection; diff --git a/src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java b/src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java index 312ce61810..f280408fa8 100644 --- a/src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java +++ b/src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,13 +15,13 @@ package com.rabbitmq.client.test.server; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import java.io.IOException; import java.util.HashMap; import java.util.Map; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.MessageProperties; import com.rabbitmq.client.test.BrokerTestCase; @@ -51,7 +51,7 @@ protected void releaseResources() throws IOException { @Test public void deadLetterQueueTTLExpiredWhileDown() throws Exception { // This test is nonsensical (and often breaks) in HA mode. - if (HATests.HA_TESTS_RUNNING) return; + if (ha()) return; for(int x = 0; x < DeadLetterExchange.MSG_COUNT; x++) { channel.basicPublish("amq.direct", "test", MessageProperties.MINIMAL_PERSISTENT_BASIC, "test message".getBytes()); diff --git a/src/test/java/com/rabbitmq/client/test/server/DurableBindingLifecycle.java b/src/test/java/com/rabbitmq/client/test/server/DurableBindingLifecycle.java index 5146cac8fb..0b5d19d529 100644 --- a/src/test/java/com/rabbitmq/client/test/server/DurableBindingLifecycle.java +++ b/src/test/java/com/rabbitmq/client/test/server/DurableBindingLifecycle.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -18,13 +18,13 @@ import static com.rabbitmq.client.test.TestUtils.waitAtMost; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNull; import java.io.IOException; import java.util.concurrent.TimeoutException; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.GetResponse; import com.rabbitmq.client.test.functional.BindingLifecycleBase; @@ -55,9 +55,9 @@ protected void restart() throws IOException, TimeoutException { } private void restartPrimary() throws IOException, TimeoutException { - tearDown(); + tearDown(this.testInfo); bareRestart(); - setUp(); + setUp(this.testInfo); } /** @@ -120,7 +120,7 @@ private void restartPrimary() throws IOException, TimeoutException { } GetResponse response = channel.basicGet(Q, true); - assertNull("The initial response SHOULD BE null", response); + assertNull(response, "The initial response SHOULD BE null"); deleteQueue(Q); deleteExchange(X); diff --git a/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java b/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java index bf3c56bf58..db5d63ef7a 100644 --- a/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java +++ b/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,12 +15,12 @@ package com.rabbitmq.client.test.server; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; import java.util.concurrent.*; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.test.functional.ClusteredTestBase; @@ -79,8 +79,7 @@ protected void releaseResources() throws IOException { Thread.sleep(10); waited += 10; } - assertEquals("Queue " + queue + " should have been purged after 10 seconds", - MESSAGES_PER_BATCH, purged); + assertEquals(MESSAGES_PER_BATCH, purged, "Queue " + queue + " should have been purged after 10 seconds"); } } return null; diff --git a/src/test/java/com/rabbitmq/client/test/server/ExclusiveQueueDurability.java b/src/test/java/com/rabbitmq/client/test/server/ExclusiveQueueDurability.java index 7bae91467b..6671be803c 100644 --- a/src/test/java/com/rabbitmq/client/test/server/ExclusiveQueueDurability.java +++ b/src/test/java/com/rabbitmq/client/test/server/ExclusiveQueueDurability.java @@ -17,12 +17,12 @@ package com.rabbitmq.client.test.server; import static com.rabbitmq.client.test.TestUtils.safeDelete; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.concurrent.TimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; @@ -69,7 +69,7 @@ private void restartPrimaryAbruptly() throws IOException, TimeoutException { connection = null; channel = null; bareRestart(); - setUp(); + setUp(this.testInfo); } /* diff --git a/src/test/java/com/rabbitmq/client/test/server/Firehose.java b/src/test/java/com/rabbitmq/client/test/server/Firehose.java index 28064a1383..63389b5384 100644 --- a/src/test/java/com/rabbitmq/client/test/server/Firehose.java +++ b/src/test/java/com/rabbitmq/client/test/server/Firehose.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,15 +15,15 @@ package com.rabbitmq.client.test.server; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.io.IOException; import java.util.List; import java.util.Map; import java.util.concurrent.TimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.GetResponse; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/server/HATests.java b/src/test/java/com/rabbitmq/client/test/server/HATests.java deleted file mode 100644 index d4078c4ac2..0000000000 --- a/src/test/java/com/rabbitmq/client/test/server/HATests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. -// -// This software, the RabbitMQ Java client library, is triple-licensed under the -// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 -// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see -// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.test.server; - -import com.rabbitmq.client.test.AbstractRMQTestSuite; -import com.rabbitmq.client.test.RequiredPropertiesSuite; -import com.rabbitmq.client.test.functional.FunctionalTests; -import com.rabbitmq.tools.Host; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; - -@RunWith(RequiredPropertiesSuite.class) -@Suite.SuiteClasses({ - HATests.SetUp.class, - FunctionalTests.class, - ServerTests.class, - HATests.TearDown.class -}) -public class HATests { - - // initialize system properties - static{ - new AbstractRMQTestSuite(){}; - } - - // this is horrific - public static boolean HA_TESTS_RUNNING = false; - - // This is of course an abuse of the TestCase concept - but I don't want to - // run this command on every test case. And there's no hook for "before / - // after this test suite". - public static class SetUp { - - @Test public void setUp() throws Exception { - Host.rabbitmqctl("set_policy HA '.*' '{\"ha-mode\":\"all\"}'"); - HA_TESTS_RUNNING = true; - } - - @Test public void testNothing() {} - } - - public static class TearDown { - - @Test public void tearDown() throws Exception { - Host.rabbitmqctl("clear_policy HA"); - HA_TESTS_RUNNING = false; - } - - @Test public void testNothing() {} - } -} diff --git a/src/test/java/com/rabbitmq/client/test/server/HaTestSuite.java b/src/test/java/com/rabbitmq/client/test/server/HaTestSuite.java new file mode 100644 index 0000000000..12f88c6612 --- /dev/null +++ b/src/test/java/com/rabbitmq/client/test/server/HaTestSuite.java @@ -0,0 +1,30 @@ +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.test.server; + +import com.rabbitmq.client.test.functional.FunctionalTestSuite; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; + +@Suite +@SelectClasses({ + FunctionalTestSuite.class, + ServerTestSuite.class, + LastHaTestSuite.class, +}) +public class HaTestSuite { + +} diff --git a/src/test/java/com/rabbitmq/client/test/server/LastHaTestSuite.java b/src/test/java/com/rabbitmq/client/test/server/LastHaTestSuite.java new file mode 100644 index 0000000000..12aa495ae0 --- /dev/null +++ b/src/test/java/com/rabbitmq/client/test/server/LastHaTestSuite.java @@ -0,0 +1,37 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.test.server; + +import com.rabbitmq.client.test.server.LastHaTestSuite.DummyTest; +import org.junit.jupiter.api.Test; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; + +/** + * Marker test suite to signal the end of the HA test suite. + */ +@Suite +@SelectClasses(DummyTest.class) +public class LastHaTestSuite { + + static class DummyTest { + @Test + void noOp() { + + } + } + +} diff --git a/src/test/java/com/rabbitmq/client/test/server/LoopbackUsers.java b/src/test/java/com/rabbitmq/client/test/server/LoopbackUsers.java index a1e26b3d1b..e758b65c9e 100644 --- a/src/test/java/com/rabbitmq/client/test/server/LoopbackUsers.java +++ b/src/test/java/com/rabbitmq/client/test/server/LoopbackUsers.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,7 +15,7 @@ package com.rabbitmq.client.test.server; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.net.Inet4Address; @@ -26,9 +26,9 @@ import java.util.concurrent.TimeoutException; import com.rabbitmq.client.test.TestUtils; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AuthenticationFailureException; import com.rabbitmq.client.ConnectionFactory; @@ -36,12 +36,12 @@ public class LoopbackUsers { - @Before public void setUp() throws IOException { + @BeforeEach public void setUp() throws IOException { Host.rabbitmqctl("add_user test test"); Host.rabbitmqctl("set_permissions test '.*' '.*' '.*'"); } - @After public void tearDown() throws IOException { + @AfterEach public void tearDown() throws IOException { Host.rabbitmqctl("delete_user test"); } diff --git a/src/test/java/com/rabbitmq/client/test/server/MemoryAlarms.java b/src/test/java/com/rabbitmq/client/test/server/MemoryAlarms.java index 690a77ddcd..d6be4534de 100644 --- a/src/test/java/com/rabbitmq/client/test/server/MemoryAlarms.java +++ b/src/test/java/com/rabbitmq/client/test/server/MemoryAlarms.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,18 +15,21 @@ package com.rabbitmq.client.test.server; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; import java.io.IOException; import java.util.concurrent.TimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; import com.rabbitmq.client.QueueingConsumer; import com.rabbitmq.client.test.BrokerTestCase; +import org.junit.jupiter.api.TestInfo; public class MemoryAlarms extends BrokerTestCase { @@ -35,18 +38,20 @@ public class MemoryAlarms extends BrokerTestCase { private Connection connection2; private Channel channel2; + @BeforeEach @Override - public void setUp() throws IOException, TimeoutException { + public void setUp(TestInfo info) throws IOException, TimeoutException { connectionFactory.setRequestedHeartbeat(1); - super.setUp(); + super.setUp(info); if (connection2 == null) { connection2 = connectionFactory.newConnection(); } channel2 = connection2.createChannel(); } + @AfterEach @Override - public void tearDown() throws IOException, TimeoutException { + public void tearDown(TestInfo info) throws IOException, TimeoutException { clearAllResourceAlarms(); if (channel2 != null) { channel2.abort(); @@ -56,7 +61,7 @@ public void tearDown() throws IOException, TimeoutException { connection2.abort(); connection2 = null; } - super.tearDown(); + super.tearDown(info); connectionFactory.setRequestedHeartbeat(0); } diff --git a/src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java b/src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java index f59e4ced96..c17ef018c9 100644 --- a/src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java +++ b/src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,12 +17,12 @@ import java.io.IOException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.MessageProperties; import com.rabbitmq.client.test.ConfirmBase; -import org.junit.Test; +import org.junit.jupiter.api.Test; public class MessageRecovery extends ConfirmBase { @@ -56,7 +56,7 @@ public class MessageRecovery extends ConfirmBase // with slave(s). // NB: this wont work when running against a single node broker // and running the test individually outside of the HA suite - boolean expectDelivered = HATests.HA_TESTS_RUNNING; + boolean expectDelivered = ha(); try { channel.queueDeclarePassive(Q2); channel.queueDelete(Q2); diff --git a/src/test/java/com/rabbitmq/client/test/server/Permissions.java b/src/test/java/com/rabbitmq/client/test/server/Permissions.java index c67d0cc0c6..2204f9c9ce 100644 --- a/src/test/java/com/rabbitmq/client/test/server/Permissions.java +++ b/src/test/java/com/rabbitmq/client/test/server/Permissions.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -22,14 +22,17 @@ import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; import com.rabbitmq.tools.Host; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeoutException; +import org.junit.jupiter.api.TestInfo; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class Permissions extends BrokerTestCase { @@ -45,16 +48,20 @@ public Permissions() connectionFactory = factory; } - public void setUp() + @BeforeEach + @Override + public void setUp(TestInfo info) throws IOException, TimeoutException { deleteRestrictedAccount(); addRestrictedAccount(); - super.setUp(); + super.setUp(info); } - public void tearDown() + @AfterEach + @Override + public void tearDown(TestInfo info) throws IOException, TimeoutException { - super.tearDown(); + super.tearDown(info); deleteRestrictedAccount(); } @@ -124,8 +131,7 @@ protected void withNames(WithName action) } catch (IOException e) { assertTrue(e instanceof AuthenticationFailureException); String msg = e.getMessage(); - assertTrue("Exception message should contain 'auth'", - msg.toLowerCase().contains("auth")); + assertTrue(msg.toLowerCase().contains("auth"), "Exception message should contain 'auth'"); } } @@ -366,13 +372,13 @@ protected void runTest(boolean exp, String name, WithName test) String msg = "'" + name + "' -> " + exp; try { test.with(name); - assertTrue(msg, exp); + assertTrue(exp, msg); } catch (IOException e) { - assertFalse(msg, exp); + assertFalse(exp, msg); checkShutdownSignal(AMQP.ACCESS_REFUSED, e); openChannel(); } catch (AlreadyClosedException e) { - assertFalse(msg, exp); + assertFalse(exp, msg); checkShutdownSignal(AMQP.ACCESS_REFUSED, e); openChannel(); } diff --git a/src/test/java/com/rabbitmq/client/test/server/PersistenceGuarantees.java b/src/test/java/com/rabbitmq/client/test/server/PersistenceGuarantees.java index 69bc8093b4..e0547ca786 100644 --- a/src/test/java/com/rabbitmq/client/test/server/PersistenceGuarantees.java +++ b/src/test/java/com/rabbitmq/client/test/server/PersistenceGuarantees.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,12 +15,12 @@ package com.rabbitmq.client.test.server; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; import java.io.IOException; import com.rabbitmq.client.impl.nio.NioParams; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.MessageProperties; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/server/PriorityQueues.java b/src/test/java/com/rabbitmq/client/test/server/PriorityQueues.java index 76c34dbbeb..1fba1684d7 100644 --- a/src/test/java/com/rabbitmq/client/test/server/PriorityQueues.java +++ b/src/test/java/com/rabbitmq/client/test/server/PriorityQueues.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,8 +15,8 @@ package com.rabbitmq.client.test.server; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; import java.io.IOException; import java.util.ArrayList; @@ -27,7 +27,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.DefaultConsumer; diff --git a/src/test/java/com/rabbitmq/client/test/server/ServerTests.java b/src/test/java/com/rabbitmq/client/test/server/ServerTestSuite.java similarity index 69% rename from src/test/java/com/rabbitmq/client/test/server/ServerTests.java rename to src/test/java/com/rabbitmq/client/test/server/ServerTestSuite.java index a532586e40..c850a31faf 100644 --- a/src/test/java/com/rabbitmq/client/test/server/ServerTests.java +++ b/src/test/java/com/rabbitmq/client/test/server/ServerTestSuite.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,14 +16,12 @@ package com.rabbitmq.client.test.server; -import com.rabbitmq.client.test.AbstractRMQTestSuite; -import com.rabbitmq.client.test.RequiredPropertiesSuite; -import org.junit.runner.RunWith; -import org.junit.runners.Suite; +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; -@RunWith(RequiredPropertiesSuite.class) -@Suite.SuiteClasses({ - Permissions.class, +@Suite +@SelectClasses({ + Permissions.class, DurableBindingLifecycle.class, DeadLetterExchangeDurable.class, EffectVisibilityCrossNodeTest.class, @@ -38,15 +36,10 @@ BlockedConnection.class, ChannelLimitNegotiation.class, LoopbackUsers.class, - XDeathHeaderGrowth.class, - PriorityQueues.class, - TopicPermissions.class + XDeathHeaderGrowth.class, + PriorityQueues.class, + TopicPermissions.class }) -public class ServerTests { - - // initialize system properties - static{ - new AbstractRMQTestSuite(){}; - } +public class ServerTestSuite { } diff --git a/src/test/java/com/rabbitmq/client/test/server/Shutdown.java b/src/test/java/com/rabbitmq/client/test/server/Shutdown.java index 8d7194bd38..9e861bdc9e 100644 --- a/src/test/java/com/rabbitmq/client/test/server/Shutdown.java +++ b/src/test/java/com/rabbitmq/client/test/server/Shutdown.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,7 +15,7 @@ package com.rabbitmq.client.test.server; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.test.BrokerTestCase; diff --git a/src/test/java/com/rabbitmq/client/test/server/TopicPermissions.java b/src/test/java/com/rabbitmq/client/test/server/TopicPermissions.java index 323b9cba65..d48f6ea952 100644 --- a/src/test/java/com/rabbitmq/client/test/server/TopicPermissions.java +++ b/src/test/java/com/rabbitmq/client/test/server/TopicPermissions.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -20,7 +20,7 @@ import com.rabbitmq.client.BuiltinExchangeType; import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.tools.Host; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.io.IOException; import java.util.concurrent.Callable; @@ -28,7 +28,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; public class TopicPermissions extends BrokerTestCase { diff --git a/src/test/java/com/rabbitmq/client/test/server/XDeathHeaderGrowth.java b/src/test/java/com/rabbitmq/client/test/server/XDeathHeaderGrowth.java index fb65d954b3..0a0537330d 100644 --- a/src/test/java/com/rabbitmq/client/test/server/XDeathHeaderGrowth.java +++ b/src/test/java/com/rabbitmq/client/test/server/XDeathHeaderGrowth.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,8 +15,8 @@ package com.rabbitmq.client.test.server; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import java.util.ArrayList; @@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; -import org.junit.Test; +import org.junit.jupiter.api.Test; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; diff --git a/src/test/java/com/rabbitmq/client/test/ssl/BadVerifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/BadVerifiedConnection.java index f5af43b4d6..748bb9f883 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/BadVerifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/BadVerifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,27 +15,24 @@ package com.rabbitmq.client.test.ssl; -import com.rabbitmq.client.test.TestUtils; -import org.junit.ClassRule; -import org.junit.Test; +import org.junit.jupiter.api.Test; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLHandshakeException; import java.io.IOException; import java.util.concurrent.TimeoutException; -import org.junit.rules.TestRule; +import org.junit.jupiter.api.condition.EnabledForJreRange; +import org.junit.jupiter.api.condition.JRE; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.fail; /** * Test for bug 19356 - SSL Support in rabbitmq * */ +@EnabledForJreRange(min = JRE.JAVA_11) public class BadVerifiedConnection extends UnverifiedConnection { - @ClassRule - public static TestRule atLeastJava11TestRule = TestUtils.atLeastJava11(); - public void openConnection() throws IOException, TimeoutException { try { diff --git a/src/test/java/com/rabbitmq/client/test/ssl/ConnectionFactoryDefaultTlsVersion.java b/src/test/java/com/rabbitmq/client/test/ssl/ConnectionFactoryDefaultTlsVersion.java index dde98277d4..1a03a02420 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/ConnectionFactoryDefaultTlsVersion.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/ConnectionFactoryDefaultTlsVersion.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,28 +16,27 @@ package com.rabbitmq.client.test.ssl; import com.rabbitmq.client.ConnectionFactory; -import junit.framework.TestCase; -import org.junit.Assert; -import org.junit.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; public class ConnectionFactoryDefaultTlsVersion { @Test public void defaultTlsVersionJdk16ShouldTakeFallback() { String [] supportedProtocols = {"SSLv2Hello", "SSLv3", "TLSv1"}; String tlsProtocol = ConnectionFactory.computeDefaultTlsProtocol(supportedProtocols); - Assert.assertEquals("TLSv1",tlsProtocol); + Assertions.assertEquals("TLSv1",tlsProtocol); } @Test public void defaultTlsVersionJdk17ShouldTakePrefered() { String [] supportedProtocols = {"SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"}; String tlsProtocol = ConnectionFactory.computeDefaultTlsProtocol(supportedProtocols); - Assert.assertEquals("TLSv1.2",tlsProtocol); + Assertions.assertEquals("TLSv1.2",tlsProtocol); } @Test public void defaultTlsVersionJdk18ShouldTakePrefered() { String [] supportedProtocols = {"SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"}; String tlsProtocol = ConnectionFactory.computeDefaultTlsProtocol(supportedProtocols); - Assert.assertEquals("TLSv1.2",tlsProtocol); + Assertions.assertEquals("TLSv1.2",tlsProtocol); } } diff --git a/src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java b/src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java index 46ad6c5a2a..f8febe4614 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -19,32 +19,25 @@ import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.test.TestUtils; -import org.junit.BeforeClass; -import org.junit.ClassRule; -import org.junit.Test; -import org.junit.rules.TestRule; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.condition.EnabledForJreRange; +import org.junit.jupiter.api.condition.JRE; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import javax.net.ssl.SSLContext; import javax.net.ssl.SSLHandshakeException; import java.util.function.Consumer; import static java.util.Collections.singletonList; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertTrue; -@RunWith(Parameterized.class) +@EnabledForJreRange(min = JRE.JAVA_11) public class HostnameVerification { - @ClassRule - public static TestRule atLeastJava11TestRule = TestUtils.atLeastJava11(); - static SSLContext sslContext; - @Parameterized.Parameter - public Consumer customizer; - @Parameterized.Parameters public static Object[] data() { return new Object[] { blockingIo(enableHostnameVerification()), @@ -70,23 +63,26 @@ private static Consumer enableHostnameVerification() { return connectionFactory -> connectionFactory.enableHostnameVerification(); } - @BeforeClass + @BeforeAll public static void initCrypto() throws Exception { sslContext = TlsTestUtils.verifiedSslContext(); } - @Test(expected = SSLHandshakeException.class) - public void hostnameVerificationFailsBecauseCertificateNotIssuedForLoopbackInterface() throws Exception { + @ParameterizedTest + @MethodSource("data") + public void hostnameVerificationFailsBecauseCertificateNotIssuedForLoopbackInterface(Consumer customizer) throws Exception { ConnectionFactory connectionFactory = TestUtils.connectionFactory(); connectionFactory.useSslProtocol(sslContext); customizer.accept(connectionFactory); - connectionFactory.newConnection( - () -> singletonList(new Address("127.0.0.1", ConnectionFactory.DEFAULT_AMQP_OVER_SSL_PORT))); - fail("The server certificate isn't issued for 127.0.0.1, the TLS handshake should have failed"); + Assertions.assertThatThrownBy(() -> connectionFactory.newConnection( + () -> singletonList(new Address("127.0.0.1", ConnectionFactory.DEFAULT_AMQP_OVER_SSL_PORT)))) + .isInstanceOf(SSLHandshakeException.class) + .as("The server certificate isn't issued for 127.0.0.1, the TLS handshake should have failed"); } - @Test - public void hostnameVerificationSucceeds() throws Exception { + @ParameterizedTest + @MethodSource("data") + public void hostnameVerificationSucceeds(Consumer customizer) throws Exception { ConnectionFactory connectionFactory = TestUtils.connectionFactory(); connectionFactory.useSslProtocol(sslContext); customizer.accept(connectionFactory); diff --git a/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java index 4010bc444e..884ca4db9a 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,8 +17,8 @@ import static com.rabbitmq.client.test.TestUtils.basicGetBasicConsume; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import com.rabbitmq.client.Connection; import com.rabbitmq.client.ConnectionFactory; @@ -42,7 +42,7 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLEngine; import javax.net.ssl.TrustManager; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.netcrusher.core.reactor.NioReactor; import org.netcrusher.tcp.TcpCrusher; import org.netcrusher.tcp.TcpCrusherBuilder; @@ -90,7 +90,7 @@ public void connectionGetConsume() throws Exception { CountDownLatch latch = new CountDownLatch(1); basicGetBasicConsume(connection, QUEUE, latch, 100 * 1000); boolean messagesReceived = latch.await(5, TimeUnit.SECONDS); - assertTrue("Message has not been received", messagesReceived); + assertTrue(messagesReceived, "Message has not been received"); } @Test @@ -113,7 +113,7 @@ public void connectionGetConsumeProtocols() throws Exception { CountDownLatch latch = new CountDownLatch(1); basicGetBasicConsume(c, QUEUE, latch, 100); boolean messagesReceived = latch.await(5, TimeUnit.SECONDS); - assertTrue("Message has not been received", messagesReceived); + assertTrue(messagesReceived, "Message has not been received"); assertThat(engine.get()).isNotNull(); assertThat(engine.get().getEnabledProtocols()).contains(protocol); } @@ -133,7 +133,7 @@ public void connectionGetConsumeProtocols() throws Exception { Connection connection = null; try { connection = connectionFactory.newConnection(); - assertTrue("The SSL engine configurator should have called", sslEngineHasBeenCalled.get()); + assertTrue(sslEngineHasBeenCalled.get(), "The SSL engine configurator should have called"); } finally { if (connection != null) { connection.close(); @@ -213,7 +213,7 @@ public void connectionShouldEnforceConnectionTimeout() throws Exception { private void sendAndVerifyMessage(int size) throws Exception { CountDownLatch latch = new CountDownLatch(1); boolean messageReceived = basicGetBasicConsume(connection, QUEUE, latch, size); - assertTrue("Message has not been received", messageReceived); + assertTrue(messageReceived, "Message has not been received"); } } diff --git a/src/test/java/com/rabbitmq/client/test/ssl/SSLTests.java b/src/test/java/com/rabbitmq/client/test/ssl/SSLTests.java deleted file mode 100644 index 758d87118a..0000000000 --- a/src/test/java/com/rabbitmq/client/test/ssl/SSLTests.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. -// -// This software, the RabbitMQ Java client library, is triple-licensed under the -// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 -// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see -// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.test.ssl; - -import com.rabbitmq.client.test.AbstractRMQTestSuite; -import com.rabbitmq.client.test.SslContextFactoryTest; -import org.junit.runner.RunWith; -import org.junit.runner.Runner; -import org.junit.runner.notification.RunNotifier; -import org.junit.runners.Suite; -import org.junit.runners.model.InitializationError; -import org.junit.runners.model.RunnerBuilder; - -import java.util.ArrayList; -import java.util.List; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@RunWith(SSLTests.SslSuite.class) -@Suite.SuiteClasses({ - UnverifiedConnection.class, - VerifiedConnection.class, - BadVerifiedConnection.class, - ConnectionFactoryDefaultTlsVersion.class, - NioTlsUnverifiedConnection.class, - HostnameVerification.class, - TlsConnectionLogging.class, - SslContextFactoryTest.class -}) -public class SSLTests { - - private static final Logger LOGGER = LoggerFactory.getLogger(SSLTests.class); - - // initialize system properties - static{ - new AbstractRMQTestSuite(){}; - } - - public static class SslSuite extends Suite { - - public SslSuite(Class klass, RunnerBuilder builder) throws InitializationError { - super(klass, builder); - } - - public SslSuite(RunnerBuilder builder, Class[] classes) throws InitializationError { - super(builder, classes); - } - - protected SslSuite(Class klass, Class[] suiteClasses) throws InitializationError { - super(klass, suiteClasses); - } - - protected SslSuite(RunnerBuilder builder, Class klass, Class[] suiteClasses) throws InitializationError { - super(builder, klass, suiteClasses); - } - - protected SslSuite(Class klass, List runners) throws InitializationError { - super(klass, runners); - } - - @Override - protected List getChildren() { - if(!AbstractRMQTestSuite.requiredProperties() && !AbstractRMQTestSuite.isSSLAvailable()) { - return new ArrayList<>(); - } else { - return super.getChildren(); - } - } - - @Override - protected void runChild(Runner runner, RunNotifier notifier) { - LOGGER.info("Running test {}", runner.getDescription().getDisplayName()); - super.runChild(runner, notifier); - } - } - -} diff --git a/src/test/java/com/rabbitmq/client/test/ssl/SslTestSuite.java b/src/test/java/com/rabbitmq/client/test/ssl/SslTestSuite.java new file mode 100644 index 0000000000..05160db0f9 --- /dev/null +++ b/src/test/java/com/rabbitmq/client/test/ssl/SslTestSuite.java @@ -0,0 +1,37 @@ +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.test.ssl; + +import com.rabbitmq.client.test.SslContextFactoryTest; + +import org.junit.platform.suite.api.SelectClasses; +import org.junit.platform.suite.api.Suite; + +@Suite +@SelectClasses({ + UnverifiedConnection.class, + VerifiedConnection.class, + BadVerifiedConnection.class, + ConnectionFactoryDefaultTlsVersion.class, + NioTlsUnverifiedConnection.class, + HostnameVerification.class, + TlsConnectionLogging.class, + SslContextFactoryTest.class +}) +public class SslTestSuite { + +} diff --git a/src/test/java/com/rabbitmq/client/test/ssl/TlsConnectionLogging.java b/src/test/java/com/rabbitmq/client/test/ssl/TlsConnectionLogging.java index 4298f18a9a..81360a3815 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/TlsConnectionLogging.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/TlsConnectionLogging.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2021 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -21,9 +21,8 @@ import com.rabbitmq.client.impl.nio.NioParams; import com.rabbitmq.client.test.TestUtils; import org.assertj.core.api.Assertions; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.junit.runners.Parameterized; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import javax.net.ssl.*; import java.security.cert.X509Certificate; @@ -31,16 +30,11 @@ import java.util.function.Function; import java.util.function.Supplier; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; -@RunWith(Parameterized.class) public class TlsConnectionLogging { - @Parameterized.Parameter - public Function> configurer; - - @Parameterized.Parameters - public static Object[] data() { + public static Object[] certificateInfoAreProperlyExtracted() { return new Object[]{blockingIo(), nio()}; } @@ -64,8 +58,9 @@ public static Function> nio() { }; } - @Test - public void certificateInfoAreProperlyExtracted() throws Exception { + @ParameterizedTest + @MethodSource + public void certificateInfoAreProperlyExtracted(Function> configurer) throws Exception { SSLContext sslContext = TlsTestUtils.getSSLContext(); sslContext.init(null, new TrustManager[]{new AlwaysTrustTrustManager()}, null); ConnectionFactory connectionFactory = TestUtils.connectionFactory(); diff --git a/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java b/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java index 6e633ce664..51702c4a6e 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java @@ -15,7 +15,7 @@ package com.rabbitmq.client.test.ssl; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.io.FileInputStream; import java.security.KeyStore; diff --git a/src/test/java/com/rabbitmq/client/test/ssl/UnverifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/UnverifiedConnection.java index 39e1e90ba5..5a0af90463 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/UnverifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/UnverifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2021 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -17,13 +17,13 @@ import com.rabbitmq.client.GetResponse; import com.rabbitmq.client.test.BrokerTestCase; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.slf4j.LoggerFactory; import java.io.IOException; import java.util.concurrent.TimeoutException; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; /** * Test for bug 19356 - SSL Support in rabbitmq diff --git a/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java index d52a44e2e1..e53a83b2f0 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -16,8 +16,8 @@ package com.rabbitmq.client.test.ssl; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import com.rabbitmq.client.Connection; import com.rabbitmq.client.impl.nio.NioParams; @@ -36,20 +36,18 @@ import com.rabbitmq.client.ConnectionFactory; import com.rabbitmq.client.test.TestUtils; -import org.junit.ClassRule; -import org.junit.Test; -import org.junit.rules.TestRule; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledForJreRange; +import org.junit.jupiter.api.condition.JRE; import org.slf4j.LoggerFactory; /** * Test for bug 19356 - SSL Support in rabbitmq * */ +@EnabledForJreRange(min = JRE.JAVA_11) public class VerifiedConnection extends UnverifiedConnection { - @ClassRule - public static TestRule atLeastJava11TestRule = TestUtils.atLeastJava11(); - public void openConnection() throws IOException, TimeoutException { try { @@ -103,7 +101,7 @@ public void connectionGetConsumeProtocols() throws Exception { CountDownLatch latch = new CountDownLatch(1); TestUtils.basicGetBasicConsume(c, VerifiedConnection.class.getName(), latch, 100); boolean messagesReceived = latch.await(5, TimeUnit.SECONDS); - assertTrue("Message has not been received", messagesReceived); + assertTrue(messagesReceived, "Message has not been received"); assertThat(protocolsSupplier.get()).isNotNull(); assertThat(protocolsSupplier.get().get()).contains(protocol); } diff --git a/src/test/java/com/rabbitmq/tools/Host.java b/src/test/java/com/rabbitmq/tools/Host.java index ee3b6a59f3..8e950cb27e 100644 --- a/src/test/java/com/rabbitmq/tools/Host.java +++ b/src/test/java/com/rabbitmq/tools/Host.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/utility/IntAllocatorTests.java b/src/test/java/com/rabbitmq/utility/IntAllocatorTests.java index d29e134442..5e468a60e3 100644 --- a/src/test/java/com/rabbitmq/utility/IntAllocatorTests.java +++ b/src/test/java/com/rabbitmq/utility/IntAllocatorTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,14 +15,14 @@ package com.rabbitmq.utility; -import org.junit.Test; +import org.junit.jupiter.api.Test; import java.util.HashSet; import java.util.Iterator; import java.util.Random; import java.util.Set; -import static org.junit.Assert.*; +import static org.junit.jupiter.api.Assertions.*; public class IntAllocatorTests { @@ -41,38 +41,38 @@ public class IntAllocatorTests { iAll.free(trial); set.remove(trial); } else { - assertTrue("Did not reserve free integer " + trial, iAll.reserve(trial)); + assertTrue(iAll.reserve(trial), "Did not reserve free integer " + trial); set.add(trial); } } for (int trial : set) { - assertFalse("Integer " + trial + " not allocated!", iAll.reserve(trial)); + assertFalse(iAll.reserve(trial), "Integer " + trial + " not allocated!"); } } - @Test public void allocateAndFree() throws Exception { + @Test public void allocateAndFree() { Set set = new HashSet(); for (int i=0; i < TEST_ITERATIONS; ++i) { if (getBool(rand)) { int trial = iAll.allocate(); - assertFalse("Already allocated " + trial, set.contains(trial)); + assertFalse(set.contains(trial), "Already allocated " + trial); set.add(trial); } else { if (!set.isEmpty()) { int trial = extractOne(set); - assertFalse("Allocator agreed to reserve " + trial, iAll.reserve(trial)); + assertFalse(iAll.reserve(trial), "Allocator agreed to reserve " + trial); iAll.free(trial); } } } for (int trial : set) { - assertFalse("Integer " + trial + " should be allocated!", iAll.reserve(trial)); + assertFalse(iAll.reserve(trial), "Integer " + trial + " should be allocated!"); } } - @Test public void testToString() throws Exception { + @Test public void testToString() { IntAllocator ibs = new IntAllocator(LO_RANGE, HI_RANGE); assertEquals("IntAllocator{allocated = []}", ibs.toString()); ibs.allocate(); diff --git a/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension b/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension new file mode 100644 index 0000000000..5d5a5c135a --- /dev/null +++ b/src/test/resources/META-INF/services/org.junit.jupiter.api.extension.Extension @@ -0,0 +1 @@ +com.rabbitmq.client.AmqpClientTestExtension \ No newline at end of file diff --git a/src/test/resources/junit-platform.properties b/src/test/resources/junit-platform.properties new file mode 100644 index 0000000000..b059a65dc4 --- /dev/null +++ b/src/test/resources/junit-platform.properties @@ -0,0 +1 @@ +junit.jupiter.extensions.autodetection.enabled=true \ No newline at end of file diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml index 5874c1c8c4..f47371567e 100644 --- a/src/test/resources/logback-test.xml +++ b/src/test/resources/logback-test.xml @@ -5,10 +5,8 @@ - - - + From 10b2ca302fe0458761b64f30ee7cc2e1cb1a8c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 6 Jan 2023 11:04:36 +0100 Subject: [PATCH 188/657] Fix test condition (cherry picked from commit 41f0804052d62140065ba8466c3c05189161fbff) --- src/test/java/com/rabbitmq/client/test/TestUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/rabbitmq/client/test/TestUtils.java b/src/test/java/com/rabbitmq/client/test/TestUtils.java index 8897bf23a9..cbb2885f22 100644 --- a/src/test/java/com/rabbitmq/client/test/TestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/TestUtils.java @@ -478,7 +478,7 @@ static class DisabledIfBrokerRunningOnDockerCondition implements @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { if (Host.isOnDocker()) { - return ConditionEvaluationResult.enabled("Broker running on Docker"); + return ConditionEvaluationResult.disabled("Broker running on Docker"); } else { return ConditionEvaluationResult.enabled("Broker not running on Docker"); } From 300f92791f4f9bef3eb8de8ffa181c8542794db9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 6 Jan 2023 11:47:28 +0100 Subject: [PATCH 189/657] Fix tests after JUnit 5 upgrade They were not in main. --- .../java/com/rabbitmq/client/DefaultJsonRpcTest.java | 12 ++++++------ .../java/com/rabbitmq/client/test/ChannelNTest.java | 5 +++-- .../com/rabbitmq/client/test/JSONReadWriteTest.java | 11 ++++++----- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/DefaultJsonRpcTest.java b/src/test/java/com/rabbitmq/client/DefaultJsonRpcTest.java index 42cd9cfa66..7f231d1bd3 100644 --- a/src/test/java/com/rabbitmq/client/DefaultJsonRpcTest.java +++ b/src/test/java/com/rabbitmq/client/DefaultJsonRpcTest.java @@ -15,17 +15,17 @@ package com.rabbitmq.client; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + import com.rabbitmq.tools.jsonrpc.DefaultJsonRpcMapper; import com.rabbitmq.tools.jsonrpc.JsonRpcException; import com.rabbitmq.tools.jsonrpc.JsonRpcMapper; -import org.junit.Test; import java.lang.reflect.UndeclaredThrowableException; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import org.junit.jupiter.api.Test; public class DefaultJsonRpcTest extends AbstractJsonRpcTest { diff --git a/src/test/java/com/rabbitmq/client/test/ChannelNTest.java b/src/test/java/com/rabbitmq/client/test/ChannelNTest.java index c615c3bfe0..448f94ee02 100644 --- a/src/test/java/com/rabbitmq/client/test/ChannelNTest.java +++ b/src/test/java/com/rabbitmq/client/test/ChannelNTest.java @@ -56,11 +56,12 @@ public void serverBasicCancelForUnknownConsumerDoesNotThrowException() throws Ex channel.processAsync(new AMQCommand(method)); } - @Test(expected = IOException.class) + @Test public void callingBasicCancelForUnknownConsumerThrowsException() throws Exception { AMQConnection connection = Mockito.mock(AMQConnection.class); ChannelN channel = new ChannelN(connection, 1, consumerWorkService); - channel.basicCancel("does-not-exist"); + assertThatThrownBy(() -> channel.basicCancel("does-not-exist")) + .isInstanceOf(IOException.class); } @Test diff --git a/src/test/java/com/rabbitmq/client/test/JSONReadWriteTest.java b/src/test/java/com/rabbitmq/client/test/JSONReadWriteTest.java index 3c71951aab..8aed35fb80 100644 --- a/src/test/java/com/rabbitmq/client/test/JSONReadWriteTest.java +++ b/src/test/java/com/rabbitmq/client/test/JSONReadWriteTest.java @@ -16,16 +16,17 @@ package com.rabbitmq.client.test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + import com.rabbitmq.tools.json.JSONReader; import com.rabbitmq.tools.json.JSONWriter; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; +import org.junit.jupiter.api.Test; public class JSONReadWriteTest { - @Test public void readWriteSimple() throws Exception { + @Test + public void readWriteSimple() throws Exception { Object myRet; String myJson; From b85968553e2a4ea89e9efb13830291c2f694ce81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 01:17:00 +0000 Subject: [PATCH 190/657] Bump opentelemetry.version from 1.21.0 to 1.22.0 Bumps `opentelemetry.version` from 1.21.0 to 1.22.0. Updates `opentelemetry-api` from 1.21.0 to 1.22.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.21.0...v1.22.0) Updates `opentelemetry-sdk-testing` from 1.21.0 to 1.22.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.21.0...v1.22.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 621755dd86..5fd4765d1a 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 1.7.36 4.2.15 1.10.2 - 1.21.0 + 1.22.0 2.14.1 1.2.11 5.9.1 From 2b80224aed5ee837f78358e21513a033d6a86aea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 01:17:09 +0000 Subject: [PATCH 191/657] Bump assertj-core from 3.24.0 to 3.24.1 Bumps assertj-core from 3.24.0 to 3.24.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 621755dd86..58e751c304 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.2.11 5.9.1 4.11.0 - 3.24.0 + 3.24.1 9.4.50.v20221201 1.70 0.10 From f3ffc89b4e8009bbfb877db5860e0d44192e93f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jan 2023 00:28:12 +0000 Subject: [PATCH 192/657] Bump junit-bom from 5.9.1 to 5.9.2 Bumps [junit-bom](https://github.com/junit-team/junit5) from 5.9.1 to 5.9.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.1...r5.9.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 fc27a15978..2981f6d2e8 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.22.0 2.14.1 1.2.11 - 5.9.1 + 5.9.2 4.11.0 3.24.1 9.4.50.v20221201 From fb761665ebd88f1139a903d5e142e50330ee6dbd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Jan 2023 00:28:25 +0000 Subject: [PATCH 193/657] Bump micrometer-core from 1.10.2 to 1.10.3 Bumps [micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.10.2 to 1.10.3. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.10.2...v1.10.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 fc27a15978..7a7d48a860 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.7.36 4.2.15 - 1.10.2 + 1.10.3 1.22.0 2.14.1 1.2.11 From 49f5c051c13b5986696d68c7e36eff8d0b498b0a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 00:46:36 +0000 Subject: [PATCH 194/657] Bump maven-surefire-plugin from 3.0.0-M7 to 3.0.0-M8 Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M7 to 3.0.0-M8. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M7...surefire-3.0.0-M8) --- 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 c656716846..f1b8bb4b7e 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,7 @@ 1.6 3.3.0 3.10.1 - 3.0.0-M7 + 3.0.0-M8 3.0.0-M7 3.0.1 3.3.0 From 678d35fe57a0f3207b07ade49960eb575cfb88d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 02:09:18 +0000 Subject: [PATCH 195/657] Bump maven-failsafe-plugin from 3.0.0-M7 to 3.0.0-M8 Bumps [maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M7 to 3.0.0-M8. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M7...surefire-3.0.0-M8) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-failsafe-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 f1b8bb4b7e..eafe1fe317 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 3.3.0 3.10.1 3.0.0-M8 - 3.0.0-M7 + 3.0.0-M8 3.0.1 3.3.0 5.1.8 From 45b4c48eaf5c3e0157b372f661e4aff101fb2ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 16 Jan 2023 09:52:37 +0100 Subject: [PATCH 196/657] Bump Mockito to 5.0.0, stick to 4.x on Java 8 (cherry picked from commit 28d59d2cbc102ef01bf7a356c1db6d87176fd215) Conflicts: .github/dependabot.yml --- pom.xml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eafe1fe317..97a229bab8 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.14.1 1.2.11 5.9.2 - 4.11.0 + 5.0.0 3.24.1 9.4.50.v20221201 1.70 @@ -684,6 +684,15 @@ + + mockito-4-on-java-8 + + 1.8 + + + 4.11.0 + + From 7d7c1cde3397a929bbb66914da9ef954cb068e52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Jan 2023 00:14:45 +0000 Subject: [PATCH 197/657] Bump assertj-core from 3.24.1 to 3.24.2 Bumps assertj-core from 3.24.1 to 3.24.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 97a229bab8..d21a7d1d3f 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.2.11 5.9.2 5.0.0 - 3.24.1 + 3.24.2 9.4.50.v20221201 1.70 0.10 From 52f26f87fea89f45c2fd2df3163923e7976c75ab Mon Sep 17 00:00:00 2001 From: Nikita Nefedov Date: Mon, 23 Jan 2023 15:18:27 +0100 Subject: [PATCH 198/657] Report publish failures for the closed channel as well (cherry picked from commit a1860788d38a6caf30702531ddb596c23df83cb3) --- src/main/java/com/rabbitmq/client/impl/ChannelN.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelN.java b/src/main/java/com/rabbitmq/client/impl/ChannelN.java index 8a769a0d45..3c97d339e8 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelN.java @@ -708,7 +708,7 @@ public void basicPublish(String exchange, String routingKey, .build(), props, body); try { transmit(command); - } catch (IOException e) { + } catch (IOException | AlreadyClosedException e) { metricsCollector.basicPublishFailure(this, e); throw e; } @@ -1489,7 +1489,7 @@ public Consumer transformReply(AMQCommand replyCommand) { rpc(m, k); - + try { if(_rpcTimeout == NO_RPC_TIMEOUT) { k.getReply(); // discard result From 69d807ee6f0f237d152036cef6c9a102877fc444 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 01:15:19 +0000 Subject: [PATCH 199/657] Bump mockito-core from 5.0.0 to 5.1.0 Bumps [mockito-core](https://github.com/mockito/mockito) from 5.0.0 to 5.1.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.0.0...v5.1.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 d21a7d1d3f..fd42c00e78 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.14.1 1.2.11 5.9.2 - 5.0.0 + 5.1.0 3.24.2 9.4.50.v20221201 1.70 From 06a4efa45547ad5bf2ecbb15dcf87ccfa4cccc34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 30 Jan 2023 09:40:12 +0100 Subject: [PATCH 200/657] Execute multi-Java test suite on Wednesday and Sunday only Used to be every day. It may be too much for our GHA quota, so we reduce the frequency. It should do the job as well. (cherry picked from commit 84ddee03c25392bd449bc9d34135d026761f26e8) --- .github/workflows/test-3.11-alpha.yml | 2 +- .github/workflows/test-native-image.yml | 2 +- .github/workflows/test-supported-java-versions-5.x.yml | 2 +- .github/workflows/test-supported-java-versions-main.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-3.11-alpha.yml b/.github/workflows/test-3.11-alpha.yml index c43a5dd34d..9617a9ed0c 100644 --- a/.github/workflows/test-3.11-alpha.yml +++ b/.github/workflows/test-3.11-alpha.yml @@ -2,7 +2,7 @@ name: Test against RabbitMQ 3.11 alpha on: schedule: - - cron: '0 4 * * *' + - cron: '0 4 ? * SUN,WED' pull_request: branches: - 5.x.x-stable diff --git a/.github/workflows/test-native-image.yml b/.github/workflows/test-native-image.yml index 05737ba90b..d1390252b3 100644 --- a/.github/workflows/test-native-image.yml +++ b/.github/workflows/test-native-image.yml @@ -2,7 +2,7 @@ name: Test GraalVM native image on: schedule: - - cron: '0 4 * * *' + - cron: '0 4 ? * SUN,WED' workflow_dispatch: env: diff --git a/.github/workflows/test-supported-java-versions-5.x.yml b/.github/workflows/test-supported-java-versions-5.x.yml index 1885402a4b..b9b906254d 100644 --- a/.github/workflows/test-supported-java-versions-5.x.yml +++ b/.github/workflows/test-supported-java-versions-5.x.yml @@ -2,7 +2,7 @@ name: Test against supported Java versions (5.x) on: schedule: - - cron: '0 4 * * *' + - cron: '0 4 ? * SUN,WED' workflow_dispatch: env: diff --git a/.github/workflows/test-supported-java-versions-main.yml b/.github/workflows/test-supported-java-versions-main.yml index d1ead48e7c..21667df7e1 100644 --- a/.github/workflows/test-supported-java-versions-main.yml +++ b/.github/workflows/test-supported-java-versions-main.yml @@ -2,7 +2,7 @@ name: Test against supported Java versions (main) on: schedule: - - cron: '0 4 * * *' + - cron: '0 4 ? * SUN,WED' workflow_dispatch: env: From af73621e94e879e219d67857fff407411c5c445e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 00:09:44 +0000 Subject: [PATCH 201/657] Bump mockito-core from 5.1.0 to 5.1.1 Bumps [mockito-core](https://github.com/mockito/mockito) from 5.1.0 to 5.1.1. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.1.0...v5.1.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 fd42c00e78..2775ae46fb 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.14.1 1.2.11 5.9.2 - 5.1.0 + 5.1.1 3.24.2 9.4.50.v20221201 1.70 From 458ac1d22b7e3f4c59cb5cff7b12ba3e9a49c196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 31 Jan 2023 14:41:43 +0100 Subject: [PATCH 202/657] Fix NPE in metrics collector if channel is null Fixes #944 (cherry picked from commit 20e641e1b53dec785b4da9b5f65fb6423b5d16aa) --- .../com/rabbitmq/client/impl/AMQConnection.java | 10 +++++++--- .../client/impl/AbstractMetricsCollector.java | 14 ++++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/AMQConnection.java b/src/main/java/com/rabbitmq/client/impl/AMQConnection.java index 61b7a678a9..dc077080a3 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQConnection.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -605,7 +605,9 @@ public Channel createChannel(int channelNumber) throws IOException { ChannelManager cm = _channelManager; if (cm == null) return null; Channel channel = cm.createChannel(this, channelNumber); - metricsCollector.newChannel(channel); + if (channel != null) { + metricsCollector.newChannel(channel); + } return channel; } @@ -616,7 +618,9 @@ public Channel createChannel() throws IOException { ChannelManager cm = _channelManager; if (cm == null) return null; Channel channel = cm.createChannel(this); - metricsCollector.newChannel(channel); + if (channel != null) { + metricsCollector.newChannel(channel); + } return channel; } diff --git a/src/main/java/com/rabbitmq/client/impl/AbstractMetricsCollector.java b/src/main/java/com/rabbitmq/client/impl/AbstractMetricsCollector.java index 44cf1aff9e..7ece72ad4c 100644 --- a/src/main/java/com/rabbitmq/client/impl/AbstractMetricsCollector.java +++ b/src/main/java/com/rabbitmq/client/impl/AbstractMetricsCollector.java @@ -72,12 +72,14 @@ public void closeConnection(Connection connection) { @Override public void newChannel(final Channel channel) { - try { - incrementChannelCount(channel); - channel.addShutdownListener(cause -> closeChannel(channel)); - connectionState(channel.getConnection()).channelState.put(channel.getChannelNumber(), new ChannelState(channel)); - } catch(Exception e) { - LOGGER.info("Error while computing metrics in newChannel: " + e.getMessage()); + if (channel != null) { + try { + incrementChannelCount(channel); + channel.addShutdownListener(cause -> closeChannel(channel)); + connectionState(channel.getConnection()).channelState.put(channel.getChannelNumber(), new ChannelState(channel)); + } catch(Exception e) { + LOGGER.info("Error while computing metrics in newChannel: " + e.getMessage()); + } } } From bc8f2faee04614938c278000bb0d04e9dee812d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 1 Feb 2023 09:44:26 +0100 Subject: [PATCH 203/657] Execute multi-Java test suite on Thursday morning Better balanced in the week than on Wednesday morning. (cherry picked from commit cc44e222ced8b76e14240dc9d5a92e702e5fce89) --- .github/workflows/test-3.11-alpha.yml | 2 +- .github/workflows/test-native-image.yml | 2 +- .github/workflows/test-supported-java-versions-5.x.yml | 2 +- .github/workflows/test-supported-java-versions-main.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-3.11-alpha.yml b/.github/workflows/test-3.11-alpha.yml index 9617a9ed0c..20cecc4359 100644 --- a/.github/workflows/test-3.11-alpha.yml +++ b/.github/workflows/test-3.11-alpha.yml @@ -2,7 +2,7 @@ name: Test against RabbitMQ 3.11 alpha on: schedule: - - cron: '0 4 ? * SUN,WED' + - cron: '0 4 ? * SUN,THU' pull_request: branches: - 5.x.x-stable diff --git a/.github/workflows/test-native-image.yml b/.github/workflows/test-native-image.yml index d1390252b3..0a7fc33e9e 100644 --- a/.github/workflows/test-native-image.yml +++ b/.github/workflows/test-native-image.yml @@ -2,7 +2,7 @@ name: Test GraalVM native image on: schedule: - - cron: '0 4 ? * SUN,WED' + - cron: '0 4 ? * SUN,THU' workflow_dispatch: env: diff --git a/.github/workflows/test-supported-java-versions-5.x.yml b/.github/workflows/test-supported-java-versions-5.x.yml index b9b906254d..7b24cd3406 100644 --- a/.github/workflows/test-supported-java-versions-5.x.yml +++ b/.github/workflows/test-supported-java-versions-5.x.yml @@ -2,7 +2,7 @@ name: Test against supported Java versions (5.x) on: schedule: - - cron: '0 4 ? * SUN,WED' + - cron: '0 4 ? * SUN,THU' workflow_dispatch: env: diff --git a/.github/workflows/test-supported-java-versions-main.yml b/.github/workflows/test-supported-java-versions-main.yml index 21667df7e1..8687dbdd32 100644 --- a/.github/workflows/test-supported-java-versions-main.yml +++ b/.github/workflows/test-supported-java-versions-main.yml @@ -2,7 +2,7 @@ name: Test against supported Java versions (main) on: schedule: - - cron: '0 4 ? * SUN,WED' + - cron: '0 4 ? * SUN,THU' workflow_dispatch: env: From bb79c99b00bd0ac2d0956304feac6fff732345f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Feb 2023 02:19:37 +0000 Subject: [PATCH 204/657] Bump opentelemetry.version from 1.22.0 to 1.23.0 Bumps `opentelemetry.version` from 1.22.0 to 1.23.0. Updates `opentelemetry-api` from 1.22.0 to 1.23.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.22.0...v1.23.0) Updates `opentelemetry-sdk-testing` from 1.22.0 to 1.23.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.22.0...v1.23.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 2775ae46fb..9abf91924f 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 1.7.36 4.2.15 1.10.3 - 1.22.0 + 1.23.0 2.14.1 1.2.11 5.9.2 From 99392a95c862fe8e83d744145fc2c4658df77a17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 01:07:41 +0000 Subject: [PATCH 205/657] Bump metrics-core from 4.2.15 to 4.2.16 Bumps [metrics-core](https://github.com/dropwizard/metrics) from 4.2.15 to 4.2.16. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.15...v4.2.16) --- 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 9abf91924f..ee77aba1a6 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ UTF-8 1.7.36 - 4.2.15 + 4.2.16 1.10.3 1.23.0 2.14.1 From 3713f4de9b43c1f8b7a51331748f07bebbf4c4cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 01:07:53 +0000 Subject: [PATCH 206/657] Bump maven-surefire-plugin from 3.0.0-M8 to 3.0.0-M9 Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M8 to 3.0.0-M9. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M8...surefire-3.0.0-M9) --- 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 9abf91924f..d60ef4b61c 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,7 @@ 1.6 3.3.0 3.10.1 - 3.0.0-M8 + 3.0.0-M9 3.0.0-M8 3.0.1 3.3.0 From ee797df51a6ba4c994fad06ec38399edf5950e31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 01:21:17 +0000 Subject: [PATCH 207/657] Bump maven-failsafe-plugin from 3.0.0-M8 to 3.0.0-M9 Bumps [maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M8 to 3.0.0-M9. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M8...surefire-3.0.0-M9) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-failsafe-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 ab7d04ec8f..d246417e19 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 3.3.0 3.10.1 3.0.0-M9 - 3.0.0-M8 + 3.0.0-M9 3.0.1 3.3.0 5.1.8 From ce6dfdd8bdcbb083a95627c5e8c197a21b2d6df7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Feb 2023 01:07:25 +0000 Subject: [PATCH 208/657] Bump micrometer-core from 1.10.3 to 1.10.4 Bumps [micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.10.3 to 1.10.4. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.10.3...v1.10.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 d246417e19..46c7cba7f2 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.7.36 4.2.16 - 1.10.3 + 1.10.4 1.23.0 2.14.1 1.2.11 From 3b3f97d7677f4ae3de7ffa4ac9f3cb3ce1e23d5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Feb 2023 01:08:26 +0000 Subject: [PATCH 209/657] Bump opentelemetry.version from 1.23.0 to 1.23.1 Bumps `opentelemetry.version` from 1.23.0 to 1.23.1. Updates `opentelemetry-api` from 1.23.0 to 1.23.1 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.23.0...v1.23.1) Updates `opentelemetry-sdk-testing` from 1.23.0 to 1.23.1 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.23.0...v1.23.1) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 46c7cba7f2..120aa45662 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 1.7.36 4.2.16 1.10.4 - 1.23.0 + 1.23.1 2.14.1 1.2.11 5.9.2 From ec454c81ab0164c67e2b5935faab219d936c7a75 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Feb 2023 01:08:43 +0000 Subject: [PATCH 210/657] Bump maven-javadoc-plugin from 3.4.1 to 3.5.0 Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.4.1 to 3.5.0. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.4.1...maven-javadoc-plugin-3.5.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 46c7cba7f2..5ace3426df 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 1.70 0.10 - 3.4.1 + 3.5.0 2.5.3 2.14.2 3.3.0 From 71ed3b4773785ef5aa38653d64a7ea0de4dbe2bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Feb 2023 00:52:28 +0000 Subject: [PATCH 211/657] Bump versions-maven-plugin from 2.14.2 to 2.15.0 Bumps [versions-maven-plugin](https://github.com/mojohaus/versions) from 2.14.2 to 2.15.0. - [Release notes](https://github.com/mojohaus/versions/releases) - [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions/compare/2.14.2...2.15.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-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 a88773c039..bb607d336d 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 3.5.0 2.5.3 - 2.14.2 + 2.15.0 3.3.0 3.2.1 2.1.1 From c2aa506ffdd5b26a0b59e22c370cff1c42ed4474 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 23 Feb 2023 09:23:20 +0100 Subject: [PATCH 212/657] Add test to parse OAuth2 token with GSON Instead of Jackson. The requirement is very small, and GSON is a much smaller dependency than Jackson. (cherry picked from commit af8036d1a6e4853582152559d1910708f19f7ca3) --- pom.xml | 7 ++++ ...edentialsGrantCredentialsProviderTest.java | 33 ++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bb607d336d..4b4cfaacde 100644 --- a/pom.xml +++ b/pom.xml @@ -66,6 +66,7 @@ 9.4.50.v20221201 1.70 0.10 + 2.10.1 3.5.0 2.5.3 @@ -784,6 +785,12 @@ ${opentelemetry.version} test + + com.google.code.gson + gson + ${gson.version} + test + diff --git a/src/test/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProviderTest.java b/src/test/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProviderTest.java index 33614d78bd..f717cbcf27 100644 --- a/src/test/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProviderTest.java +++ b/src/test/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProviderTest.java @@ -15,6 +15,7 @@ package com.rabbitmq.client.impl; +import com.google.gson.Gson; import com.rabbitmq.client.test.TestUtils; import org.bouncycastle.asn1.x500.X500NameBuilder; import org.bouncycastle.asn1.x500.style.BCStyle; @@ -195,7 +196,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques } @Test - public void parseToken() { + public void parseTokenDefault() { OAuth2ClientCredentialsGrantCredentialsProvider provider = new OAuth2ClientCredentialsGrantCredentialsProvider( "http://localhost:8080/uaa/oauth/token/", "rabbit_client", "rabbit_secret", @@ -211,6 +212,36 @@ public void parseToken() { assertThat(token.getTimeBeforeExpiration()).isBetween(Duration.ofSeconds(expiresIn - 10), Duration.ofSeconds(expiresIn + 1)); } + @Test + public void parseTokenGson() { + Gson gson = new Gson(); + OAuth2ClientCredentialsGrantCredentialsProvider provider = new OAuth2ClientCredentialsGrantCredentialsProvider( + "http://localhost:8080/uaa/oauth/token/", + "rabbit_client", "rabbit_secret", + "client_credentials" + ) { + @Override + protected Token parseToken(String response) { + try { + Map map = gson.fromJson(response, Map.class); + int expiresIn = ((Number) map.get("expires_in")).intValue(); + Instant receivedAt = Instant.now(); + return new Token(map.get("access_token").toString(), expiresIn, receivedAt); + } catch (Exception e) { + throw new OAuthTokenManagementException("Error while parsing OAuth 2 token", e); + } + } + }; + + String accessToken = "18c1b1dfdda04382a8bcc14d077b71dd"; + int expiresIn = 43199; + String response = sampleJsonToken(accessToken, expiresIn); + + OAuth2ClientCredentialsGrantCredentialsProvider.Token token = provider.parseToken(response); + assertThat(token.getAccess()).isEqualTo("18c1b1dfdda04382a8bcc14d077b71dd"); + assertThat(token.getTimeBeforeExpiration()).isBetween(Duration.ofSeconds(expiresIn - 10), Duration.ofSeconds(expiresIn + 1)); + } + String sampleJsonToken(String accessToken, int expiresIn) { String json = "{\n" + " \"access_token\" : \"{accessToken}\",\n" + From e7e0ac034e43ee92fdb7d9861aae6ac5f0e59b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 23 Feb 2023 14:12:08 +0100 Subject: [PATCH 213/657] Remove hard dependency on Jackson in OAuth 2 support It's possible to override the token parsing method, to avoid using Jackson, but the class would have a Jackson mapper in its properties. This commit introduces an abstraction to parse the token and the default Jackson implementation is instantianted on the fly. (cherry picked from commit c0811fa13b02883166630d299bc48a21640cef55) Conflicts: src/main/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProvider.java --- ...ntCredentialsGrantCredentialsProvider.java | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProvider.java b/src/main/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProvider.java index 5e9618317d..65cd9ef2da 100644 --- a/src/main/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProvider.java +++ b/src/main/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProvider.java @@ -18,6 +18,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.rabbitmq.client.TrustEverythingTrustManager; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Function; import javax.net.ssl.*; import java.io.*; import java.net.HttpURLConnection; @@ -72,7 +74,7 @@ public class OAuth2ClientCredentialsGrantCredentialsProvider extends RefreshProt private final Map parameters; - private final ObjectMapper objectMapper = new ObjectMapper(); + private final AtomicReference> tokenExtractor = new AtomicReference<>(); private final String id; @@ -214,14 +216,8 @@ protected String usernameFromToken(Token token) { } protected Token parseToken(String response) { - try { - Map map = objectMapper.readValue(response, Map.class); - int expiresIn = ((Number) map.get("expires_in")).intValue(); - Instant receivedAt = Instant.now(); - return new Token(map.get("access_token").toString(), expiresIn, receivedAt); - } catch (IOException e) { - throw new OAuthTokenManagementException("Error while parsing OAuth 2 token", e); - } + return this.tokenExtractor.updateAndGet(current -> + current == null ? new JacksonTokenLookup() : current).apply(response); } @Override @@ -595,5 +591,21 @@ private SSLSocketFactory sslSocketFactory() { } } + + private static class JacksonTokenLookup implements Function { + + private final ObjectMapper objectMapper = new ObjectMapper(); + @Override + public Token apply(String response) { + try { + Map map = objectMapper.readValue(response, Map.class); + int expiresIn = ((Number) map.get("expires_in")).intValue(); + Instant receivedAt = Instant.now(); + return new Token(map.get("access_token").toString(), expiresIn, receivedAt); + } catch (IOException e) { + throw new OAuthTokenManagementException("Error while parsing OAuth 2 token", e); + } + } + } } \ No newline at end of file From 4c4a043c43299d78d7266171465746cb2c6dafb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 23 Feb 2023 15:43:54 +0100 Subject: [PATCH 214/657] Add GHA release scripts (cherry picked from commit 2dd331f1a8f4677bff9b187b6057ed79433a24ea) --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ ci/evaluate-release.sh | 14 ++++++++++ ci/release-java-client.sh | 27 +++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100755 ci/evaluate-release.sh create mode 100755 ci/release-java-client.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..f69d596fd4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release AMQP Java Client + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v3 + - name: Evaluate release type + run: ci/evaluate-release.sh + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Set up JDK + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '8' + cache: 'maven' + server-id: ${{ env.maven_server_id }} + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + - name: Get dependencies + run: make deps + - name: Release AMQP Java Client (GA) + if: ${{ env.ga_release == 'true' }} + run: | + git config user.name "rabbitmq-ci" + git config user.email "rabbitmq-ci@users.noreply.github.com" + ci/release-java-client.sh + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + - name: Release AMQP Java Client (Milestone/RC) + if: ${{ env.ga_release != 'true' }} + run: | + git config user.name "rabbitmq-ci" + git config user.email "rabbitmq-ci@users.noreply.github.com" + ci/release-java-client.sh + env: + MAVEN_USERNAME: '' + MAVEN_PASSWORD: ${{ secrets.PACKAGECLOUD_TOKEN }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file diff --git a/ci/evaluate-release.sh b/ci/evaluate-release.sh new file mode 100755 index 0000000000..4ad656d7a0 --- /dev/null +++ b/ci/evaluate-release.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +source ./release-versions.txt + +if [[ $RELEASE_VERSION == *[RCM]* ]] +then + echo "prerelease=true" >> $GITHUB_ENV + echo "ga_release=false" >> $GITHUB_ENV + echo "maven_server_id=packagecloud-rabbitmq-maven-milestones" >> $GITHUB_ENV +else + echo "prerelease=false" >> $GITHUB_ENV + echo "ga_release=true" >> $GITHUB_ENV + echo "maven_server_id=ossrh" >> $GITHUB_ENV +fi \ No newline at end of file diff --git a/ci/release-java-client.sh b/ci/release-java-client.sh new file mode 100755 index 0000000000..d3fd7df952 --- /dev/null +++ b/ci/release-java-client.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +source ./release-versions.txt +git checkout $RELEASE_BRANCH + +./mvnw release:clean release:prepare -DdryRun=true -Darguments="-DskipTests" --no-transfer-progress \ + --batch-mode -Dtag="v$RELEASE_VERSION" \ + -DreleaseVersion=$RELEASE_VERSION \ + -DdevelopmentVersion=$DEVELOPMENT_VERSION \ + +./mvnw release:clean release:prepare -Darguments="-DskipTests" --no-transfer-progress \ + --batch-mode -Dtag="v$RELEASE_VERSION" \ + -DreleaseVersion=$RELEASE_VERSION \ + -DdevelopmentVersion=$DEVELOPMENT_VERSION + +git checkout "v$RELEASE_VERSION" + +if [[ $RELEASE_VERSION == *[RCM]* ]] +then + MAVEN_PROFILE="milestone" + echo "prerelease=true" >> $GITHUB_ENV +else + MAVEN_PROFILE="release" + echo "prerelease=false" >> $GITHUB_ENV +fi + +./mvnw clean deploy -P $MAVEN_PROFILE -DskipTests --no-transfer-progress \ No newline at end of file From cb5ce5c4a1590ff5283c6a04d95333438496e6c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 23 Feb 2023 16:32:40 +0100 Subject: [PATCH 215/657] Use HTTPS in Maven dev connection To avoid key exchange in GHA. (cherry picked from commit bcf93a8297070c8b8ed94aaaafbbce52bea8fee7) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4b4cfaacde..19131ee6a9 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git - scm:git:git@github.com:rabbitmq/rabbitmq-java-client.git + scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git HEAD From f7faaefa4cabe85c2429ed465dcbd44a184dd9e6 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Thu, 23 Feb 2023 15:35:17 +0000 Subject: [PATCH 216/657] [maven-release-plugin] prepare release v5.17.0.RC1 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 19131ee6a9..a832f67508 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.17.0-SNAPSHOT + 5.17.0.RC1 jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git - HEAD + v5.17.0.RC1 From 72e9820d8eefc4bc6026aca678ca98e0ca52d5da Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Thu, 23 Feb 2023 15:35:19 +0000 Subject: [PATCH 217/657] [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 a832f67508..19131ee6a9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.17.0.RC1 + 5.17.0-SNAPSHOT jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git - v5.17.0.RC1 + HEAD From 32c0147d65a5f2a07a1cdc2f756c5899efc597d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 23 Feb 2023 16:46:48 +0100 Subject: [PATCH 218/657] Set release version to 5.17.0.RC2 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index ddbfbaf7af..d19addd36d 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.17.0.RC1" +RELEASE_VERSION="5.17.0.RC2" DEVELOPMENT_VERSION="5.17.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From 6724d1c046a3e8ad978973d3f6ce4755cee3cc50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Feb 2023 00:43:36 +0000 Subject: [PATCH 219/657] Bump metrics-core from 4.2.16 to 4.2.17 Bumps [metrics-core](https://github.com/dropwizard/metrics) from 4.2.16 to 4.2.17. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.16...v4.2.17) --- 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 19131ee6a9..9ded68738e 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ UTF-8 1.7.36 - 4.2.16 + 4.2.17 1.10.4 1.23.1 2.14.1 From 1d233ce4068befbedee07ee89f0198dd2313f543 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Feb 2023 01:07:25 +0000 Subject: [PATCH 220/657] Bump jetty-servlet from 9.4.50.v20221201 to 9.4.51.v20230217 Bumps [jetty-servlet](https://github.com/eclipse/jetty.project) from 9.4.50.v20221201 to 9.4.51.v20230217. - [Release notes](https://github.com/eclipse/jetty.project/releases) - [Commits](https://github.com/eclipse/jetty.project/compare/jetty-9.4.50.v20221201...jetty-9.4.51.v20230217) --- updated-dependencies: - dependency-name: org.eclipse.jetty:jetty-servlet 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 9ded68738e..90d85f05b6 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 5.9.2 5.1.1 3.24.2 - 9.4.50.v20221201 + 9.4.51.v20230217 1.70 0.10 2.10.1 From 7ab4b53e68ecfdebe130c95f6f91880a9d2eac0c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Feb 2023 01:07:31 +0000 Subject: [PATCH 221/657] Bump maven-compiler-plugin from 3.10.1 to 3.11.0 Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.10.1 to 3.11.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.10.1...maven-compiler-plugin-3.11.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 9ded68738e..a2c124ce1e 100644 --- a/pom.xml +++ b/pom.xml @@ -77,7 +77,7 @@ 2.4.21 1.6 3.3.0 - 3.10.1 + 3.11.0 3.0.0-M9 3.0.0-M9 3.0.1 From f987d50c1226fca3f56ffabb79ed6fea3cd4b1bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 8 Mar 2023 16:55:03 +0100 Subject: [PATCH 222/657] Use matrix to test broker alphas (cherry picked from commit aeb3efa4471c6403646b6af301ce72acb6641e22) --- .github/workflows/test-native-image.yml | 5 ++--- ...test-3.11-alpha.yml => test-rabbitmq-alphas.yml} | 13 +++++++------ .../workflows/test-supported-java-versions-5.x.yml | 5 ++--- .../workflows/test-supported-java-versions-main.yml | 5 ++--- .../workflows/{test-3.11-stable.yml => test.yml} | 5 ++--- ci/start-broker.sh | 9 ++++----- ci/start-cluster.sh | 11 +++++------ 7 files changed, 24 insertions(+), 29 deletions(-) rename .github/workflows/{test-3.11-alpha.yml => test-rabbitmq-alphas.yml} (84%) rename .github/workflows/{test-3.11-stable.yml => test.yml} (97%) diff --git a/.github/workflows/test-native-image.yml b/.github/workflows/test-native-image.yml index 0a7fc33e9e..e92fe19b11 100644 --- a/.github/workflows/test-native-image.yml +++ b/.github/workflows/test-native-image.yml @@ -6,8 +6,7 @@ on: workflow_dispatch: env: - RABBITMQ_IMAGE_TAG: 3.11 - RABBITMQ_IMAGE: rabbitmq + RABBITMQ_IMAGE: 'rabbitmq:3.11' jobs: build: @@ -64,4 +63,4 @@ jobs: working-directory: rabbitmq-graal-vm-test run: ./rabbitmq-graal-vm-test-full - 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/.github/workflows/test-3.11-alpha.yml b/.github/workflows/test-rabbitmq-alphas.yml similarity index 84% rename from .github/workflows/test-3.11-alpha.yml rename to .github/workflows/test-rabbitmq-alphas.yml index 20cecc4359..5e981ade59 100644 --- a/.github/workflows/test-3.11-alpha.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -11,14 +11,13 @@ on: - 5.x.x-stable workflow_dispatch: -env: - RABBITMQ_IMAGE_TAG: 3.11 - RABBITMQ_IMAGE: pivotalrabbitmq/rabbitmq-dev - jobs: build: runs-on: ubuntu-22.04 - + strategy: + matrix: + rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v3.11.x-otp-max-bazel', 'pivotalrabbitmq/rabbitmq:v3.12.x-otp-max-bazel' ] + name: Test against ${{ matrix.rabbitmq-image }} steps: - uses: actions/checkout@v3 - name: Checkout tls-gen @@ -38,6 +37,8 @@ jobs: cache: 'maven' - name: Start cluster run: ci/start-cluster.sh + env: + RABBITMQ_IMAGE: ${{ matrix.rabbitmq-image }} - name: Get dependencies run: make deps - name: Test with NIO @@ -57,4 +58,4 @@ jobs: - name: Stop broker A run: docker stop rabbitmq && docker rm rabbitmq - name: Stop broker B - run: docker stop hare && docker rm hare \ No newline at end of file + run: docker stop hare && docker rm hare diff --git a/.github/workflows/test-supported-java-versions-5.x.yml b/.github/workflows/test-supported-java-versions-5.x.yml index 7b24cd3406..5696a4db3d 100644 --- a/.github/workflows/test-supported-java-versions-5.x.yml +++ b/.github/workflows/test-supported-java-versions-5.x.yml @@ -6,8 +6,7 @@ on: workflow_dispatch: env: - RABBITMQ_IMAGE_TAG: 3.11 - RABBITMQ_IMAGE: rabbitmq + RABBITMQ_IMAGE: 'rabbitmq:3.11' jobs: build: @@ -56,4 +55,4 @@ jobs: -Dit.test=ClientTestSuite,FunctionalTestSuite,ServerTestSuite,SslTestSuite \ --no-transfer-progress - 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/.github/workflows/test-supported-java-versions-main.yml b/.github/workflows/test-supported-java-versions-main.yml index 8687dbdd32..6d8b473a09 100644 --- a/.github/workflows/test-supported-java-versions-main.yml +++ b/.github/workflows/test-supported-java-versions-main.yml @@ -6,8 +6,7 @@ on: workflow_dispatch: env: - RABBITMQ_IMAGE_TAG: 3.11 - RABBITMQ_IMAGE: rabbitmq + RABBITMQ_IMAGE: 'rabbitmq:3.11' jobs: build: @@ -54,4 +53,4 @@ jobs: -Dit.test=ClientTestSuite,FunctionalTestSuite,ServerTestSuite,SslTestSuite \ --no-transfer-progress - 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/.github/workflows/test-3.11-stable.yml b/.github/workflows/test.yml similarity index 97% rename from .github/workflows/test-3.11-stable.yml rename to .github/workflows/test.yml index d9f13bbf3e..d5cc0eb029 100644 --- a/.github/workflows/test-3.11-stable.yml +++ b/.github/workflows/test.yml @@ -10,8 +10,7 @@ on: workflow_dispatch: env: - RABBITMQ_IMAGE_TAG: 3.11 - RABBITMQ_IMAGE: rabbitmq + RABBITMQ_IMAGE: 'rabbitmq:3.11' jobs: build: @@ -67,4 +66,4 @@ jobs: env: MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} - MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} \ No newline at end of file + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} diff --git a/ci/start-broker.sh b/ci/start-broker.sh index 17e4987ff4..c178e63784 100755 --- a/ci/start-broker.sh +++ b/ci/start-broker.sh @@ -2,8 +2,7 @@ LOCAL_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -RABBITMQ_IMAGE_TAG=${RABBITMQ_IMAGE_TAG:-3.11} -RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq} +RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:3.11} wait_for_message() { while ! docker logs "$1" | grep -q "$2"; @@ -27,15 +26,15 @@ chmod -R o+r rabbitmq-configuration/tls/* ./mvnw -q clean resources:testResources -Dtest-tls-certs.dir=/etc/rabbitmq/tls cp target/test-classes/rabbit@localhost.config rabbitmq-configuration/rabbitmq.config -echo "Running RabbitMQ ${RABBITMQ_IMAGE}:${RABBITMQ_IMAGE_TAG}" +echo "Running RabbitMQ ${RABBITMQ_IMAGE}" docker rm -f rabbitmq 2>/dev/null || echo "rabbitmq was not running" docker run -d --name rabbitmq \ --network host \ -v "${PWD}"/rabbitmq-configuration:/etc/rabbitmq \ - "${RABBITMQ_IMAGE}":"${RABBITMQ_IMAGE_TAG}" + "${RABBITMQ_IMAGE}" wait_for_message rabbitmq "completed with" docker exec rabbitmq rabbitmq-diagnostics erlang_version -docker exec rabbitmq rabbitmqctl version \ No newline at end of file +docker exec rabbitmq rabbitmqctl version diff --git a/ci/start-cluster.sh b/ci/start-cluster.sh index d397d97212..c1dbac0786 100755 --- a/ci/start-cluster.sh +++ b/ci/start-cluster.sh @@ -2,8 +2,7 @@ LOCAL_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -RABBITMQ_IMAGE_TAG=${RABBITMQ_IMAGE_TAG:-3.11} -RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq} +RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:3.11} wait_for_message() { while ! docker logs "$1" | grep -q "$2"; @@ -28,7 +27,7 @@ chmod -R o+r rabbitmq-configuration/tls/* cp target/test-classes/rabbit@localhost.config rabbitmq-configuration/rabbit@localhost.config cp target/test-classes/hare@localhost.config rabbitmq-configuration/hare@localhost.config -echo "Running RabbitMQ ${RABBITMQ_IMAGE}:${RABBITMQ_IMAGE_TAG}" +echo "Running RabbitMQ ${RABBITMQ_IMAGE}" docker rm -f rabbitmq 2>/dev/null || echo "rabbitmq was not running" docker run -d --name rabbitmq \ @@ -38,7 +37,7 @@ docker run -d --name rabbitmq \ --env RABBITMQ_NODENAME=rabbit@$(hostname) \ --env RABBITMQ_NODE_PORT=5672 \ --env RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-setcookie do-not-do-this-in-production" \ - "${RABBITMQ_IMAGE}":"${RABBITMQ_IMAGE_TAG}" + "${RABBITMQ_IMAGE}" # for CLI commands to share the same cookie docker exec rabbitmq bash -c "echo 'do-not-do-this-in-production' > /var/lib/rabbitmq/.erlang.cookie" @@ -53,7 +52,7 @@ docker run -d --name hare \ --env RABBITMQ_NODENAME=hare@$(hostname) \ --env RABBITMQ_NODE_PORT=5673 \ --env RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-setcookie do-not-do-this-in-production" \ - "${RABBITMQ_IMAGE}":"${RABBITMQ_IMAGE_TAG}" + "${RABBITMQ_IMAGE}" # for CLI commands to share the same cookie docker exec hare bash -c "echo 'do-not-do-this-in-production' > /var/lib/rabbitmq/.erlang.cookie" @@ -77,4 +76,4 @@ docker exec hare rabbitmqctl --node hare@$(hostname) await_startup docker exec rabbitmq rabbitmq-diagnostics --node rabbit@$(hostname) erlang_version docker exec rabbitmq rabbitmqctl --node rabbit@$(hostname) version docker exec rabbitmq rabbitmqctl --node rabbit@$(hostname) status -docker exec rabbitmq rabbitmqctl --node rabbit@$(hostname) cluster_status \ No newline at end of file +docker exec rabbitmq rabbitmqctl --node rabbit@$(hostname) cluster_status From 4aa2552f4126353158d8e92b1f814f7d8fc54d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 8 Mar 2023 16:57:19 +0100 Subject: [PATCH 223/657] Change GHA job label (cherry picked from commit 04b02d2fdd6f46500fd2fcc3ed034716cbfdc672) --- .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 5e981ade59..2e25fd5e00 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -1,4 +1,4 @@ -name: Test against RabbitMQ 3.11 alpha +name: Test against RabbitMQ alphas on: schedule: From 99bd44db700201b2ecaaff111d575ad2c1923c88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Mar 2023 01:15:08 +0000 Subject: [PATCH 224/657] Bump mockito-core from 5.1.1 to 5.2.0 Bumps [mockito-core](https://github.com/mockito/mockito) from 5.1.1 to 5.2.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.1.1...v5.2.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 e32a6648b6..fbc404f982 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.14.1 1.2.11 5.9.2 - 5.1.1 + 5.2.0 3.24.2 9.4.51.v20230217 1.70 From 745fef4729ac229b0ca1b99a9a978d782df49aa8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 01:38:28 +0000 Subject: [PATCH 225/657] Bump opentelemetry.version from 1.23.1 to 1.24.0 Bumps `opentelemetry.version` from 1.23.1 to 1.24.0. Updates `opentelemetry-api` from 1.23.1 to 1.24.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.23.1...v1.24.0) Updates `opentelemetry-sdk-testing` from 1.23.1 to 1.24.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.23.1...v1.24.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 fbc404f982..d621159eb1 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 1.7.36 4.2.17 1.10.4 - 1.23.1 + 1.24.0 2.14.1 1.2.11 5.9.2 From 5e189f9a3b2d780c17e5c7c00b515fd2c5f50150 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Mar 2023 01:02:40 +0000 Subject: [PATCH 226/657] Bump micrometer-core from 1.10.4 to 1.10.5 Bumps [micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.10.4 to 1.10.5. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.10.4...v1.10.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 d621159eb1..8c8100641a 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.7.36 4.2.17 - 1.10.4 + 1.10.5 1.24.0 2.14.1 1.2.11 From 3d8b27ae0e8772eeb29cc63ced37a2e238a042aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Mar 2023 01:02:51 +0000 Subject: [PATCH 227/657] Bump maven-surefire-plugin from 3.0.0-M9 to 3.0.0 Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M9 to 3.0.0. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M9...surefire-3.0.0) --- 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 d621159eb1..f2db7c2f2c 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 1.6 3.3.0 3.11.0 - 3.0.0-M9 + 3.0.0 3.0.0-M9 3.0.1 3.3.0 From 47d357f3a6a94ba3860f64f82955475c3e7bac67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Mar 2023 01:02:57 +0000 Subject: [PATCH 228/657] Bump keytool-maven-plugin from 1.6 to 1.7 Bumps [keytool-maven-plugin](https://github.com/mojohaus/keytool) from 1.6 to 1.7. - [Release notes](https://github.com/mojohaus/keytool/releases) - [Commits](https://github.com/mojohaus/keytool/compare/keytool-1.6...keytool-1.7) --- updated-dependencies: - dependency-name: org.codehaus.mojo:keytool-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 d621159eb1..3e9039d879 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ 3.2.1 2.1.1 2.4.21 - 1.6 + 1.7 3.3.0 3.11.0 3.0.0-M9 From a68efe5909be0c2891856cac5d3c308658de52e6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Mar 2023 03:18:01 +0000 Subject: [PATCH 229/657] Bump maven-failsafe-plugin from 3.0.0-M9 to 3.0.0 Bumps [maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M9 to 3.0.0. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M9...surefire-3.0.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-failsafe-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 a7fe2eef21..3612d7275c 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 3.3.0 3.11.0 3.0.0 - 3.0.0-M9 + 3.0.0 3.0.1 3.3.0 5.1.8 From 34e9c8c73ac4d9c3f002aded8076ebf08fe4afd7 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Fri, 17 Mar 2023 07:56:50 +0000 Subject: [PATCH 230/657] [maven-release-plugin] prepare release v5.17.0.RC2 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1306a526f3..37c0c935d9 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.17.0-SNAPSHOT + 5.17.0.RC2 jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git - HEAD + v5.17.0.RC2 From eff0aa844388fa6ccc2cf6940ec6cf99b1c9ae3b Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Fri, 17 Mar 2023 07:56:51 +0000 Subject: [PATCH 231/657] [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 37c0c935d9..1306a526f3 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.17.0.RC2 + 5.17.0-SNAPSHOT jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git - v5.17.0.RC2 + HEAD From 95969839854bdfc1b9d5e1fbf27e720ecb901039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 17 Mar 2023 09:01:25 +0100 Subject: [PATCH 232/657] Set release version to 5.17.0.RC3 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index d19addd36d..bcfd76826f 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.17.0.RC2" +RELEASE_VERSION="5.17.0.RC3" DEVELOPMENT_VERSION="5.17.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From a8c9c02fe9b009cfc64f7723127cc8b0647ed3d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 01:35:16 +0000 Subject: [PATCH 233/657] Bump metrics-core from 4.2.17 to 4.2.18 Bumps [metrics-core](https://github.com/dropwizard/metrics) from 4.2.17 to 4.2.18. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.17...v4.2.18) --- 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 1306a526f3..64ab10479c 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ UTF-8 1.7.36 - 4.2.17 + 4.2.18 1.10.5 1.24.0 2.14.1 From 98a0b45cb9829abed3d744d50855ff069c0202e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 20 Mar 2023 09:05:08 +0100 Subject: [PATCH 234/657] Back to metrics 4.2.17 No dependency upgrades during RC phase. --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 64ab10479c..1306a526f3 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ UTF-8 1.7.36 - 4.2.18 + 4.2.17 1.10.5 1.24.0 2.14.1 From be54463e1558f1961db4144e9d151aaf3872f145 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 01:01:21 +0000 Subject: [PATCH 235/657] Bump maven-release-plugin from 2.5.3 to 3.0.0 Bumps [maven-release-plugin](https://github.com/apache/maven-release) from 2.5.3 to 3.0.0. - [Release notes](https://github.com/apache/maven-release/releases) - [Commits](https://github.com/apache/maven-release/compare/maven-release-2.5.3...maven-release-3.0.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-release-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 1306a526f3..a317e7440a 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.10.1 3.5.0 - 2.5.3 + 3.0.0 2.15.0 3.3.0 3.2.1 From f88bc036602e2d1429a6ea967a265c90d193a381 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 01:01:32 +0000 Subject: [PATCH 236/657] Bump metrics-core from 4.2.17 to 4.2.18 Bumps [metrics-core](https://github.com/dropwizard/metrics) from 4.2.17 to 4.2.18. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.17...v4.2.18) --- 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 1306a526f3..64ab10479c 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ UTF-8 1.7.36 - 4.2.17 + 4.2.18 1.10.5 1.24.0 2.14.1 From 79007637ee1e7fae1f181291add5a083e8694b2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 21 Mar 2023 17:22:06 +0100 Subject: [PATCH 237/657] Set release version to 5.17.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index bcfd76826f..71321492ca 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.17.0.RC3" -DEVELOPMENT_VERSION="5.17.0-SNAPSHOT" +RELEASE_VERSION="5.17.0" +DEVELOPMENT_VERSION="5.18.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From adf79b6f6e4cfac48be6edf4ed6690abea7ac60d Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Tue, 21 Mar 2023 16:24:30 +0000 Subject: [PATCH 238/657] [maven-release-plugin] prepare release v5.17.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a317e7440a..ef12e84d72 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.17.0-SNAPSHOT + 5.17.0 jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git - HEAD + v5.17.0 From 3e9405ce2528bac8d04f5af208908c78d33d8508 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Tue, 21 Mar 2023 16:24:32 +0000 Subject: [PATCH 239/657] [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 ef12e84d72..5de75d16f1 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.17.0 + 5.18.0-SNAPSHOT jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git - v5.17.0 + HEAD From bdf28013e86aa3bc52c1f360a70f857c19472d18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 21 Mar 2023 17:40:31 +0100 Subject: [PATCH 240/657] Set release version to 5.18.0.RC1 --- release-versions.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release-versions.txt b/release-versions.txt index 71321492ca..5189a6d325 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.17.0" +RELEASE_VERSION="5.18.0.RC1" DEVELOPMENT_VERSION="5.18.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From d1b2dfa7ce1731756e157768e23b8a919c4deff3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 01:02:10 +0000 Subject: [PATCH 241/657] Bump logback-classic from 1.2.11 to 1.2.12 Bumps [logback-classic](https://github.com/qos-ch/logback) from 1.2.11 to 1.2.12. - [Release notes](https://github.com/qos-ch/logback/releases) - [Commits](https://github.com/qos-ch/logback/compare/v_1.2.11...v_1.2.12) --- updated-dependencies: - dependency-name: ch.qos.logback:logback-classic 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 5b620392b6..04cfa2f8ff 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 1.10.5 1.24.0 2.14.1 - 1.2.11 + 1.2.12 5.9.2 5.2.0 3.24.2 From 1289fd9e0c5e80f38b74c719bbbd314113c84e68 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 01:39:00 +0000 Subject: [PATCH 242/657] Bump maven-resources-plugin from 3.3.0 to 3.3.1 Bumps [maven-resources-plugin](https://github.com/apache/maven-resources-plugin) from 3.3.0 to 3.3.1. - [Release notes](https://github.com/apache/maven-resources-plugin/releases) - [Commits](https://github.com/apache/maven-resources-plugin/compare/maven-resources-plugin-3.3.0...maven-resources-plugin-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-resources-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 04cfa2f8ff..12a0aa9e84 100644 --- a/pom.xml +++ b/pom.xml @@ -71,7 +71,7 @@ 3.5.0 3.0.0 2.15.0 - 3.3.0 + 3.3.1 3.2.1 2.1.1 2.4.21 From 7cbf33448019ad293afd51602a1ccb8950ec6ec3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 01:14:31 +0000 Subject: [PATCH 243/657] Bump opentelemetry.version from 1.24.0 to 1.25.0 Bumps `opentelemetry.version` from 1.24.0 to 1.25.0. Updates `opentelemetry-api` from 1.24.0 to 1.25.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.24.0...v1.25.0) Updates `opentelemetry-sdk-testing` from 1.24.0 to 1.25.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.24.0...v1.25.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 12a0aa9e84..1da4610f93 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 1.7.36 4.2.18 1.10.5 - 1.24.0 + 1.25.0 2.14.1 1.2.12 5.9.2 From fabdea820998699c10481e10a103d7eb271c08de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Apr 2023 01:00:52 +0000 Subject: [PATCH 244/657] Bump micrometer-core from 1.10.5 to 1.10.6 Bumps [micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.10.5 to 1.10.6. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.10.5...v1.10.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 1da4610f93..218d053a43 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.7.36 4.2.18 - 1.10.5 + 1.10.6 1.25.0 2.14.1 1.2.12 From 6c04eacfe19b26217797b2a7b34aed9f4a430585 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 01:05:33 +0000 Subject: [PATCH 245/657] Bump mockito-core from 5.2.0 to 5.3.0 Bumps [mockito-core](https://github.com/mockito/mockito) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.2.0...v5.3.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 218d053a43..56b0391650 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.14.1 1.2.12 5.9.2 - 5.2.0 + 5.3.0 3.24.2 9.4.51.v20230217 1.70 From 6ab2885afa6d314aa8865f640696bb8246715b02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 01:15:25 +0000 Subject: [PATCH 246/657] Bump jackson-databind from 2.14.1 to 2.15.0 Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.14.1 to 2.15.0. - [Release notes](https://github.com/FasterXML/jackson/releases) - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind 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 56b0391650..61899cd913 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ 4.2.18 1.10.6 1.25.0 - 2.14.1 + 2.15.0 1.2.12 5.9.2 5.3.0 From e6cf599a0ad17ae4a843ac8396dffdf6e33cc10a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 01:15:46 +0000 Subject: [PATCH 247/657] Bump mockito-core from 5.3.0 to 5.3.1 Bumps [mockito-core](https://github.com/mockito/mockito) from 5.3.0 to 5.3.1. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.3.0...v5.3.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 56b0391650..0d335d9f7c 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.14.1 1.2.12 5.9.2 - 5.3.0 + 5.3.1 3.24.2 9.4.51.v20230217 1.70 From 57abf40cb1ea0642fcfe2dd2e7defe27ffaf35c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Apr 2023 01:00:45 +0000 Subject: [PATCH 248/657] Bump junit-bom from 5.9.2 to 5.9.3 Bumps [junit-bom](https://github.com/junit-team/junit5) from 5.9.2 to 5.9.3. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.2...r5.9.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 279b7bb5fa..b18428e603 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.25.0 2.15.0 1.2.12 - 5.9.2 + 5.9.3 5.3.1 3.24.2 9.4.51.v20230217 From 1074496a4c157b9f2112a2c6a7ee45e6fcf427c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 01:10:04 +0000 Subject: [PATCH 249/657] Bump opentelemetry.version from 1.25.0 to 1.26.0 Bumps `opentelemetry.version` from 1.25.0 to 1.26.0. Updates `opentelemetry-api` from 1.25.0 to 1.26.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.25.0...v1.26.0) Updates `opentelemetry-sdk-testing` from 1.25.0 to 1.26.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.25.0...v1.26.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 b18428e603..61f097147a 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 1.7.36 4.2.18 1.10.6 - 1.25.0 + 1.26.0 2.15.0 1.2.12 5.9.3 From e99d234bd415b913e11bba7447487201e4269af8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 01:10:19 +0000 Subject: [PATCH 250/657] Bump maven-failsafe-plugin from 3.0.0 to 3.1.0 Bumps [maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0...surefire-3.1.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-failsafe-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 b18428e603..c34cd1ecbf 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 3.3.0 3.11.0 3.0.0 - 3.0.0 + 3.1.0 3.0.1 3.3.0 5.1.8 From cd7fc9d1559201a89259f9e29f6094bd5fe0c6e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 05:33:08 +0000 Subject: [PATCH 251/657] Bump maven-surefire-plugin from 3.0.0 to 3.1.0 Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0...surefire-3.1.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 c34cd1ecbf..0e6a22d3b9 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 1.7 3.3.0 3.11.0 - 3.0.0 + 3.1.0 3.1.0 3.0.1 3.3.0 From 7004e07435fed97ef7b83adc3962cd38d7cff9b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 05:33:20 +0000 Subject: [PATCH 252/657] Bump maven-gpg-plugin from 3.0.1 to 3.1.0 Bumps [maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.0.1 to 3.1.0. - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.0.1...maven-gpg-plugin-3.1.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 c34cd1ecbf..5f302c9af3 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ 3.11.0 3.0.0 3.1.0 - 3.0.1 + 3.1.0 3.3.0 5.1.8 0.0.6 From 2cbc200a0d7b294447e90436eb69869d170f0ae3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 01:15:28 +0000 Subject: [PATCH 253/657] Bump micrometer-core from 1.10.6 to 1.11.0 Bumps [micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.10.6 to 1.11.0. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.10.6...v1.11.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 3c8f4ac7ed..2fdc6cae56 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.7.36 4.2.18 - 1.10.6 + 1.11.0 1.26.0 2.15.0 1.2.12 From 5563b7edda710ff8dc279af117b71e3aa4e33dfc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 May 2023 01:10:59 +0000 Subject: [PATCH 254/657] Bump build-helper-maven-plugin from 3.3.0 to 3.4.0 Bumps [build-helper-maven-plugin](https://github.com/mojohaus/build-helper-maven-plugin) from 3.3.0 to 3.4.0. - [Release notes](https://github.com/mojohaus/build-helper-maven-plugin/releases) - [Commits](https://github.com/mojohaus/build-helper-maven-plugin/compare/build-helper-maven-plugin-3.3.0...3.4.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:build-helper-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 2fdc6cae56..a3775ebd07 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ 2.1.1 2.4.21 1.7 - 3.3.0 + 3.4.0 3.11.0 3.1.0 3.1.0 From 49c57cfd24e5a2e1927b91e030b56c1d912ee081 Mon Sep 17 00:00:00 2001 From: Johannes Hahn Date: Mon, 15 May 2023 17:55:24 +0200 Subject: [PATCH 255/657] make RpcClient implement java.io.Closeable (cherry picked from commit 75a94f6374d3ca9ec45322dcfe82df5576a1efd5) --- src/main/java/com/rabbitmq/client/RpcClient.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/RpcClient.java b/src/main/java/com/rabbitmq/client/RpcClient.java index 9d42e60d09..1566662ac7 100644 --- a/src/main/java/com/rabbitmq/client/RpcClient.java +++ b/src/main/java/com/rabbitmq/client/RpcClient.java @@ -18,6 +18,7 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.Closeable; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.EOFException; @@ -44,7 +45,7 @@ * It simply provides a mechanism for sending a message to an exchange with a given routing key, * and waiting for a response. */ -public class RpcClient { +public class RpcClient implements Closeable { private static final Logger LOGGER = LoggerFactory.getLogger(RpcClient.class); @@ -236,10 +237,13 @@ public void checkConsumer() throws IOException { * Public API - cancels the consumer, thus deleting the temporary queue, and marks the RpcClient as closed. * @throws IOException if an error is encountered */ + @Override public void close() throws IOException { if (_consumer != null) { - _channel.basicCancel(_consumer.getConsumerTag()); + final String consumerTag = _consumer.getConsumerTag(); + // set it null before calling basicCancel to make this method idempotent in case of IOException _consumer = null; + _channel.basicCancel(consumerTag); } } From 22a21bf3a7f179168994efd4e511a235f237b0a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 16 May 2023 10:37:04 +0200 Subject: [PATCH 256/657] Use atomic boolean to track state of RpcClient Instead of using the consumer property. Avoids race conditions during closing. References #1033 (cherry picked from commit 22530174398460ef8bd87d431c8ec28aeea8df7c) --- .../java/com/rabbitmq/client/RpcClient.java | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/RpcClient.java b/src/main/java/com/rabbitmq/client/RpcClient.java index 1566662ac7..793c8aa99c 100644 --- a/src/main/java/com/rabbitmq/client/RpcClient.java +++ b/src/main/java/com/rabbitmq/client/RpcClient.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -13,12 +13,10 @@ // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.Closeable; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.EOFException; @@ -28,6 +26,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Function; import java.util.function.Supplier; @@ -45,7 +44,7 @@ * It simply provides a mechanism for sending a message to an exchange with a given routing key, * and waiting for a response. */ -public class RpcClient implements Closeable { +public class RpcClient implements AutoCloseable { private static final Logger LOGGER = LoggerFactory.getLogger(RpcClient.class); @@ -63,6 +62,8 @@ public class RpcClient implements Closeable { protected final static int NO_TIMEOUT = -1; /** Whether to publish RPC requests with the mandatory flag or not. */ private final boolean _useMandatory; + /** closed flag */ + private final AtomicBoolean closed = new AtomicBoolean(false); public final static Function DEFAULT_REPLY_HANDLER = reply -> { if (reply instanceof ShutdownSignalException) { @@ -96,7 +97,7 @@ public class RpcClient implements Closeable { private String lastCorrelationId = "0"; /** Consumer attached to our reply queue */ - private DefaultConsumer _consumer; + private final DefaultConsumer _consumer; /** * Construct a {@link RpcClient} with the passed-in {@link RpcClientParams}. @@ -227,8 +228,8 @@ public RpcClient(Channel channel, String exchange, String routingKey, int timeou * Private API - ensures the RpcClient is correctly open. * @throws IOException if an error is encountered */ - public void checkConsumer() throws IOException { - if (_consumer == null) { + private void checkNotClosed() throws IOException { + if (this.closed.get()) { throw new EOFException("RpcClient is closed"); } } @@ -239,11 +240,8 @@ public void checkConsumer() throws IOException { */ @Override public void close() throws IOException { - if (_consumer != null) { - final String consumerTag = _consumer.getConsumerTag(); - // set it null before calling basicCancel to make this method idempotent in case of IOException - _consumer = null; - _channel.basicCancel(consumerTag); + if (this.closed.compareAndSet(false, true)) { + _channel.basicCancel(_consumer.getConsumerTag()); } } @@ -261,7 +259,7 @@ public void handleShutdownSignal(String consumerTag, for (Entry> entry : _continuationMap.entrySet()) { entry.getValue().set(signal); } - _consumer = null; + closed.set(true); } } @@ -269,8 +267,7 @@ public void handleShutdownSignal(String consumerTag, public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, - byte[] body) - throws IOException { + byte[] body) { synchronized (_continuationMap) { String replyId = properties.getCorrelationId(); BlockingCell blocker =_continuationMap.remove(replyId); @@ -301,7 +298,7 @@ public Response doCall(AMQP.BasicProperties props, byte[] message) public Response doCall(AMQP.BasicProperties props, byte[] message, int timeout) throws IOException, ShutdownSignalException, TimeoutException { - checkConsumer(); + checkNotClosed(); BlockingCell k = new BlockingCell(); String replyId; synchronized (_continuationMap) { From f66be3151c36cec653092fa7eb3624980bbb5e65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 May 2023 01:01:35 +0000 Subject: [PATCH 257/657] Bump jackson-databind from 2.15.0 to 2.15.1 Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.15.0 to 2.15.1. - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind 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 a3775ebd07..9c87b6be91 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ 4.2.18 1.11.0 1.26.0 - 2.15.0 + 2.15.1 1.2.12 5.9.3 5.3.1 From f629c2f58e3cd04856c903d7f0d8a455650e70d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 May 2023 01:01:50 +0000 Subject: [PATCH 258/657] Bump maven-bundle-plugin from 5.1.8 to 5.1.9 Bumps maven-bundle-plugin from 5.1.8 to 5.1.9. --- updated-dependencies: - dependency-name: org.apache.felix:maven-bundle-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 9c87b6be91..ea0089b0cd 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.1.0 3.1.0 3.3.0 - 5.1.8 + 5.1.9 0.0.6 1.6.13 1.11 From 172a3e2312d34b92e5325d525e66ab520b63ecf3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 01:29:50 +0000 Subject: [PATCH 259/657] Bump maven-source-plugin from 3.2.1 to 3.3.0 Bumps [maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.2.1 to 3.3.0. - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.2.1...maven-source-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-source-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 ea0089b0cd..6331fcdabe 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ 3.0.0 2.15.0 3.3.1 - 3.2.1 + 3.3.0 2.1.1 2.4.21 1.7 From 48e03a6986428cbfc2c894b95b19defd9a4e3c78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 May 2023 01:01:18 +0000 Subject: [PATCH 260/657] Bump jackson-databind from 2.15.1 to 2.15.2 Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.15.1 to 2.15.2. - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind 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 6331fcdabe..0afe11a2ed 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ 4.2.18 1.11.0 1.26.0 - 2.15.1 + 2.15.2 1.2.12 5.9.3 5.3.1 From cae02d934eb441fd3dcb7b8aade4f9094a44ed22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 01:11:11 +0000 Subject: [PATCH 261/657] Bump metrics-core from 4.2.18 to 4.2.19 Bumps [metrics-core](https://github.com/dropwizard/metrics) from 4.2.18 to 4.2.19. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.18...v4.2.19) --- 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 0afe11a2ed..0983ac7121 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ UTF-8 1.7.36 - 4.2.18 + 4.2.19 1.11.0 1.26.0 2.15.2 From d1143722e7d8d80d16342cd77e8ea87cd4a58374 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 01:26:48 +0000 Subject: [PATCH 262/657] Bump maven-release-plugin from 3.0.0 to 3.0.1 Bumps [maven-release-plugin](https://github.com/apache/maven-release) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/apache/maven-release/releases) - [Commits](https://github.com/apache/maven-release/compare/maven-release-3.0.0...maven-release-3.0.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-release-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 0983ac7121..67d2016853 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.10.1 3.5.0 - 3.0.0 + 3.0.1 2.15.0 3.3.1 3.3.0 From 01f217d2b5c9becc4a5a84925f552afa8499814f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 5 Jun 2023 14:54:26 +0200 Subject: [PATCH 263/657] Use RabbitMQ 3.12 in CI (cherry picked from commit 00ad6eb4fc32edb21ee8d55ea5f7743623af762b) --- .github/workflows/test-native-image.yml | 3 --- .github/workflows/test-rabbitmq-alphas.yml | 2 +- .github/workflows/test-supported-java-versions-5.x.yml | 3 --- .github/workflows/test-supported-java-versions-main.yml | 3 --- .github/workflows/test.yml | 5 +---- ci/start-broker.sh | 2 +- ci/start-cluster.sh | 2 +- 7 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-native-image.yml b/.github/workflows/test-native-image.yml index e92fe19b11..3d43fab487 100644 --- a/.github/workflows/test-native-image.yml +++ b/.github/workflows/test-native-image.yml @@ -5,9 +5,6 @@ on: - cron: '0 4 ? * SUN,THU' workflow_dispatch: -env: - RABBITMQ_IMAGE: 'rabbitmq:3.11' - jobs: build: runs-on: ubuntu-22.04 diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index 2e25fd5e00..464f17eb60 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v3.11.x-otp-max-bazel', 'pivotalrabbitmq/rabbitmq:v3.12.x-otp-max-bazel' ] + rabbitmq-image: [ 'pivotalrabbitmq/rabbitmq:v3.12.x-otp-max-bazel', 'pivotalrabbitmq/rabbitmq:main-otp-max-bazel' ] name: Test against ${{ matrix.rabbitmq-image }} steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/test-supported-java-versions-5.x.yml b/.github/workflows/test-supported-java-versions-5.x.yml index 5696a4db3d..2a2af46eec 100644 --- a/.github/workflows/test-supported-java-versions-5.x.yml +++ b/.github/workflows/test-supported-java-versions-5.x.yml @@ -5,9 +5,6 @@ on: - cron: '0 4 ? * SUN,THU' workflow_dispatch: -env: - RABBITMQ_IMAGE: 'rabbitmq:3.11' - jobs: build: runs-on: ubuntu-22.04 diff --git a/.github/workflows/test-supported-java-versions-main.yml b/.github/workflows/test-supported-java-versions-main.yml index 6d8b473a09..425c03faf3 100644 --- a/.github/workflows/test-supported-java-versions-main.yml +++ b/.github/workflows/test-supported-java-versions-main.yml @@ -5,9 +5,6 @@ on: - cron: '0 4 ? * SUN,THU' workflow_dispatch: -env: - RABBITMQ_IMAGE: 'rabbitmq:3.11' - jobs: build: runs-on: ubuntu-22.04 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d5cc0eb029..76113e08b7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Test against RabbitMQ 3.11 stable +name: Test against RabbitMQ 3.12 stable on: pull_request: @@ -9,9 +9,6 @@ on: - 5.x.x-stable workflow_dispatch: -env: - RABBITMQ_IMAGE: 'rabbitmq:3.11' - jobs: build: runs-on: ubuntu-22.04 diff --git a/ci/start-broker.sh b/ci/start-broker.sh index c178e63784..8ad81bb837 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.11} +RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:3.12} wait_for_message() { while ! docker logs "$1" | grep -q "$2"; diff --git a/ci/start-cluster.sh b/ci/start-cluster.sh index c1dbac0786..f855daaf93 100755 --- a/ci/start-cluster.sh +++ b/ci/start-cluster.sh @@ -2,7 +2,7 @@ LOCAL_SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:3.11} +RABBITMQ_IMAGE=${RABBITMQ_IMAGE:-rabbitmq:3.12} wait_for_message() { while ! docker logs "$1" | grep -q "$2"; From 3eeeeced06d8d71d7d4c3818266b1b05874596c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Jun 2023 01:01:14 +0000 Subject: [PATCH 264/657] Bump maven-failsafe-plugin from 3.1.0 to 3.1.2 Bumps [maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.1.0 to 3.1.2. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.1.0...surefire-3.1.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-failsafe-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 67d2016853..70cf83556e 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 3.4.0 3.11.0 3.1.0 - 3.1.0 + 3.1.2 3.1.0 3.3.0 5.1.9 From 67acc2bd0d4b856f16343ce7f3119fa283e2af23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Jun 2023 01:01:28 +0000 Subject: [PATCH 265/657] Bump versions-maven-plugin from 2.15.0 to 2.16.0 Bumps [versions-maven-plugin](https://github.com/mojohaus/versions) from 2.15.0 to 2.16.0. - [Release notes](https://github.com/mojohaus/versions/releases) - [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions/compare/2.15.0...2.16.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-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 67d2016853..1f168aad27 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 3.5.0 3.0.1 - 2.15.0 + 2.16.0 3.3.1 3.3.0 2.1.1 From e4f89e03df349efb17ede62920821a765566f186 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Jun 2023 05:56:02 +0000 Subject: [PATCH 266/657] Bump maven-surefire-plugin from 3.1.0 to 3.1.2 Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.1.0 to 3.1.2. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.1.0...surefire-3.1.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 854fb00355..7f4d7b5e76 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ 1.7 3.4.0 3.11.0 - 3.1.0 + 3.1.2 3.1.2 3.1.0 3.3.0 From ef0b52212931c03590ed53d7401a17a33a3fea93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jun 2023 01:38:54 +0000 Subject: [PATCH 267/657] Bump opentelemetry.version from 1.26.0 to 1.27.0 Bumps `opentelemetry.version` from 1.26.0 to 1.27.0. Updates `opentelemetry-api` from 1.26.0 to 1.27.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.26.0...v1.27.0) Updates `opentelemetry-sdk-testing` from 1.26.0 to 1.27.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.26.0...v1.27.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 7f4d7b5e76..ea05dbf422 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 1.7.36 4.2.19 1.11.0 - 1.26.0 + 1.27.0 2.15.2 1.2.12 5.9.3 From 671efdcb1adbed4242ce0c954874eeef0d3de0ad Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Jun 2023 01:00:25 +0000 Subject: [PATCH 268/657] Bump micrometer-core from 1.11.0 to 1.11.1 Bumps [micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.11.0 to 1.11.1. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.11.0...v1.11.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 ea05dbf422..c322e0c5d5 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.7.36 4.2.19 - 1.11.0 + 1.11.1 1.27.0 2.15.2 1.2.12 From 0dc9ea2e464158685cd206e35cb52105c156a64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Faria?= Date: Thu, 8 Jun 2023 19:47:08 +0100 Subject: [PATCH 269/657] Do not confirmSelect more than once per channel In order to avoid unnecessary blocking RPC calls and conform to best practices, the Channel now checks if it is already activated confirm mode before sending a confirm.select RPC call. If confirm mode is already activated, calling confirmSelect() again returns immediately without sending an RPC call. Closes #1056 (cherry picked from commit 7253c941d96a8057c6b32f3ff45d3e1c7fac0164) Conflicts: src/test/java/com/rabbitmq/client/test/ChannelNTest.java --- .../com/rabbitmq/client/impl/ChannelN.java | 11 +++++- .../rabbitmq/client/test/ChannelNTest.java | 35 ++++++++++++++++--- 2 files changed, 40 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelN.java b/src/main/java/com/rabbitmq/client/impl/ChannelN.java index 3c97d339e8..0907d6c983 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelN.java @@ -82,6 +82,9 @@ public class ChannelN extends AMQChannel implements com.rabbitmq.client.Channel private final SortedSet unconfirmedSet = Collections.synchronizedSortedSet(new TreeSet()); + /** Whether the confirm select method has been successfully activated */ + private boolean confirmSelectActivated = false; + /** Whether any nacks have been received since the last waitForConfirms(). */ private volatile boolean onlyAcksReceived = true; @@ -1553,10 +1556,16 @@ public Tx.RollbackOk txRollback() public Confirm.SelectOk confirmSelect() throws IOException { + if (confirmSelectActivated) { + return new Confirm.SelectOk(); + } + if (nextPublishSeqNo == 0) nextPublishSeqNo = 1; - return (Confirm.SelectOk) + Confirm.SelectOk result = (Confirm.SelectOk) exnWrappingRpc(new Confirm.Select(false)).getMethod(); + confirmSelectActivated = true; + return result; } /** Public API - {@inheritDoc} */ diff --git a/src/test/java/com/rabbitmq/client/test/ChannelNTest.java b/src/test/java/com/rabbitmq/client/test/ChannelNTest.java index 448f94ee02..f557e5f3d2 100644 --- a/src/test/java/com/rabbitmq/client/test/ChannelNTest.java +++ b/src/test/java/com/rabbitmq/client/test/ChannelNTest.java @@ -15,7 +15,9 @@ package com.rabbitmq.client.test; +import com.rabbitmq.client.AMQP;import com.rabbitmq.client.Command; import com.rabbitmq.client.Method; +import com.rabbitmq.client.TrafficListener; import com.rabbitmq.client.impl.*; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -23,13 +25,12 @@ import org.mockito.Mockito; import java.io.IOException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.atomic.AtomicReference; -import java.util.stream.Stream; +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicReference;import java.util.stream.Stream; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class ChannelNTest { @@ -67,7 +68,7 @@ public void callingBasicCancelForUnknownConsumerThrowsException() throws Excepti @Test public void qosShouldBeUnsignedShort() { AMQConnection connection = Mockito.mock(AMQConnection.class); - AtomicReference qosMethod = new AtomicReference<>(); + AtomicReference qosMethod = new AtomicReference<>(); ChannelN channel = new ChannelN(connection, 1, consumerWorkService) { @Override public AMQCommand exnWrappingRpc(Method m) { @@ -106,6 +107,30 @@ public TestConfig(int value, Consumer call, int expected) { }); } + @Test + public void confirmSelectOnlySendsRPCCallOnce() throws Exception { + AMQConnection connection = Mockito.mock(AMQConnection.class); + TrafficListener trafficListener = Mockito.mock(TrafficListener.class); + + Mockito.when(connection.getTrafficListener()).thenReturn(trafficListener); + + ChannelN channel = new ChannelN(connection, 1, consumerWorkService); + + Future future = executorService.submit(() -> { + try { + return channel.confirmSelect(); + } catch (IOException e) { + throw new RuntimeException(e); + } + }); + + channel.handleCompleteInboundCommand(new AMQCommand(new AMQImpl.Confirm.SelectOk())); + + assertNotNull(future.get(1, TimeUnit.SECONDS)); + assertNotNull(channel.confirmSelect()); + Mockito.verify(trafficListener, Mockito.times(1)).write(Mockito.any(Command.class)); + } + interface Consumer { void apply(int value) throws Exception; From 83cf551fb0142f7a5d042bd54e0cf3c1e47ed419 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Faria?= Date: Fri, 9 Jun 2023 10:05:47 +0100 Subject: [PATCH 270/657] Fix flaky test (cherry picked from commit f5c26a7975b22a8b73cbde98be9b8cb63c233275) Conflicts: src/test/java/com/rabbitmq/client/test/ChannelNTest.java --- .../rabbitmq/client/test/ChannelNTest.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/test/ChannelNTest.java b/src/test/java/com/rabbitmq/client/test/ChannelNTest.java index f557e5f3d2..372acbc183 100644 --- a/src/test/java/com/rabbitmq/client/test/ChannelNTest.java +++ b/src/test/java/com/rabbitmq/client/test/ChannelNTest.java @@ -25,10 +25,12 @@ import org.mockito.Mockito; import java.io.IOException; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicReference;import java.util.stream.Stream; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Stream; import static org.assertj.core.api.Assertions.assertThat; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -116,17 +118,16 @@ public void confirmSelectOnlySendsRPCCallOnce() throws Exception { ChannelN channel = new ChannelN(connection, 1, consumerWorkService); - Future future = executorService.submit(() -> { + new Thread(() -> { try { - return channel.confirmSelect(); - } catch (IOException e) { + Thread.sleep(15); + channel.handleCompleteInboundCommand(new AMQCommand(new AMQImpl.Confirm.SelectOk())); + } catch (Exception e) { throw new RuntimeException(e); } - }); + }).start(); - channel.handleCompleteInboundCommand(new AMQCommand(new AMQImpl.Confirm.SelectOk())); - - assertNotNull(future.get(1, TimeUnit.SECONDS)); + assertNotNull(channel.confirmSelect()); assertNotNull(channel.confirmSelect()); Mockito.verify(trafficListener, Mockito.times(1)).write(Mockito.any(Command.class)); } From 714aae602dcae6cb4b53cadf009323ebac313cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 15 Jun 2023 10:14:02 +0200 Subject: [PATCH 271/657] Add max inbound message size to ConnectionFactory To avoid OOM with a very large message. The default value is 64 MiB. Fixes #1062 (cherry picked from commit 9ed45fde52224ec74fc523321efdf9a157d5cfca) --- .../rabbitmq/client/ConnectionFactory.java | 33 ++++++- .../com/rabbitmq/client/impl/AMQChannel.java | 9 +- .../com/rabbitmq/client/impl/AMQCommand.java | 24 ++++- .../rabbitmq/client/impl/AMQConnection.java | 7 ++ .../impl/AbstractFrameHandlerFactory.java | 20 +++- .../client/impl/CommandAssembler.java | 20 +++- .../client/impl/ConnectionParams.java | 12 ++- .../java/com/rabbitmq/client/impl/Frame.java | 11 ++- .../client/impl/SocketFrameHandler.java | 12 ++- .../impl/SocketFrameHandlerFactory.java | 12 ++- .../client/impl/nio/FrameBuilder.java | 15 ++- .../nio/SocketChannelFrameHandlerFactory.java | 11 ++- .../nio/SocketChannelFrameHandlerState.java | 11 ++- .../impl/nio/SslEngineFrameBuilder.java | 8 +- .../client/test/FrameBuilderTest.java | 8 +- .../test/MaxInboundMessageSizeTest.java | 97 +++++++++++++++++++ .../com/rabbitmq/client/test/TestUtils.java | 20 +++- 17 files changed, 282 insertions(+), 48 deletions(-) create mode 100644 src/test/java/com/rabbitmq/client/test/MaxInboundMessageSizeTest.java diff --git a/src/main/java/com/rabbitmq/client/ConnectionFactory.java b/src/main/java/com/rabbitmq/client/ConnectionFactory.java index 3bff5471ff..92566cb2e5 100644 --- a/src/main/java/com/rabbitmq/client/ConnectionFactory.java +++ b/src/main/java/com/rabbitmq/client/ConnectionFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -205,6 +205,13 @@ public class ConnectionFactory implements Cloneable { private CredentialsRefreshService credentialsRefreshService; + /** + * Maximum body size of inbound (received) messages in bytes. + * + *

Default value is 67,108,864 (64 MiB). + */ + private int maxInboundMessageBodySize = 1_048_576 * 64; + /** @return the default host to use for connections */ public String getHost() { return host; @@ -970,11 +977,15 @@ protected synchronized FrameHandlerFactory createFrameHandlerFactory() throws IO if(this.nioParams.getNioExecutor() == null && this.nioParams.getThreadFactory() == null) { this.nioParams.setThreadFactory(getThreadFactory()); } - this.frameHandlerFactory = new SocketChannelFrameHandlerFactory(connectionTimeout, nioParams, isSSL(), sslContextFactory); + this.frameHandlerFactory = new SocketChannelFrameHandlerFactory( + connectionTimeout, nioParams, isSSL(), sslContextFactory, + this.maxInboundMessageBodySize); } return this.frameHandlerFactory; } else { - return new SocketFrameHandlerFactory(connectionTimeout, socketFactory, socketConf, isSSL(), this.shutdownExecutor, sslContextFactory); + return new SocketFrameHandlerFactory(connectionTimeout, socketFactory, + socketConf, isSSL(), this.shutdownExecutor, sslContextFactory, + this.maxInboundMessageBodySize); } } @@ -1273,6 +1284,7 @@ public ConnectionParams params(ExecutorService consumerWorkServiceExecutor) { result.setRecoveredQueueNameSupplier(recoveredQueueNameSupplier); result.setTrafficListener(trafficListener); result.setCredentialsRefreshService(credentialsRefreshService); + result.setMaxInboundMessageBodySize(maxInboundMessageBodySize); return result; } @@ -1556,6 +1568,21 @@ public int getChannelRpcTimeout() { return channelRpcTimeout; } + /** + * Maximum body size of inbound (received) messages in bytes. + * + *

Default value is 67,108,864 (64 MiB). + * + * @param maxInboundMessageBodySize the maximum size of inbound messages + */ + public void setMaxInboundMessageBodySize(int maxInboundMessageBodySize) { + if (maxInboundMessageBodySize <= 0) { + throw new IllegalArgumentException("Max inbound message body size must be greater than 0: " + + maxInboundMessageBodySize); + } + this.maxInboundMessageBodySize = maxInboundMessageBodySize; + } + /** * The factory to create SSL contexts. * This provides more flexibility to create {@link SSLContext}s diff --git a/src/main/java/com/rabbitmq/client/impl/AMQChannel.java b/src/main/java/com/rabbitmq/client/impl/AMQChannel.java index fe64ab370e..f863edfd3a 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQChannel.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQChannel.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -62,7 +62,7 @@ public abstract class AMQChannel extends ShutdownNotifierComponent { private final int _channelNumber; /** Command being assembled */ - private AMQCommand _command = new AMQCommand(); + private AMQCommand _command; /** The current outstanding RPC request, if any. (Could become a queue in future.) */ private RpcWrapper _activeRpc = null; @@ -76,6 +76,7 @@ public abstract class AMQChannel extends ShutdownNotifierComponent { private final boolean _checkRpcResponseType; private final TrafficListener _trafficListener; + private final int maxInboundMessageBodySize; /** * Construct a channel on the given connection, with the given channel number. @@ -91,6 +92,8 @@ public AMQChannel(AMQConnection connection, int channelNumber) { this._rpcTimeout = connection.getChannelRpcTimeout(); this._checkRpcResponseType = connection.willCheckRpcResponseType(); this._trafficListener = connection.getTrafficListener(); + this.maxInboundMessageBodySize = connection.getMaxInboundMessageBodySize(); + this._command = new AMQCommand(this.maxInboundMessageBodySize); } /** @@ -110,7 +113,7 @@ public int getChannelNumber() { public void handleFrame(Frame frame) throws IOException { AMQCommand command = _command; if (command.handleFrame(frame)) { // a complete command has rolled off the assembly line - _command = new AMQCommand(); // prepare for the next one + _command = new AMQCommand(this.maxInboundMessageBodySize); // prepare for the next one handleCompleteInboundCommand(command); } } diff --git a/src/main/java/com/rabbitmq/client/impl/AMQCommand.java b/src/main/java/com/rabbitmq/client/impl/AMQCommand.java index b8cb3c97dd..a761e5cce6 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQCommand.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQCommand.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -44,9 +44,13 @@ public class AMQCommand implements Command { /** The assembler for this command - synchronised on - contains all the state */ private final CommandAssembler assembler; + AMQCommand(int maxBodyLength) { + this(null, null, null, maxBodyLength); + } + /** Construct a command ready to fill in by reading frames */ public AMQCommand() { - this(null, null, null); + this(null, null, null, Integer.MAX_VALUE); } /** @@ -54,7 +58,7 @@ public AMQCommand() { * @param method the wrapped method */ public AMQCommand(com.rabbitmq.client.Method method) { - this(method, null, null); + this(method, null, null, Integer.MAX_VALUE); } /** @@ -64,7 +68,19 @@ public AMQCommand(com.rabbitmq.client.Method method) { * @param body the message body data */ public AMQCommand(com.rabbitmq.client.Method method, AMQContentHeader contentHeader, byte[] body) { - this.assembler = new CommandAssembler((Method) method, contentHeader, body); + this.assembler = new CommandAssembler((Method) method, contentHeader, body, Integer.MAX_VALUE); + } + + /** + * Construct a command with a specified method, header and body. + * @param method the wrapped method + * @param contentHeader the wrapped content header + * @param body the message body data + * @param maxBodyLength the maximum size for an inbound message body + */ + public AMQCommand(com.rabbitmq.client.Method method, AMQContentHeader contentHeader, byte[] body, + int maxBodyLength) { + this.assembler = new CommandAssembler((Method) method, contentHeader, body, maxBodyLength); } /** Public API - {@inheritDoc} */ diff --git a/src/main/java/com/rabbitmq/client/impl/AMQConnection.java b/src/main/java/com/rabbitmq/client/impl/AMQConnection.java index dc077080a3..fd1d4531b8 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQConnection.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQConnection.java @@ -157,6 +157,7 @@ public static Map defaultClientProperties() { private volatile ChannelManager _channelManager; /** Saved server properties field from connection.start */ private volatile Map _serverProperties; + private final int maxInboundMessageBodySize; /** * Protected API - respond, in the driver thread, to a ShutdownSignal. @@ -244,6 +245,7 @@ public AMQConnection(ConnectionParams params, FrameHandler frameHandler, Metrics this.credentialsRefreshService = params.getCredentialsRefreshService(); + this._channel0 = createChannel0(); this._channelManager = null; @@ -257,6 +259,7 @@ public AMQConnection(ConnectionParams params, FrameHandler frameHandler, Metrics this.errorOnWriteListener = params.getErrorOnWriteListener() != null ? params.getErrorOnWriteListener() : (connection, exception) -> { throw exception; }; // we just propagate the exception for non-recoverable connections this.workPoolTimeout = params.getWorkPoolTimeout(); + this.maxInboundMessageBodySize = params.getMaxInboundMessageBodySize(); } AMQChannel createChannel0() { @@ -1202,4 +1205,8 @@ public boolean willCheckRpcResponseType() { public TrafficListener getTrafficListener() { return trafficListener; } + + int getMaxInboundMessageBodySize() { + return maxInboundMessageBodySize; + } } diff --git a/src/main/java/com/rabbitmq/client/impl/AbstractFrameHandlerFactory.java b/src/main/java/com/rabbitmq/client/impl/AbstractFrameHandlerFactory.java index 32eb46712f..61f4c51325 100644 --- a/src/main/java/com/rabbitmq/client/impl/AbstractFrameHandlerFactory.java +++ b/src/main/java/com/rabbitmq/client/impl/AbstractFrameHandlerFactory.java @@ -1,3 +1,18 @@ +// Copyright (c) 2016-2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.impl; import com.rabbitmq.client.SocketConfigurator; @@ -10,10 +25,13 @@ public abstract class AbstractFrameHandlerFactory implements FrameHandlerFactory protected final int connectionTimeout; protected final SocketConfigurator configurator; protected final boolean ssl; + protected final int maxInboundMessageBodySize; - protected AbstractFrameHandlerFactory(int connectionTimeout, SocketConfigurator configurator, boolean ssl) { + protected AbstractFrameHandlerFactory(int connectionTimeout, SocketConfigurator configurator, + boolean ssl, int maxInboundMessageBodySize) { this.connectionTimeout = connectionTimeout; this.configurator = configurator; this.ssl = ssl; + this.maxInboundMessageBodySize = maxInboundMessageBodySize; } } diff --git a/src/main/java/com/rabbitmq/client/impl/CommandAssembler.java b/src/main/java/com/rabbitmq/client/impl/CommandAssembler.java index f19294862f..bc548efe76 100644 --- a/src/main/java/com/rabbitmq/client/impl/CommandAssembler.java +++ b/src/main/java/com/rabbitmq/client/impl/CommandAssembler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -21,6 +21,7 @@ import com.rabbitmq.client.AMQP; import com.rabbitmq.client.UnexpectedFrameError; +import static java.lang.String.format; /** * Class responsible for piecing together a command from a series of {@link Frame}s. @@ -52,12 +53,16 @@ private enum CAState { /** No bytes of content body not yet accumulated */ private long remainingBodyBytes; - public CommandAssembler(Method method, AMQContentHeader contentHeader, byte[] body) { + private final int maxBodyLength; + + public CommandAssembler(Method method, AMQContentHeader contentHeader, byte[] body, + int maxBodyLength) { this.method = method; this.contentHeader = contentHeader; - this.bodyN = new ArrayList(2); + this.bodyN = new ArrayList<>(2); this.bodyLength = 0; this.remainingBodyBytes = 0; + this.maxBodyLength = maxBodyLength; appendBodyFragment(body); if (method == null) { this.state = CAState.EXPECTING_METHOD; @@ -99,7 +104,14 @@ private void consumeMethodFrame(Frame f) throws IOException { private void consumeHeaderFrame(Frame f) throws IOException { if (f.type == AMQP.FRAME_HEADER) { this.contentHeader = AMQImpl.readContentHeaderFrom(f.getInputStream()); - this.remainingBodyBytes = this.contentHeader.getBodySize(); + long bodySize = this.contentHeader.getBodySize(); + if (bodySize >= this.maxBodyLength) { + throw new IllegalStateException(format( + "Message body is too large (%d), maximum size is %d", + bodySize, this.maxBodyLength + )); + } + this.remainingBodyBytes = bodySize; updateContentBodyState(); } else { throw new UnexpectedFrameError(f, AMQP.FRAME_HEADER); diff --git a/src/main/java/com/rabbitmq/client/impl/ConnectionParams.java b/src/main/java/com/rabbitmq/client/impl/ConnectionParams.java index 24d20040ef..9fe6e8558d 100644 --- a/src/main/java/com/rabbitmq/client/impl/ConnectionParams.java +++ b/src/main/java/com/rabbitmq/client/impl/ConnectionParams.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -64,6 +64,8 @@ public class ConnectionParams { private CredentialsRefreshService credentialsRefreshService; + private int maxInboundMessageBodySize; + public ConnectionParams() {} public CredentialsProvider getCredentialsProvider() { @@ -297,4 +299,12 @@ public void setCredentialsRefreshService(CredentialsRefreshService credentialsRe public CredentialsRefreshService getCredentialsRefreshService() { return credentialsRefreshService; } + + public int getMaxInboundMessageBodySize() { + return maxInboundMessageBodySize; + } + + public void setMaxInboundMessageBodySize(int maxInboundMessageBodySize) { + this.maxInboundMessageBodySize = maxInboundMessageBodySize; + } } diff --git a/src/main/java/com/rabbitmq/client/impl/Frame.java b/src/main/java/com/rabbitmq/client/impl/Frame.java index ce7531cc96..3608b37f27 100644 --- a/src/main/java/com/rabbitmq/client/impl/Frame.java +++ b/src/main/java/com/rabbitmq/client/impl/Frame.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -25,6 +25,7 @@ import java.util.Date; import java.util.List; import java.util.Map; +import static java.lang.String.format; /** * Represents an AMQP wire-protocol frame, with frame type, channel number, and payload bytes. @@ -82,7 +83,7 @@ public static Frame fromBodyFragment(int channelNumber, byte[] body, int offset, * * @return a new Frame if we read a frame successfully, otherwise null */ - public static Frame readFrom(DataInputStream is) throws IOException { + public static Frame readFrom(DataInputStream is, int maxPayloadSize) throws IOException { int type; int channel; @@ -108,6 +109,12 @@ public static Frame readFrom(DataInputStream is) throws IOException { channel = is.readUnsignedShort(); int payloadSize = is.readInt(); + if (payloadSize >= maxPayloadSize) { + throw new IllegalStateException(format( + "Frame body is too large (%d), maximum size is %d", + payloadSize, maxPayloadSize + )); + } byte[] payload = new byte[payloadSize]; is.readFully(payload); diff --git a/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java b/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java index 6efd6f83f9..5048100a7b 100644 --- a/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java +++ b/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -52,6 +52,8 @@ public class SocketFrameHandler implements FrameHandler { /** Socket's outputstream - data to the broker - synchronized on */ private final DataOutputStream _outputStream; + private final int maxInboundMessageBodySize; + /** Time to linger before closing the socket forcefully. */ public static final int SOCKET_CLOSING_TIMEOUT = 1; @@ -59,15 +61,17 @@ public class SocketFrameHandler implements FrameHandler { * @param socket the socket to use */ public SocketFrameHandler(Socket socket) throws IOException { - this(socket, null); + this(socket, null, Integer.MAX_VALUE); } /** * @param socket the socket to use */ - public SocketFrameHandler(Socket socket, ExecutorService shutdownExecutor) throws IOException { + public SocketFrameHandler(Socket socket, ExecutorService shutdownExecutor, + int maxInboundMessageBodySize) throws IOException { _socket = socket; _shutdownExecutor = shutdownExecutor; + this.maxInboundMessageBodySize = maxInboundMessageBodySize; _inputStream = new DataInputStream(new BufferedInputStream(socket.getInputStream())); _outputStream = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream())); @@ -181,7 +185,7 @@ public void initialize(AMQConnection connection) { @Override public Frame readFrame() throws IOException { synchronized (_inputStream) { - return Frame.readFrom(_inputStream); + return Frame.readFrom(_inputStream, this.maxInboundMessageBodySize); } } diff --git a/src/main/java/com/rabbitmq/client/impl/SocketFrameHandlerFactory.java b/src/main/java/com/rabbitmq/client/impl/SocketFrameHandlerFactory.java index d3fdfa9e25..40818c46ba 100644 --- a/src/main/java/com/rabbitmq/client/impl/SocketFrameHandlerFactory.java +++ b/src/main/java/com/rabbitmq/client/impl/SocketFrameHandlerFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -38,12 +38,14 @@ public SocketFrameHandlerFactory(int connectionTimeout, SocketFactory socketFact public SocketFrameHandlerFactory(int connectionTimeout, SocketFactory socketFactory, SocketConfigurator configurator, boolean ssl, ExecutorService shutdownExecutor) { - this(connectionTimeout, socketFactory, configurator, ssl, shutdownExecutor, null); + this(connectionTimeout, socketFactory, configurator, ssl, shutdownExecutor, null, + Integer.MAX_VALUE); } public SocketFrameHandlerFactory(int connectionTimeout, SocketFactory socketFactory, SocketConfigurator configurator, - boolean ssl, ExecutorService shutdownExecutor, SslContextFactory sslContextFactory) { - super(connectionTimeout, configurator, ssl); + boolean ssl, ExecutorService shutdownExecutor, SslContextFactory sslContextFactory, + int maxInboundMessageBodySize) { + super(connectionTimeout, configurator, ssl, maxInboundMessageBodySize); this.socketFactory = socketFactory; this.shutdownExecutor = shutdownExecutor; this.sslContextFactory = sslContextFactory; @@ -79,7 +81,7 @@ protected Socket createSocket(String connectionName) throws IOException { public FrameHandler create(Socket sock) throws IOException { - return new SocketFrameHandler(sock, this.shutdownExecutor); + return new SocketFrameHandler(sock, this.shutdownExecutor, this.maxInboundMessageBodySize); } private static void quietTrySocketClose(Socket socket) { diff --git a/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java b/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java index 813e328b9e..a14bbaf17a 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -23,6 +23,7 @@ import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.ReadableByteChannel; +import static java.lang.String.format; /** * Class to create AMQP frames from a {@link ReadableByteChannel}. @@ -43,6 +44,7 @@ public class FrameBuilder { protected final ReadableByteChannel channel; protected final ByteBuffer applicationBuffer; + private final int maxPayloadSize; // to store the bytes of the outstanding data // 3 byte-long because the longest we read is an unsigned int // (not need to store the latest byte) @@ -52,9 +54,10 @@ public class FrameBuilder { private byte[] framePayload; private int bytesRead = 0; - public FrameBuilder(ReadableByteChannel channel, ByteBuffer buffer) { + public FrameBuilder(ReadableByteChannel channel, ByteBuffer buffer, int maxPayloadSize) { this.channel = channel; this.applicationBuffer = buffer; + this.maxPayloadSize = maxPayloadSize; } /** @@ -65,7 +68,7 @@ public FrameBuilder(ReadableByteChannel channel, ByteBuffer buffer) { * * @return a complete frame or null if a frame couldn't have been fully built * @throws IOException - * @see Frame#readFrom(DataInputStream) + * @see Frame#readFrom(DataInputStream, int) */ public Frame readFrame() throws IOException { while (somethingToRead()) { @@ -93,6 +96,12 @@ public Frame readFrame() throws IOException { } else if (bytesRead == 6) { // payload size 4/4 int framePayloadSize = (frameBuffer[0] << 24) + (frameBuffer[1] << 16) + (frameBuffer[2] << 8) + readFromBuffer(); + if (framePayloadSize >= maxPayloadSize) { + throw new IllegalStateException(format( + "Frame body is too large (%d), maximum size is %d", + framePayloadSize, maxPayloadSize + )); + } framePayload = new byte[framePayloadSize]; } else if (bytesRead >= PAYLOAD_OFFSET && bytesRead < framePayload.length + PAYLOAD_OFFSET) { framePayload[bytesRead - PAYLOAD_OFFSET] = (byte) readFromBuffer(); diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java index 2cab2066c3..ed0a4f20f8 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -58,8 +58,10 @@ public class SocketChannelFrameHandlerFactory extends AbstractFrameHandlerFactor private final List nioLoopContexts; - public SocketChannelFrameHandlerFactory(int connectionTimeout, NioParams nioParams, boolean ssl, SslContextFactory sslContextFactory) { - super(connectionTimeout, null, ssl); + public SocketChannelFrameHandlerFactory(int connectionTimeout, NioParams nioParams, boolean ssl, + SslContextFactory sslContextFactory, + int maxInboundMessageBodySize) { + super(connectionTimeout, null, ssl, maxInboundMessageBodySize); this.nioParams = new NioParams(nioParams); this.sslContextFactory = sslContextFactory; this.nioLoopContexts = new ArrayList<>(this.nioParams.getNbIoThreads()); @@ -134,7 +136,8 @@ public FrameHandler create(Address addr, String connectionName) throws IOExcepti channel, nioLoopContext, nioParams, - sslEngine + sslEngine, + this.maxInboundMessageBodySize ); state.startReading(); SocketChannelFrameHandler frameHandler = new SocketChannelFrameHandler(state); diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java index 4f1e4dc885..b1a391fd65 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -71,7 +71,9 @@ public class SocketChannelFrameHandlerState { final FrameBuilder frameBuilder; - public SocketChannelFrameHandlerState(SocketChannel channel, NioLoopContext nioLoopsState, NioParams nioParams, SSLEngine sslEngine) { + public SocketChannelFrameHandlerState(SocketChannel channel, NioLoopContext nioLoopsState, + NioParams nioParams, SSLEngine sslEngine, + int maxFramePayloadSize) { this.channel = channel; this.readSelectorState = nioLoopsState.readSelectorState; this.writeSelectorState = nioLoopsState.writeSelectorState; @@ -94,7 +96,7 @@ public SocketChannelFrameHandlerState(SocketChannel channel, NioLoopContext nioL new ByteBufferOutputStream(channel, plainOut) ); - this.frameBuilder = new FrameBuilder(channel, plainIn); + this.frameBuilder = new FrameBuilder(channel, plainIn, maxFramePayloadSize); } else { this.ssl = true; @@ -106,7 +108,8 @@ public SocketChannelFrameHandlerState(SocketChannel channel, NioLoopContext nioL this.outputStream = new DataOutputStream( new SslEngineByteBufferOutputStream(sslEngine, plainOut, cipherOut, channel) ); - this.frameBuilder = new SslEngineFrameBuilder(sslEngine, plainIn, cipherIn, channel); + this.frameBuilder = new SslEngineFrameBuilder(sslEngine, plainIn, + cipherIn, channel, maxFramePayloadSize); } } diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java index 8b6ecaf8ab..48072988c2 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -35,8 +35,10 @@ public class SslEngineFrameBuilder extends FrameBuilder { private boolean isUnderflowHandlingEnabled = false; - public SslEngineFrameBuilder(SSLEngine sslEngine, ByteBuffer plainIn, ByteBuffer cipherIn, ReadableByteChannel channel) { - super(channel, plainIn); + public SslEngineFrameBuilder(SSLEngine sslEngine, ByteBuffer plainIn, + ByteBuffer cipherIn, ReadableByteChannel channel, + int maxPayloadSize) { + super(channel, plainIn, maxPayloadSize); this.sslEngine = sslEngine; this.cipherBuffer = cipherIn; } diff --git a/src/test/java/com/rabbitmq/client/test/FrameBuilderTest.java b/src/test/java/com/rabbitmq/client/test/FrameBuilderTest.java index 3e8b462f3d..5c227ae1c6 100644 --- a/src/test/java/com/rabbitmq/client/test/FrameBuilderTest.java +++ b/src/test/java/com/rabbitmq/client/test/FrameBuilderTest.java @@ -59,7 +59,7 @@ void tearDown() throws Exception { @Test public void buildFrameInOneGo() throws IOException { buffer = ByteBuffer.wrap(new byte[] { 1, 0, 0, 0, 0, 0, 3, 1, 2, 3, end() }); - builder = new FrameBuilder(channel, buffer); + builder = new FrameBuilder(channel, buffer, Integer.MAX_VALUE); Frame frame = builder.readFrame(); assertThat(frame).isNotNull(); assertThat(frame.type).isEqualTo(1); @@ -78,7 +78,7 @@ public void buildFramesInOneGo() throws IOException { } } buffer = ByteBuffer.wrap(frames); - builder = new FrameBuilder(channel, buffer); + builder = new FrameBuilder(channel, buffer, Integer.MAX_VALUE); int frameCount = 0; Frame frame; while ((frame = builder.readFrame()) != null) { @@ -94,7 +94,7 @@ public void buildFramesInOneGo() throws IOException { @Test public void buildFrameInSeveralCalls() throws IOException { buffer = ByteBuffer.wrap(new byte[] { 1, 0, 0, 0, 0, 0, 3, 1, 2 }); - builder = new FrameBuilder(channel, buffer); + builder = new FrameBuilder(channel, buffer, Integer.MAX_VALUE); Frame frame = builder.readFrame(); assertThat(frame).isNull(); @@ -131,7 +131,7 @@ public void protocolMismatchHeader() throws IOException { }; for (int i = 0; i < buffers.length; i++) { - builder = new FrameBuilder(channel, buffers[i]); + builder = new FrameBuilder(channel, buffers[i], Integer.MAX_VALUE); try { builder.readFrame(); fail("protocol header not correct, exception should have been thrown"); diff --git a/src/test/java/com/rabbitmq/client/test/MaxInboundMessageSizeTest.java b/src/test/java/com/rabbitmq/client/test/MaxInboundMessageSizeTest.java new file mode 100644 index 0000000000..da534d9c5f --- /dev/null +++ b/src/test/java/com/rabbitmq/client/test/MaxInboundMessageSizeTest.java @@ -0,0 +1,97 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.test; + +import static com.rabbitmq.client.test.TestUtils.LatchConditions.completed; +import static org.assertj.core.api.Assertions.assertThat; + +import com.rabbitmq.client.*; +import java.io.IOException; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; + +public class MaxInboundMessageSizeTest extends BrokerTestCase { + + String q; + + private static void safeClose(Connection c) { + try { + c.close(); + } catch (Exception e) { + // OK + } + } + + @Override + protected void createResources() throws IOException, TimeoutException { + q = generateQueueName(); + declareTransientQueue(q); + super.createResources(); + } + + @CsvSource({ + "20000,5000,true", + "20000,100000,true", + "20000,5000,false", + "20000,100000,false", + }) + @ParameterizedTest + void maxInboundMessageSizeMustBeEnforced(int maxMessageSize, int frameMax, boolean basicGet) + throws Exception { + ConnectionFactory cf = newConnectionFactory(); + cf.setMaxInboundMessageBodySize(maxMessageSize); + cf.setRequestedFrameMax(frameMax); + Connection c = cf.newConnection(); + try { + Channel ch = c.createChannel(); + ch.confirmSelect(); + byte[] body = new byte[maxMessageSize * 2]; + ch.basicPublish("", q, null, body); + ch.waitForConfirmsOrDie(); + AtomicReference exception = new AtomicReference<>(); + CountDownLatch errorLatch = new CountDownLatch(1); + ch.addShutdownListener( + cause -> { + exception.set(cause.getCause()); + errorLatch.countDown(); + }); + if (basicGet) { + try { + ch.basicGet(q, true); + } catch (Exception e) { + // OK for basicGet + } + } else { + ch.basicConsume(q, new DefaultConsumer(ch)); + } + assertThat(errorLatch).is(completed()); + assertThat(exception.get()) + .isInstanceOf(IllegalStateException.class) + .hasMessageContaining("Message body is too large"); + } finally { + safeClose(c); + } + } + + @Override + protected void releaseResources() throws IOException { + deleteQueue(q); + super.releaseResources(); + } +} diff --git a/src/test/java/com/rabbitmq/client/test/TestUtils.java b/src/test/java/com/rabbitmq/client/test/TestUtils.java index cbb2885f22..ec495bcb83 100644 --- a/src/test/java/com/rabbitmq/client/test/TestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/TestUtils.java @@ -26,11 +26,11 @@ import java.lang.annotation.Target; import java.util.function.Function; import org.assertj.core.api.Assertions; +import org.assertj.core.api.Condition; import org.junit.jupiter.api.extension.ConditionEvaluationResult; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.extension.ExtensionContext; import org.junit.jupiter.api.extension.ExtensionContext.Namespace; -import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.IOException; @@ -47,8 +47,6 @@ public class TestUtils { - private static final Logger LOGGER = LoggerFactory.getLogger(TestUtils.class); - public static final boolean USE_NIO = System.getProperty("use.nio") != null; public static ConnectionFactory connectionFactory() { @@ -303,6 +301,22 @@ public interface CallableFunction { } + public static class LatchConditions { + + static Condition completed() { + return new Condition<>( + countDownLatch-> { + try { + return countDownLatch.await(10, TimeUnit.SECONDS); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + }, + "Latch did not complete in 10 seconds"); + } + + } + public static boolean basicGetBasicConsume(Connection connection, String queue, final CountDownLatch latch, int msgSize) throws Exception { Channel channel = connection.createChannel(); From 04f1801ae6eaac10af7bf802c8fb7065284624e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 15 Jun 2023 11:49:56 +0200 Subject: [PATCH 272/657] Tweak error message References #1062 (cherry picked from commit 5982cd1eb307004fe53353a01da03332aa342eb2) --- src/main/java/com/rabbitmq/client/impl/CommandAssembler.java | 4 +++- src/main/java/com/rabbitmq/client/impl/Frame.java | 4 +++- src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/CommandAssembler.java b/src/main/java/com/rabbitmq/client/impl/CommandAssembler.java index bc548efe76..2ff9f10e3d 100644 --- a/src/main/java/com/rabbitmq/client/impl/CommandAssembler.java +++ b/src/main/java/com/rabbitmq/client/impl/CommandAssembler.java @@ -107,7 +107,9 @@ private void consumeHeaderFrame(Frame f) throws IOException { long bodySize = this.contentHeader.getBodySize(); if (bodySize >= this.maxBodyLength) { throw new IllegalStateException(format( - "Message body is too large (%d), maximum size is %d", + "Message body is too large (%d), maximum configured size is %d. " + + "See ConnectionFactory#setMaxInboundMessageBodySize " + + "if you need to increase the limit.", bodySize, this.maxBodyLength )); } diff --git a/src/main/java/com/rabbitmq/client/impl/Frame.java b/src/main/java/com/rabbitmq/client/impl/Frame.java index 3608b37f27..d1332b79d0 100644 --- a/src/main/java/com/rabbitmq/client/impl/Frame.java +++ b/src/main/java/com/rabbitmq/client/impl/Frame.java @@ -111,7 +111,9 @@ public static Frame readFrom(DataInputStream is, int maxPayloadSize) throws IOEx int payloadSize = is.readInt(); if (payloadSize >= maxPayloadSize) { throw new IllegalStateException(format( - "Frame body is too large (%d), maximum size is %d", + "Frame body is too large (%d), maximum configured size is %d. " + + "See ConnectionFactory#setMaxInboundMessageBodySize " + + "if you need to increase the limit.", payloadSize, maxPayloadSize )); } diff --git a/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java b/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java index a14bbaf17a..3562e92a1b 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java @@ -98,7 +98,9 @@ public Frame readFrame() throws IOException { int framePayloadSize = (frameBuffer[0] << 24) + (frameBuffer[1] << 16) + (frameBuffer[2] << 8) + readFromBuffer(); if (framePayloadSize >= maxPayloadSize) { throw new IllegalStateException(format( - "Frame body is too large (%d), maximum size is %d", + "Frame body is too large (%d), maximum configured size is %d. " + + "See ConnectionFactory#setMaxInboundMessageBodySize " + + "if you need to increase the limit.", framePayloadSize, maxPayloadSize )); } From e2fa38f0d8c985a539bdee3a3d40d401a7141a55 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jun 2023 01:24:12 +0000 Subject: [PATCH 273/657] Bump mockito-core from 5.3.1 to 5.4.0 Bumps [mockito-core](https://github.com/mockito/mockito) from 5.3.1 to 5.4.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.3.1...v5.4.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 c322e0c5d5..b9c8e2387a 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.15.2 1.2.12 5.9.3 - 5.3.1 + 5.4.0 3.24.2 9.4.51.v20230217 1.70 From 75d1d1eb2d365f5a8f0fbc1ff5408f3dd706f4ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 19 Jun 2023 10:32:28 +0200 Subject: [PATCH 274/657] Set release version to 5.18.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index 5189a6d325..2ac35ce7bb 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.18.0.RC1" -DEVELOPMENT_VERSION="5.18.0-SNAPSHOT" +RELEASE_VERSION="5.18.0" +DEVELOPMENT_VERSION="5.19.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From dcc284ee1b199057a1094055b7eac597539c9942 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 19 Jun 2023 08:34:02 +0000 Subject: [PATCH 275/657] [maven-release-plugin] prepare release v5.18.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index b9c8e2387a..15cf309f58 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.18.0-SNAPSHOT + 5.18.0 jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git - HEAD + v5.18.0 From 0eba9f0c4154b92b209731554363f53ffa96def5 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 19 Jun 2023 08:34:04 +0000 Subject: [PATCH 276/657] [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 15cf309f58..2f7b20c756 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.18.0 + 5.19.0-SNAPSHOT jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git - v5.18.0 + HEAD From 78ce5383ac031e9ef227278f2493c51f42cd3c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 19 Jun 2023 11:17:14 +0200 Subject: [PATCH 277/657] Set release version to 5.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 2ac35ce7bb..ce1b2c590d 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.18.0" +RELEASE_VERSION="5.19.0.RC1" DEVELOPMENT_VERSION="5.19.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From 929dc8a534dce896a529ab3b074ee33a4221397b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jul 2023 01:05:24 +0000 Subject: [PATCH 278/657] Bump opentelemetry.version from 1.27.0 to 1.28.0 Bumps `opentelemetry.version` from 1.27.0 to 1.28.0. Updates `opentelemetry-api` from 1.27.0 to 1.28.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.27.0...v1.28.0) Updates `opentelemetry-sdk-testing` from 1.27.0 to 1.28.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.27.0...v1.28.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 2f7b20c756..8f0a28dc52 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 1.7.36 4.2.19 1.11.1 - 1.27.0 + 1.28.0 2.15.2 1.2.12 5.9.3 From 78bcb89ddf4445b9914ab5da27ac50b7b6204b01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Jul 2023 00:39:10 +0000 Subject: [PATCH 279/657] Bump micrometer-core from 1.11.1 to 1.11.2 Bumps [micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.11.1 to 1.11.2. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.11.1...v1.11.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 8f0a28dc52..60c24be217 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.7.36 4.2.19 - 1.11.1 + 1.11.2 1.28.0 2.15.2 1.2.12 From 64cece85cfcdeaaf74316a1b31ec1028418df079 Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Wed, 19 Apr 2023 15:12:40 +0200 Subject: [PATCH 280/657] WIP on Micrometer Observation (cherry picked from commit fd04179a1ee34092a21d9aec1242b7d6bfb35ffd) Conflicts: src/main/java/com/rabbitmq/client/impl/ChannelN.java --- pom.xml | 17 +- .../com/rabbitmq/client/MetricsCollector.java | 71 ++++++++ .../com/rabbitmq/client/impl/ChannelN.java | 17 +- ...icrometerConsumeObservationConvention.java | 65 ++++++++ ...icrometerPublishObservationConvention.java | 65 ++++++++ .../client/impl/MicrometerConsumeContext.java | 69 ++++++++ ...icrometerConsumeObservationConvention.java | 34 ++++ .../impl/MicrometerMetricsCollector.java | 122 ++++++++++++++ .../client/impl/MicrometerPublishContext.java | 59 +++++++ ...icrometerPublishObservationConvention.java | 36 ++++ ...meterRabbitMqObservationDocumentation.java | 157 ++++++++++++++++++ .../test/functional/FunctionalTestSuite.java | 1 + .../test/functional/MicrometerMetrics.java | 144 ++++++++++++++++ 13 files changed, 848 insertions(+), 9 deletions(-) create mode 100644 src/main/java/com/rabbitmq/client/impl/DefaultMicrometerConsumeObservationConvention.java create mode 100644 src/main/java/com/rabbitmq/client/impl/DefaultMicrometerPublishObservationConvention.java create mode 100644 src/main/java/com/rabbitmq/client/impl/MicrometerConsumeContext.java create mode 100644 src/main/java/com/rabbitmq/client/impl/MicrometerConsumeObservationConvention.java create mode 100644 src/main/java/com/rabbitmq/client/impl/MicrometerPublishContext.java create mode 100644 src/main/java/com/rabbitmq/client/impl/MicrometerPublishObservationConvention.java create mode 100644 src/main/java/com/rabbitmq/client/impl/MicrometerRabbitMqObservationDocumentation.java create mode 100644 src/test/java/com/rabbitmq/client/test/functional/MicrometerMetrics.java diff --git a/pom.xml b/pom.xml index 60c24be217..293e9fd36d 100644 --- a/pom.xml +++ b/pom.xml @@ -56,8 +56,9 @@ 1.7.36 4.2.19 - 1.11.2 - 1.28.0 + 1.11.1 + 1.27.0 + 1.1.4 2.15.2 1.2.12 5.9.3 @@ -791,6 +792,11 @@ ${gson.version} test + + io.micrometer + micrometer-tracing-integration-test + test + @@ -804,6 +810,13 @@ pom import + + io.micrometer + micrometer-tracing-bom + ${micrometer-tracing.version} + pom + import + diff --git a/src/main/java/com/rabbitmq/client/MetricsCollector.java b/src/main/java/com/rabbitmq/client/MetricsCollector.java index 3c4aada94d..b6da5c075b 100644 --- a/src/main/java/com/rabbitmq/client/MetricsCollector.java +++ b/src/main/java/com/rabbitmq/client/MetricsCollector.java @@ -15,6 +15,12 @@ package com.rabbitmq.client; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import com.rabbitmq.client.impl.AMQCommand; + /** * Interface to gather execution data of the client. * Note transactions are not supported: they deal with @@ -64,6 +70,71 @@ default void basicPublishUnrouted(Channel channel) { void basicConsume(Channel channel, String consumerTag, boolean autoAck); + default Consumer basicPreConsume(Channel channel, String consumerTag, boolean autoAck, AMQCommand amqCommand, Consumer callback) { + return callback; + } + void basicCancel(Channel channel, String consumerTag); + default void basicPrePublish(Channel channel, long deliveryTag, PublishArguments publishArguments) { + + } + + default void basicPublishFailure(Channel channel, Exception exception, PublishArguments publishArguments) { + basicPublishFailure(channel, exception); + } + + default void basicPublish(Channel channel, long deliveryTag, PublishArguments publishArguments) { + basicPublish(channel, deliveryTag); + } + + class PublishArguments { + private AMQP.Basic.Publish publish; + + private AMQP.BasicProperties props; + + private byte[] body; + + private final Map headers = new HashMap<>(); + + private final Map context = new HashMap<>(); + + public PublishArguments(AMQP.Basic.Publish publish, AMQP.BasicProperties props, byte[] body) { + this.publish = Objects.requireNonNull(publish); + this.props = Objects.requireNonNull(props); + this.body = Objects.requireNonNull(body); + } + + public AMQP.Basic.Publish getPublish() { + return publish; + } + + public AMQP.BasicProperties getProps() { + return props; + } + + public byte[] getBody() { + return body; + } + + public void setPublish(AMQP.Basic.Publish publish) { + this.publish = publish; + } + + public void setProps(AMQP.BasicProperties props) { + this.props = props; + } + + public void setBody(byte[] body) { + this.body = body; + } + + public Map getContext() { + return context; + } + + public Map getHeaders() { + return headers; + } + } } diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelN.java b/src/main/java/com/rabbitmq/client/impl/ChannelN.java index 0907d6c983..a479ba20d9 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelN.java @@ -702,20 +702,22 @@ public void basicPublish(String exchange, String routingKey, if (props == null) { props = MessageProperties.MINIMAL_BASIC; } - AMQCommand command = new AMQCommand( - new Basic.Publish.Builder() + AMQP.Basic.Publish publish = new Basic.Publish.Builder() .exchange(exchange) .routingKey(routingKey) .mandatory(mandatory) .immediate(immediate) - .build(), props, body); + .build(); + MetricsCollector.PublishArguments args = new MetricsCollector.PublishArguments(publish, props, body); try { + metricsCollector.basicPrePublish(this, deliveryTag, args); + AMQCommand command = new AMQCommand(args.getPublish(), args.getProps(), args.getBody()); transmit(command); } catch (IOException | AlreadyClosedException e) { - metricsCollector.basicPublishFailure(this, e); + metricsCollector.basicPublishFailure(this, e, args); throw e; } - metricsCollector.basicPublish(this); + metricsCollector.basicPublish(this, deliveryTag, args); } /** Public API - {@inheritDoc} */ @@ -1360,12 +1362,13 @@ public String basicConsume(String queue, final boolean autoAck, String consumerT @Override public String transformReply(AMQCommand replyCommand) { String actualConsumerTag = ((Basic.ConsumeOk) replyCommand.getMethod()).getConsumerTag(); - _consumers.put(actualConsumerTag, callback); + Consumer wrappedCallback = metricsCollector.basicPreConsume(ChannelN.this, actualConsumerTag, autoAck, replyCommand, callback); + _consumers.put(actualConsumerTag, wrappedCallback); // need to register consumer in stats before it actually starts consuming metricsCollector.basicConsume(ChannelN.this, actualConsumerTag, autoAck); - dispatcher.handleConsumeOk(callback, actualConsumerTag); + dispatcher.handleConsumeOk(wrappedCallback, actualConsumerTag); return actualConsumerTag; } }; diff --git a/src/main/java/com/rabbitmq/client/impl/DefaultMicrometerConsumeObservationConvention.java b/src/main/java/com/rabbitmq/client/impl/DefaultMicrometerConsumeObservationConvention.java new file mode 100644 index 0000000000..c346009d17 --- /dev/null +++ b/src/main/java/com/rabbitmq/client/impl/DefaultMicrometerConsumeObservationConvention.java @@ -0,0 +1,65 @@ +/* + * Copyright 2022 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rabbitmq.client.impl; + +import com.rabbitmq.client.impl.MicrometerRabbitMqObservationDocumentation.HighCardinalityTags; +import com.rabbitmq.client.impl.MicrometerRabbitMqObservationDocumentation.LowCardinalityTags; +import io.micrometer.common.KeyValues; +import io.micrometer.common.util.StringUtils; + +/** + * Default implementation of {@link MicrometerConsumeObservationConvention}. + * + * @since 6.0.0 + * @see MicrometerConsumeObservationConvention + */ +public class DefaultMicrometerConsumeObservationConvention implements MicrometerConsumeObservationConvention { + + /** + * Singleton instance of this convention. + */ + public static final DefaultMicrometerConsumeObservationConvention INSTANCE = new DefaultMicrometerConsumeObservationConvention(); + + // There is no need to instantiate this class multiple times, but it may be extended, + // hence protected visibility. + protected DefaultMicrometerConsumeObservationConvention() { + } + + @Override + public String getName() { + return "rabbit.consume"; // TODO: How should we call this + } + + @Override + public String getContextualName(MicrometerConsumeContext context) { + return destination(context.getEnvelope().getRoutingKey()) + " consume"; + } + + private String destination(String destination) { + return StringUtils.isNotBlank(destination) ? destination : "(anonymous)"; + } + + @Override + public KeyValues getLowCardinalityKeyValues(MicrometerConsumeContext context) { + return KeyValues.of(LowCardinalityTags.MESSAGING_OPERATION.withValue("publish"), LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq")); + } + + @Override + public KeyValues getHighCardinalityKeyValues(MicrometerConsumeContext context) { + return KeyValues.of(HighCardinalityTags.MESSAGING_ROUTING_KEY.withValue(context.getEnvelope().getRoutingKey()), HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(context.getEnvelope().getExchange())); + } + +} diff --git a/src/main/java/com/rabbitmq/client/impl/DefaultMicrometerPublishObservationConvention.java b/src/main/java/com/rabbitmq/client/impl/DefaultMicrometerPublishObservationConvention.java new file mode 100644 index 0000000000..4dc04e2d4a --- /dev/null +++ b/src/main/java/com/rabbitmq/client/impl/DefaultMicrometerPublishObservationConvention.java @@ -0,0 +1,65 @@ +/* + * Copyright 2022 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rabbitmq.client.impl; + +import com.rabbitmq.client.impl.MicrometerRabbitMqObservationDocumentation.HighCardinalityTags; +import com.rabbitmq.client.impl.MicrometerRabbitMqObservationDocumentation.LowCardinalityTags; +import io.micrometer.common.KeyValues; +import io.micrometer.common.util.StringUtils; + +/** + * Default implementation of {@link MicrometerPublishObservationConvention}. + * + * @since 6.0.0 + * @see MicrometerRabbitMqObservationDocumentation + */ +public class DefaultMicrometerPublishObservationConvention implements MicrometerPublishObservationConvention { + + /** + * Singleton instance of this convention. + */ + public static final DefaultMicrometerPublishObservationConvention INSTANCE = new DefaultMicrometerPublishObservationConvention(); + + // There is no need to instantiate this class multiple times, but it may be extended, + // hence protected visibility. + protected DefaultMicrometerPublishObservationConvention() { + } + + @Override + public String getName() { + return "rabbit.publish"; // TODO: How should we call this + } + + @Override + public String getContextualName(MicrometerPublishContext context) { + return destination(context.getPublishArguments().getPublish().getRoutingKey()) + " publish"; + } + + private String destination(String destination) { + return StringUtils.isNotBlank(destination) ? destination : "(anonymous)"; + } + + @Override + public KeyValues getLowCardinalityKeyValues(MicrometerPublishContext context) { + return KeyValues.of(LowCardinalityTags.MESSAGING_OPERATION.withValue("publish"), LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq")); + } + + @Override + public KeyValues getHighCardinalityKeyValues(MicrometerPublishContext context) { + return KeyValues.of(HighCardinalityTags.MESSAGING_ROUTING_KEY.withValue(context.getPublishArguments().getPublish().getRoutingKey()), HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(context.getPublishArguments().getPublish().getExchange())); + } + +} diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerConsumeContext.java b/src/main/java/com/rabbitmq/client/impl/MicrometerConsumeContext.java new file mode 100644 index 0000000000..c141c2eb32 --- /dev/null +++ b/src/main/java/com/rabbitmq/client/impl/MicrometerConsumeContext.java @@ -0,0 +1,69 @@ +/* + * Copyright 2022 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rabbitmq.client.impl; + +import java.util.Objects; + +import com.rabbitmq.client.AMQP; +import com.rabbitmq.client.Envelope; +import io.micrometer.observation.transport.ReceiverContext; + +/** + * {@link io.micrometer.observation.Observation.Context} for use with RabbitMQ client + * {@link io.micrometer.observation.Observation} instrumentation. + * + * @since 6.0.0 + */ +public class MicrometerConsumeContext extends ReceiverContext { + + private final String consumerTag; + private final Envelope envelope; + + private final AMQP.BasicProperties properties; + + private final byte[] body; + + public MicrometerConsumeContext(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) { + super((props, key) -> { + Object result = Objects.requireNonNull(props).getHeaders().get(key); + if (result == null) { + return null; + } + return String.valueOf(result); + }); + this.consumerTag = consumerTag; + this.envelope = envelope; + this.properties = properties; + this.body = body; + setCarrier(properties); + } + + public String getConsumerTag() { + return consumerTag; + } + + public Envelope getEnvelope() { + return envelope; + } + + public AMQP.BasicProperties getProperties() { + return properties; + } + + public byte[] getBody() { + return body; + } +} diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerConsumeObservationConvention.java b/src/main/java/com/rabbitmq/client/impl/MicrometerConsumeObservationConvention.java new file mode 100644 index 0000000000..01dd6612af --- /dev/null +++ b/src/main/java/com/rabbitmq/client/impl/MicrometerConsumeObservationConvention.java @@ -0,0 +1,34 @@ +/* + * Copyright 2022 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rabbitmq.client.impl; + +import io.micrometer.observation.Observation; +import io.micrometer.observation.ObservationConvention; + +/** + * {@link ObservationConvention} for RabbitMQ client instrumentation. + * + * @since 6.0.0 + * @see DefaultMicrometerPublishObservationConvention + */ +public interface MicrometerConsumeObservationConvention extends ObservationConvention { + + @Override + default boolean supportsContext(Observation.Context context) { + return context instanceof MicrometerConsumeContext; + } + +} diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerMetricsCollector.java b/src/main/java/com/rabbitmq/client/impl/MicrometerMetricsCollector.java index cd8e7b829d..f5000c5362 100644 --- a/src/main/java/com/rabbitmq/client/impl/MicrometerMetricsCollector.java +++ b/src/main/java/com/rabbitmq/client/impl/MicrometerMetricsCollector.java @@ -15,14 +15,22 @@ package com.rabbitmq.client.impl; +import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; +import com.rabbitmq.client.Consumer; +import com.rabbitmq.client.Envelope; import com.rabbitmq.client.MetricsCollector; +import com.rabbitmq.client.ShutdownSignalException; +import io.micrometer.common.lang.Nullable; import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tags; +import io.micrometer.observation.Observation; +import io.micrometer.observation.ObservationRegistry; +import java.io.IOException; import java.util.Collections; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Function; @@ -43,6 +51,8 @@ */ public class MicrometerMetricsCollector extends AbstractMetricsCollector { + private static final String MICROMETER_OBSERVATION_KEY = "micrometer.observation"; + private final AtomicLong connections; private final AtomicLong channels; @@ -63,6 +73,12 @@ public class MicrometerMetricsCollector extends AbstractMetricsCollector { private final Counter rejectedMessages; + private MicrometerPublishObservationConvention publishObservationConvention; + + private MicrometerConsumeObservationConvention consumeObservationConvention; + + private ObservationRegistry observationRegistry = ObservationRegistry.NOOP; + public MicrometerMetricsCollector(MeterRegistry registry) { this(registry, "rabbitmq"); } @@ -152,6 +168,53 @@ protected void markPublishedMessageUnrouted() { unroutedPublishedMessages.increment(); } + @Override + public void basicPrePublish(Channel channel, long deliveryTag, PublishArguments publishArguments) { + if (observationRegistry.isNoop()) { + return; + } + // TODO: Is this for fire and forget or request reply too? If r-r then we have to have 2 contexts + MicrometerPublishContext micrometerPublishContext = new MicrometerPublishContext(publishArguments); + Observation observation = MicrometerRabbitMqObservationDocumentation.PUBLISH_OBSERVATION.observation(this.publishObservationConvention, DefaultMicrometerPublishObservationConvention.INSTANCE, () -> micrometerPublishContext, observationRegistry); + publishArguments.getContext().put(MICROMETER_OBSERVATION_KEY, observation.start()); + publishArguments.setProps(micrometerPublishContext.getPropertiesBuilder().build()); + } + + @Override + public void basicPublishFailure(Channel channel, Exception exception, PublishArguments publishArguments) { + if (observationRegistry.isNoop()) { + super.basicPublishFailure(channel, exception); // TODO: Do we want both the observation and the metrics? + return; + } + Observation observation = getObservation(publishArguments); + if (observation == null) { + return; + } + observation.error(exception); + } + + @Override + public void basicPublish(Channel channel, long deliveryTag, PublishArguments publishArguments) { + if (observationRegistry.isNoop()) { + super.basicPublish(channel, deliveryTag); // TODO: Do we want both the observation and the metrics? + return; + } + Observation observation = getObservation(publishArguments); + if (observation == null) { + return; + } + observation.stop(); + } + + @Override + public Consumer basicPreConsume(Channel channel, String consumerTag, boolean autoAck, AMQCommand amqCommand, Consumer callback) { + return new ObservationConsumer(callback, observationRegistry, consumeObservationConvention); + } + + private static Observation getObservation(PublishArguments publishArguments) { + return (Observation) publishArguments.getContext().get(MICROMETER_OBSERVATION_KEY); + } + public AtomicLong getConnections() { return connections; } @@ -192,6 +255,18 @@ public Counter getRejectedMessages() { return rejectedMessages; } + public void setPublishObservationConvention(MicrometerPublishObservationConvention publishObservationConvention) { + this.publishObservationConvention = publishObservationConvention; + } + + public void setConsumeObservationConvention(MicrometerConsumeObservationConvention consumeObservationConvention) { + this.consumeObservationConvention = consumeObservationConvention; + } + + public void setObservationRegistry(ObservationRegistry observationRegistry) { + this.observationRegistry = observationRegistry; + } + public enum Metrics { CONNECTIONS { @Override @@ -269,4 +344,51 @@ Object create(MeterRegistry registry, String prefix) { } + private static class ObservationConsumer implements Consumer { + + private final Consumer delegate; + + private final ObservationRegistry observationRegistry; + + private final MicrometerConsumeObservationConvention observationConvention; + + ObservationConsumer(Consumer delegate, ObservationRegistry observationRegistry, @Nullable MicrometerConsumeObservationConvention observationConvention) { + this.delegate = delegate; + this.observationRegistry = observationRegistry; + this.observationConvention = observationConvention; + } + + @Override + public void handleConsumeOk(String consumerTag) { + delegate.handleConsumeOk(consumerTag); + } + + @Override + public void handleCancelOk(String consumerTag) { + delegate.handleCancelOk(consumerTag); + } + + @Override + public void handleCancel(String consumerTag) throws IOException { + delegate.handleCancel(consumerTag); + } + + @Override + public void handleShutdownSignal(String consumerTag, ShutdownSignalException sig) { + delegate.handleShutdownSignal(consumerTag, sig); + } + + @Override + public void handleRecoverOk(String consumerTag) { + delegate.handleRecoverOk(consumerTag); + } + + @Override + public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { + MicrometerConsumeContext context = new MicrometerConsumeContext(consumerTag, envelope, properties, body); + Observation observation = MicrometerRabbitMqObservationDocumentation.CONSUME_OBSERVATION.observation(observationConvention, DefaultMicrometerConsumeObservationConvention.INSTANCE, () -> context, observationRegistry); + observation.observeChecked(() -> delegate.handleDelivery(consumerTag, envelope, properties, body)); + } + } + } diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerPublishContext.java b/src/main/java/com/rabbitmq/client/impl/MicrometerPublishContext.java new file mode 100644 index 0000000000..72b1e83c01 --- /dev/null +++ b/src/main/java/com/rabbitmq/client/impl/MicrometerPublishContext.java @@ -0,0 +1,59 @@ +/* + * Copyright 2022 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rabbitmq.client.impl; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +import com.rabbitmq.client.AMQP; +import com.rabbitmq.client.MetricsCollector; +import io.micrometer.observation.transport.SenderContext; + +/** + * {@link io.micrometer.observation.Observation.Context} for use with RabbitMQ client + * {@link io.micrometer.observation.Observation} instrumentation. + * + * @since 6.0.0 + */ +public class MicrometerPublishContext extends SenderContext { + + private final MetricsCollector.PublishArguments publishArguments; + + private final AMQP.BasicProperties.Builder builder; + + public MicrometerPublishContext(MetricsCollector.PublishArguments publishArguments) { + super((basicProperties, key, value) -> { + Map headers = publishArguments.getHeaders(); + headers.put(key, value); + Objects.requireNonNull(basicProperties, "Properties must not be null").headers(headers); + }); + this.publishArguments = publishArguments; + this.builder = publishArguments.getProps().builder(); + if (publishArguments.getProps().getHeaders() == null) { + this.builder.headers(new HashMap<>()); + } + setCarrier(this.builder); + } + + public MetricsCollector.PublishArguments getPublishArguments() { + return publishArguments; + } + + public AMQP.BasicProperties.Builder getPropertiesBuilder() { + return builder; + } +} diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerPublishObservationConvention.java b/src/main/java/com/rabbitmq/client/impl/MicrometerPublishObservationConvention.java new file mode 100644 index 0000000000..8ccb64375f --- /dev/null +++ b/src/main/java/com/rabbitmq/client/impl/MicrometerPublishObservationConvention.java @@ -0,0 +1,36 @@ +/* + * Copyright 2022 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rabbitmq.client.impl; + +import io.micrometer.core.instrument.binder.httpcomponents.ApacheHttpClientContext; +import io.micrometer.core.instrument.binder.httpcomponents.DefaultApacheHttpClientObservationConvention; +import io.micrometer.observation.Observation; +import io.micrometer.observation.ObservationConvention; + +/** + * {@link ObservationConvention} for RabbitMQ client instrumentation. + * + * @since 6.0.0 + * @see DefaultMicrometerPublishObservationConvention + */ +public interface MicrometerPublishObservationConvention extends ObservationConvention { + + @Override + default boolean supportsContext(Observation.Context context) { + return context instanceof MicrometerPublishContext; + } + +} diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerRabbitMqObservationDocumentation.java b/src/main/java/com/rabbitmq/client/impl/MicrometerRabbitMqObservationDocumentation.java new file mode 100644 index 0000000000..63c2a38541 --- /dev/null +++ b/src/main/java/com/rabbitmq/client/impl/MicrometerRabbitMqObservationDocumentation.java @@ -0,0 +1,157 @@ +/* + * Copyright 2022 VMware, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.rabbitmq.client.impl; + +import io.micrometer.common.docs.KeyName; +import io.micrometer.observation.Observation; +import io.micrometer.observation.ObservationConvention; +import io.micrometer.observation.docs.ObservationDocumentation; + +/** + * {@link ObservationDocumentation} for RabbitMQ Clients. + * + * @since 6.0.0 + */ +public enum MicrometerRabbitMqObservationDocumentation implements ObservationDocumentation { + + /** + * Observation for Rabbit Client publishers. + */ + PUBLISH_OBSERVATION { + + @Override + public Class> getDefaultConvention() { + return DefaultMicrometerPublishObservationConvention.class; + } + + @Override + public KeyName[] getLowCardinalityKeyNames() { + return LowCardinalityTags.values(); + } + + }, + + /** + * Observation for Rabbit Client consumers. + */ + CONSUME_OBSERVATION { + + @Override + public Class> getDefaultConvention() { + return DefaultMicrometerConsumeObservationConvention.class; + } + + @Override + public KeyName[] getLowCardinalityKeyNames() { + return LowCardinalityTags.values(); + } + + }; + + // SPAN NAME + // + // topic with spaces process + // (anonymous) publish ((anonymous) being a stable identifier for an unnamed destination) + // (anonymous) receive ((anonymous) being a stable identifier for an unnamed destination) + + // LOW CARDINALITY + // messaging.system = rabbitmq + // messaging.operation = publish + + // HIGH CARDINALITY + + // messaging.rabbitmq.destination.routing_key + // messaging.destination.anonymous + // messaging.destination.name + // messaging.destination.template + // messaging.destination.temporary + // messaging.batch.message_count + // messaging.message.conversation_id + // messaging.message.id + // messaging.message.payload_compressed_size_bytes + // messaging.message.payload_size_bytes + + // net.peer.name + // net.protocol.name + // net.protocol.version + // net.sock.family + // net.sock.peer.addr + // net.sock.peer.name + // net.sock.peer.port + + /** + * Low cardinality tags. + */ + public enum LowCardinalityTags implements KeyName { + + /** + * A string identifying the messaging system. + */ + MESSAGING_SYSTEM { + + @Override + public String asString() { + return "messaging.system"; + } + + }, + + /** + * A string identifying the kind of messaging operation. + */ + MESSAGING_OPERATION { + + @Override + public String asString() { + return "messaging.operation"; + } + + } + + } + + /** + * High cardinality tags. + */ + public enum HighCardinalityTags implements KeyName { + + /** + * The message destination name. + */ + MESSAGING_DESTINATION_NAME { + + @Override + public String asString() { + return "messaging.destination.name"; + } + + }, + + /** + * RabbitMQ message routing key. + */ + MESSAGING_ROUTING_KEY { + + @Override + public String asString() { + return "messaging.rabbitmq.destination.routing_key"; + } + + } + + } + +} diff --git a/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java b/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java index bbf06691e1..eb1ac8d3aa 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java +++ b/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java @@ -76,6 +76,7 @@ Nack.class, ExceptionMessages.class, Metrics.class, + MicrometerMetrics.class, TopologyRecoveryFiltering.class, TopologyRecoveryRetry.class }) diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerMetrics.java new file mode 100644 index 0000000000..1cb0b240f9 --- /dev/null +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerMetrics.java @@ -0,0 +1,144 @@ +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.test.functional; + +import java.io.IOException; +import java.time.Duration; + +import com.rabbitmq.client.AMQP; +import com.rabbitmq.client.Channel; +import com.rabbitmq.client.Connection; +import com.rabbitmq.client.ConnectionFactory; +import com.rabbitmq.client.DefaultConsumer; +import com.rabbitmq.client.Envelope; +import com.rabbitmq.client.impl.MicrometerMetricsCollector; +import com.rabbitmq.client.test.BrokerTestCase; +import com.rabbitmq.client.test.TestUtils; +import io.micrometer.tracing.Span; +import io.micrometer.tracing.Tracer; +import io.micrometer.tracing.test.SampleTestRunner; +import org.junit.jupiter.api.Nested; + +import static com.rabbitmq.client.test.TestUtils.waitAtMost; +import static org.assertj.core.api.Assertions.assertThat; + +public class MicrometerMetrics extends BrokerTestCase { + + static final String QUEUE = "metrics.queue"; + + @Override + protected void createResources() throws IOException { + channel.queueDeclare(QUEUE, true, false, false, null); + } + + @Override + protected void releaseResources() throws IOException { + channel.queueDelete(QUEUE); + } + + + @Nested + class IntegrationTest extends SampleTestRunner { + + @Override + public TracingSetup[] getTracingSetup() { + return new TracingSetup[] { TracingSetup.IN_MEMORY_BRAVE, TracingSetup.ZIPKIN_BRAVE }; + } + + @Override + public SampleTestRunnerConsumer yourCode() throws Exception { + return (buildingBlocks, meterRegistry) -> { + ConnectionFactory connectionFactory = createConnectionFactory(); + MicrometerMetricsCollector collector = new MicrometerMetricsCollector(meterRegistry); + collector.setObservationRegistry(getObservationRegistry()); + connectionFactory.setMetricsCollector(collector); + Connection connection1 = null; + try { + connection1 = connectionFactory.newConnection(); + Channel channel = connection1.createChannel(); + + sendMessage(channel); + + TestingConsumer testingConsumer = new TestingConsumer(channel, buildingBlocks.getTracer(), buildingBlocks.getTracer().currentSpan()); + channel.basicConsume(QUEUE, true, testingConsumer); + waitAtMost(timeout(), () -> testingConsumer.executed); + waitAtMost(timeout(), () -> testingConsumer.assertionsPassed); + getMeterRegistry().get("rabbit.publish") + .tag("messaging.operation", "publish") + .tag("messaging.system", "rabbitmq") + .timer(); + getMeterRegistry().get("rabbit.consume") + .tag("messaging.operation", "publish") + .tag("messaging.system", "rabbitmq") + .timer(); + } finally { + safeClose(connection1); + } + }; + } + } + + private Duration timeout() { + return Duration.ofSeconds(10); + } + + private static ConnectionFactory createConnectionFactory() { + ConnectionFactory connectionFactory = TestUtils.connectionFactory(); + connectionFactory.setAutomaticRecoveryEnabled(false); + return connectionFactory; + } + + private void safeClose(Connection connection) { + if(connection != null) { + try { + connection.abort(); + } catch (Exception e) { + // OK + } + } + } + + private void sendMessage(Channel channel) throws IOException { + channel.basicPublish("", QUEUE, null, "msg".getBytes("UTF-8")); + } + + static class TestingConsumer extends DefaultConsumer { + + volatile boolean executed; + + volatile boolean assertionsPassed; + + private final Tracer tracer; + + private final Span rootSpan; + + public TestingConsumer(Channel channel, Tracer tracer, Span rootSpan) { + super(channel); + this.tracer = tracer; + this.rootSpan = rootSpan; + } + + @Override + public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { + executed = true; + assertThat(tracer.currentSpan()).as("Span must be put in scope").isNotNull(); + assertThat(tracer.currentSpan().context().traceId()).as("Trace id must be propagated").isEqualTo(rootSpan.context().traceId()); + System.out.println("Current span [" + tracer.currentSpan() + "]"); + assertionsPassed = true; + } + } + +} From dcad5f7adb12e4077f26a1b26189fcce0181ec23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 01:13:18 +0000 Subject: [PATCH 281/657] Bump jackson-databind from 2.14.1 to 2.15.0 Bumps [jackson-databind](https://github.com/FasterXML/jackson) from 2.14.1 to 2.15.0. - [Release notes](https://github.com/FasterXML/jackson/releases) - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] (cherry picked from commit 590aa06f6be2da6cbf21ee5ae4fb09e8a132e4b0) --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 293e9fd36d..4074a1d163 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,8 @@ 1.7.36 4.2.19 1.11.1 - 1.27.0 + 1.1.4 + 1.28.0 1.1.4 2.15.2 1.2.12 From 88f27cbca2961b12dcd4aedcc003eee962ea4c13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 2 May 2023 17:34:58 +0200 Subject: [PATCH 282/657] Introduce ObservationCollector (cherry picked from commit 0bd5372b78a85e54545036c1fa25b29e5da0ce2d) --- .../rabbitmq/client/ConnectionFactory.java | 16 +- .../com/rabbitmq/client/MetricsCollector.java | 73 +------- .../rabbitmq/client/impl/AMQConnection.java | 12 +- .../rabbitmq/client/impl/ChannelManager.java | 14 +- .../com/rabbitmq/client/impl/ChannelN.java | 26 +-- ...icrometerConsumeObservationConvention.java | 65 ------- ...icrometerPublishObservationConvention.java | 65 ------- .../client/impl/MicrometerConsumeContext.java | 69 -------- ...icrometerConsumeObservationConvention.java | 34 ---- .../impl/MicrometerMetricsCollector.java | 124 +------------ .../client/impl/MicrometerPublishContext.java | 59 ------- ...icrometerPublishObservationConvention.java | 36 ---- ...meterRabbitMqObservationDocumentation.java | 157 ----------------- .../recovery/AutorecoveringConnection.java | 13 +- .../recovery/RecoveryAwareAMQConnection.java | 13 +- .../RecoveryAwareAMQConnectionFactory.java | 17 +- .../recovery/RecoveryAwareChannelManager.java | 14 +- .../impl/recovery/RecoveryAwareChannelN.java | 12 +- .../observation/NoOpObservationCollector.java | 34 ++++ .../observation/ObservationCollector.java | 39 +++++ .../micrometer/ConsumeContext.java | 53 ++++++ .../ConsumeObservationConvention.java | 33 ++++ .../DefaultConsumeObservationConvention.java | 68 ++++++++ .../DefaultPublishObservationConvention.java | 68 ++++++++ .../MicrometerObservationCollector.java | 162 +++++++++++++++++ ...MicrometerObservationCollectorBuilder.java | 72 ++++++++ .../micrometer/PublishContext.java | 46 +++++ .../PublishObservationConvention.java | 33 ++++ .../RabbitMqObservationDocumentation.java | 134 ++++++++++++++ .../AMQConnectionRefreshCredentialsTest.java | 3 +- .../test/functional/FunctionalTestSuite.java | 2 +- .../test/functional/MicrometerMetrics.java | 144 --------------- ...MicrometerObservationCollectorMetrics.java | 164 ++++++++++++++++++ 33 files changed, 1006 insertions(+), 868 deletions(-) delete mode 100644 src/main/java/com/rabbitmq/client/impl/DefaultMicrometerConsumeObservationConvention.java delete mode 100644 src/main/java/com/rabbitmq/client/impl/DefaultMicrometerPublishObservationConvention.java delete mode 100644 src/main/java/com/rabbitmq/client/impl/MicrometerConsumeContext.java delete mode 100644 src/main/java/com/rabbitmq/client/impl/MicrometerConsumeObservationConvention.java delete mode 100644 src/main/java/com/rabbitmq/client/impl/MicrometerPublishContext.java delete mode 100644 src/main/java/com/rabbitmq/client/impl/MicrometerPublishObservationConvention.java delete mode 100644 src/main/java/com/rabbitmq/client/impl/MicrometerRabbitMqObservationDocumentation.java create mode 100644 src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java create mode 100644 src/main/java/com/rabbitmq/client/observation/ObservationCollector.java create mode 100644 src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java create mode 100644 src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeObservationConvention.java create mode 100644 src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java create mode 100644 src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java create mode 100644 src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java create mode 100644 src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java create mode 100644 src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java create mode 100644 src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java create mode 100644 src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java delete mode 100644 src/test/java/com/rabbitmq/client/test/functional/MicrometerMetrics.java create mode 100644 src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java diff --git a/src/main/java/com/rabbitmq/client/ConnectionFactory.java b/src/main/java/com/rabbitmq/client/ConnectionFactory.java index 92566cb2e5..5a98f3e86b 100644 --- a/src/main/java/com/rabbitmq/client/ConnectionFactory.java +++ b/src/main/java/com/rabbitmq/client/ConnectionFactory.java @@ -22,6 +22,7 @@ import com.rabbitmq.client.impl.recovery.RecoveredQueueNameSupplier; import com.rabbitmq.client.impl.recovery.RetryHandler; import com.rabbitmq.client.impl.recovery.TopologyRecoveryFilter; +import com.rabbitmq.client.observation.ObservationCollector; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -139,6 +140,7 @@ public class ConnectionFactory implements Cloneable { private RecoveryDelayHandler recoveryDelayHandler; private MetricsCollector metricsCollector; + private ObservationCollector observationCollector = ObservationCollector.NO_OP; private boolean nio = false; private FrameHandlerFactory frameHandlerFactory; @@ -952,6 +954,15 @@ public MetricsCollector getMetricsCollector() { return metricsCollector; } + /** + * + * @since 5.18.0 + * @param observationCollector + */ + public void setObservationCollector(ObservationCollector observationCollector) { + this.observationCollector = observationCollector; + } + /** * Set a {@link CredentialsRefreshService} instance to handle credentials refresh if appropriate. *

@@ -1222,7 +1233,8 @@ public Connection newConnection(ExecutorService executor, AddressResolver addres // see com.rabbitmq.client.impl.recovery.RecoveryAwareAMQConnectionFactory#newConnection // No Sonar: no need to close this resource because we're the one that creates it // and hands it over to the user - AutorecoveringConnection conn = new AutorecoveringConnection(params, fhFactory, addressResolver, metricsCollector); //NOSONAR + AutorecoveringConnection conn = new AutorecoveringConnection( + params, fhFactory, addressResolver, metricsCollector, observationCollector); //NOSONAR conn.init(); return conn; @@ -1289,7 +1301,7 @@ public ConnectionParams params(ExecutorService consumerWorkServiceExecutor) { } protected AMQConnection createConnection(ConnectionParams params, FrameHandler frameHandler, MetricsCollector metricsCollector) { - return new AMQConnection(params, frameHandler, metricsCollector); + return new AMQConnection(params, frameHandler, metricsCollector, observationCollector); } /** diff --git a/src/main/java/com/rabbitmq/client/MetricsCollector.java b/src/main/java/com/rabbitmq/client/MetricsCollector.java index b6da5c075b..1790b73b6d 100644 --- a/src/main/java/com/rabbitmq/client/MetricsCollector.java +++ b/src/main/java/com/rabbitmq/client/MetricsCollector.java @@ -15,12 +15,6 @@ package com.rabbitmq.client; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -import com.rabbitmq.client.impl.AMQCommand; - /** * Interface to gather execution data of the client. * Note transactions are not supported: they deal with @@ -70,71 +64,6 @@ default void basicPublishUnrouted(Channel channel) { void basicConsume(Channel channel, String consumerTag, boolean autoAck); - default Consumer basicPreConsume(Channel channel, String consumerTag, boolean autoAck, AMQCommand amqCommand, Consumer callback) { - return callback; - } - void basicCancel(Channel channel, String consumerTag); - default void basicPrePublish(Channel channel, long deliveryTag, PublishArguments publishArguments) { - - } - - default void basicPublishFailure(Channel channel, Exception exception, PublishArguments publishArguments) { - basicPublishFailure(channel, exception); - } - - default void basicPublish(Channel channel, long deliveryTag, PublishArguments publishArguments) { - basicPublish(channel, deliveryTag); - } - - class PublishArguments { - private AMQP.Basic.Publish publish; - - private AMQP.BasicProperties props; - - private byte[] body; - - private final Map headers = new HashMap<>(); - - private final Map context = new HashMap<>(); - - public PublishArguments(AMQP.Basic.Publish publish, AMQP.BasicProperties props, byte[] body) { - this.publish = Objects.requireNonNull(publish); - this.props = Objects.requireNonNull(props); - this.body = Objects.requireNonNull(body); - } - - public AMQP.Basic.Publish getPublish() { - return publish; - } - - public AMQP.BasicProperties getProps() { - return props; - } - - public byte[] getBody() { - return body; - } - - public void setPublish(AMQP.Basic.Publish publish) { - this.publish = publish; - } - - public void setProps(AMQP.BasicProperties props) { - this.props = props; - } - - public void setBody(byte[] body) { - this.body = body; - } - - public Map getContext() { - return context; - } - - public Map getHeaders() { - return headers; - } - } -} +} \ No newline at end of file diff --git a/src/main/java/com/rabbitmq/client/impl/AMQConnection.java b/src/main/java/com/rabbitmq/client/impl/AMQConnection.java index fd1d4531b8..58c5f1e688 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQConnection.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQConnection.java @@ -19,6 +19,7 @@ import com.rabbitmq.client.*; import com.rabbitmq.client.impl.AMQChannel.BlockingRpcContinuation; import com.rabbitmq.client.impl.recovery.RecoveryCanBeginListener; +import com.rabbitmq.client.observation.ObservationCollector; import com.rabbitmq.utility.BlockingCell; import com.rabbitmq.utility.Utility; import org.slf4j.Logger; @@ -140,6 +141,7 @@ public static Map defaultClientProperties() { private final CredentialsProvider credentialsProvider; private final Collection blockedListeners = new CopyOnWriteArrayList(); protected final MetricsCollector metricsCollector; + protected final ObservationCollector observationCollector; private final int channelRpcTimeout; private final boolean channelShouldCheckRpcResponseType; private final TrafficListener trafficListener; @@ -210,13 +212,14 @@ public Map getServerProperties() { } public AMQConnection(ConnectionParams params, FrameHandler frameHandler) { - this(params, frameHandler, new NoOpMetricsCollector()); + this(params, frameHandler, new NoOpMetricsCollector(), ObservationCollector.NO_OP); } /** Construct a new connection * @param params parameters for it */ - public AMQConnection(ConnectionParams params, FrameHandler frameHandler, MetricsCollector metricsCollector) + public AMQConnection(ConnectionParams params, FrameHandler frameHandler, + MetricsCollector metricsCollector, ObservationCollector observationCollector) { checkPreconditions(); this.credentialsProvider = params.getCredentialsProvider(); @@ -255,6 +258,7 @@ public AMQConnection(ConnectionParams params, FrameHandler frameHandler, Metrics this._inConnectionNegotiation = true; // we start out waiting for the first protocol response this.metricsCollector = metricsCollector; + this.observationCollector = observationCollector; this.errorOnWriteListener = params.getErrorOnWriteListener() != null ? params.getErrorOnWriteListener() : (connection, exception) -> { throw exception; }; // we just propagate the exception for non-recoverable connections @@ -484,7 +488,9 @@ public void start() } protected ChannelManager instantiateChannelManager(int channelMax, ThreadFactory threadFactory) { - ChannelManager result = new ChannelManager(this._workService, channelMax, threadFactory, this.metricsCollector); + ChannelManager result = new ChannelManager( + this._workService, channelMax, threadFactory, + this.metricsCollector, this.observationCollector); configureChannelManager(result); return result; } diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelManager.java b/src/main/java/com/rabbitmq/client/impl/ChannelManager.java index fb0490eade..29c814ac41 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelManager.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelManager.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -19,6 +19,7 @@ import com.rabbitmq.client.MetricsCollector; import com.rabbitmq.client.NoOpMetricsCollector; import com.rabbitmq.client.ShutdownSignalException; +import com.rabbitmq.client.observation.ObservationCollector; import com.rabbitmq.utility.IntAllocator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -55,6 +56,7 @@ public class ChannelManager { private int channelShutdownTimeout = (int) ((ConnectionFactory.DEFAULT_HEARTBEAT * AMQConnection.CHANNEL_SHUTDOWN_TIMEOUT_MULTIPLIER) * 1000); protected final MetricsCollector metricsCollector; + protected final ObservationCollector observationCollector; public int getChannelMax(){ return _channelMax; @@ -65,11 +67,13 @@ public ChannelManager(ConsumerWorkService workService, int channelMax) { } public ChannelManager(ConsumerWorkService workService, int channelMax, ThreadFactory threadFactory) { - this(workService, channelMax, threadFactory, new NoOpMetricsCollector()); + this(workService, channelMax, threadFactory, + new NoOpMetricsCollector(), ObservationCollector.NO_OP); } - public ChannelManager(ConsumerWorkService workService, int channelMax, ThreadFactory threadFactory, MetricsCollector metricsCollector) { + public ChannelManager(ConsumerWorkService workService, int channelMax, ThreadFactory threadFactory, + MetricsCollector metricsCollector, ObservationCollector observationCollector) { if (channelMax < 0) throw new IllegalArgumentException("create ChannelManager: 'channelMax' must be greater or equal to 0."); if (channelMax == 0) { @@ -83,6 +87,7 @@ public ChannelManager(ConsumerWorkService workService, int channelMax, ThreadFac this.workService = workService; this.threadFactory = threadFactory; this.metricsCollector = metricsCollector; + this.observationCollector = observationCollector; } /** @@ -214,7 +219,8 @@ private ChannelN addNewChannel(AMQConnection connection, int channelNumber) { } protected ChannelN instantiateChannel(AMQConnection connection, int channelNumber, ConsumerWorkService workService) { - return new ChannelN(connection, channelNumber, workService, this.metricsCollector); + return new ChannelN(connection, channelNumber, workService, + this.metricsCollector, this.observationCollector); } /** diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelN.java b/src/main/java/com/rabbitmq/client/impl/ChannelN.java index a479ba20d9..96bfac0369 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelN.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -22,6 +22,7 @@ import com.rabbitmq.client.impl.AMQImpl.Channel; import com.rabbitmq.client.impl.AMQImpl.Queue; import com.rabbitmq.client.impl.AMQImpl.*; +import com.rabbitmq.client.observation.ObservationCollector; import com.rabbitmq.utility.Utility; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -89,6 +90,7 @@ public class ChannelN extends AMQChannel implements com.rabbitmq.client.Channel private volatile boolean onlyAcksReceived = true; protected final MetricsCollector metricsCollector; + private final ObservationCollector observationCollector; /** * Construct a new channel on the given connection with the given @@ -101,7 +103,8 @@ public class ChannelN extends AMQChannel implements com.rabbitmq.client.Channel */ public ChannelN(AMQConnection connection, int channelNumber, ConsumerWorkService workService) { - this(connection, channelNumber, workService, new NoOpMetricsCollector()); + this(connection, channelNumber, workService, + new NoOpMetricsCollector(), ObservationCollector.NO_OP); } /** @@ -115,10 +118,12 @@ public ChannelN(AMQConnection connection, int channelNumber, * @param metricsCollector service for managing metrics */ public ChannelN(AMQConnection connection, int channelNumber, - ConsumerWorkService workService, MetricsCollector metricsCollector) { + ConsumerWorkService workService, + MetricsCollector metricsCollector, ObservationCollector observationCollector) { super(connection, channelNumber); this.dispatcher = new ConsumerDispatcher(connection, this, workService); this.metricsCollector = metricsCollector; + this.observationCollector = observationCollector; } /** @@ -708,16 +713,17 @@ public void basicPublish(String exchange, String routingKey, .mandatory(mandatory) .immediate(immediate) .build(); - MetricsCollector.PublishArguments args = new MetricsCollector.PublishArguments(publish, props, body); try { - metricsCollector.basicPrePublish(this, deliveryTag, args); - AMQCommand command = new AMQCommand(args.getPublish(), args.getProps(), args.getBody()); - transmit(command); + ObservationCollector.PublishCall publishCall = properties -> { + AMQCommand command = new AMQCommand(publish, properties, body); + transmit(command); + }; + observationCollector.publish(publishCall, publish, props); } catch (IOException | AlreadyClosedException e) { - metricsCollector.basicPublishFailure(this, e, args); + metricsCollector.basicPublishFailure(this, e); throw e; } - metricsCollector.basicPublish(this, deliveryTag, args); + metricsCollector.basicPublish(this, deliveryTag); } /** Public API - {@inheritDoc} */ @@ -1362,7 +1368,7 @@ public String basicConsume(String queue, final boolean autoAck, String consumerT @Override public String transformReply(AMQCommand replyCommand) { String actualConsumerTag = ((Basic.ConsumeOk) replyCommand.getMethod()).getConsumerTag(); - Consumer wrappedCallback = metricsCollector.basicPreConsume(ChannelN.this, actualConsumerTag, autoAck, replyCommand, callback); + Consumer wrappedCallback = observationCollector.basicConsume(callback); _consumers.put(actualConsumerTag, wrappedCallback); // need to register consumer in stats before it actually starts consuming diff --git a/src/main/java/com/rabbitmq/client/impl/DefaultMicrometerConsumeObservationConvention.java b/src/main/java/com/rabbitmq/client/impl/DefaultMicrometerConsumeObservationConvention.java deleted file mode 100644 index c346009d17..0000000000 --- a/src/main/java/com/rabbitmq/client/impl/DefaultMicrometerConsumeObservationConvention.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2022 VMware, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.rabbitmq.client.impl; - -import com.rabbitmq.client.impl.MicrometerRabbitMqObservationDocumentation.HighCardinalityTags; -import com.rabbitmq.client.impl.MicrometerRabbitMqObservationDocumentation.LowCardinalityTags; -import io.micrometer.common.KeyValues; -import io.micrometer.common.util.StringUtils; - -/** - * Default implementation of {@link MicrometerConsumeObservationConvention}. - * - * @since 6.0.0 - * @see MicrometerConsumeObservationConvention - */ -public class DefaultMicrometerConsumeObservationConvention implements MicrometerConsumeObservationConvention { - - /** - * Singleton instance of this convention. - */ - public static final DefaultMicrometerConsumeObservationConvention INSTANCE = new DefaultMicrometerConsumeObservationConvention(); - - // There is no need to instantiate this class multiple times, but it may be extended, - // hence protected visibility. - protected DefaultMicrometerConsumeObservationConvention() { - } - - @Override - public String getName() { - return "rabbit.consume"; // TODO: How should we call this - } - - @Override - public String getContextualName(MicrometerConsumeContext context) { - return destination(context.getEnvelope().getRoutingKey()) + " consume"; - } - - private String destination(String destination) { - return StringUtils.isNotBlank(destination) ? destination : "(anonymous)"; - } - - @Override - public KeyValues getLowCardinalityKeyValues(MicrometerConsumeContext context) { - return KeyValues.of(LowCardinalityTags.MESSAGING_OPERATION.withValue("publish"), LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq")); - } - - @Override - public KeyValues getHighCardinalityKeyValues(MicrometerConsumeContext context) { - return KeyValues.of(HighCardinalityTags.MESSAGING_ROUTING_KEY.withValue(context.getEnvelope().getRoutingKey()), HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(context.getEnvelope().getExchange())); - } - -} diff --git a/src/main/java/com/rabbitmq/client/impl/DefaultMicrometerPublishObservationConvention.java b/src/main/java/com/rabbitmq/client/impl/DefaultMicrometerPublishObservationConvention.java deleted file mode 100644 index 4dc04e2d4a..0000000000 --- a/src/main/java/com/rabbitmq/client/impl/DefaultMicrometerPublishObservationConvention.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2022 VMware, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.rabbitmq.client.impl; - -import com.rabbitmq.client.impl.MicrometerRabbitMqObservationDocumentation.HighCardinalityTags; -import com.rabbitmq.client.impl.MicrometerRabbitMqObservationDocumentation.LowCardinalityTags; -import io.micrometer.common.KeyValues; -import io.micrometer.common.util.StringUtils; - -/** - * Default implementation of {@link MicrometerPublishObservationConvention}. - * - * @since 6.0.0 - * @see MicrometerRabbitMqObservationDocumentation - */ -public class DefaultMicrometerPublishObservationConvention implements MicrometerPublishObservationConvention { - - /** - * Singleton instance of this convention. - */ - public static final DefaultMicrometerPublishObservationConvention INSTANCE = new DefaultMicrometerPublishObservationConvention(); - - // There is no need to instantiate this class multiple times, but it may be extended, - // hence protected visibility. - protected DefaultMicrometerPublishObservationConvention() { - } - - @Override - public String getName() { - return "rabbit.publish"; // TODO: How should we call this - } - - @Override - public String getContextualName(MicrometerPublishContext context) { - return destination(context.getPublishArguments().getPublish().getRoutingKey()) + " publish"; - } - - private String destination(String destination) { - return StringUtils.isNotBlank(destination) ? destination : "(anonymous)"; - } - - @Override - public KeyValues getLowCardinalityKeyValues(MicrometerPublishContext context) { - return KeyValues.of(LowCardinalityTags.MESSAGING_OPERATION.withValue("publish"), LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq")); - } - - @Override - public KeyValues getHighCardinalityKeyValues(MicrometerPublishContext context) { - return KeyValues.of(HighCardinalityTags.MESSAGING_ROUTING_KEY.withValue(context.getPublishArguments().getPublish().getRoutingKey()), HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(context.getPublishArguments().getPublish().getExchange())); - } - -} diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerConsumeContext.java b/src/main/java/com/rabbitmq/client/impl/MicrometerConsumeContext.java deleted file mode 100644 index c141c2eb32..0000000000 --- a/src/main/java/com/rabbitmq/client/impl/MicrometerConsumeContext.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2022 VMware, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.rabbitmq.client.impl; - -import java.util.Objects; - -import com.rabbitmq.client.AMQP; -import com.rabbitmq.client.Envelope; -import io.micrometer.observation.transport.ReceiverContext; - -/** - * {@link io.micrometer.observation.Observation.Context} for use with RabbitMQ client - * {@link io.micrometer.observation.Observation} instrumentation. - * - * @since 6.0.0 - */ -public class MicrometerConsumeContext extends ReceiverContext { - - private final String consumerTag; - private final Envelope envelope; - - private final AMQP.BasicProperties properties; - - private final byte[] body; - - public MicrometerConsumeContext(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) { - super((props, key) -> { - Object result = Objects.requireNonNull(props).getHeaders().get(key); - if (result == null) { - return null; - } - return String.valueOf(result); - }); - this.consumerTag = consumerTag; - this.envelope = envelope; - this.properties = properties; - this.body = body; - setCarrier(properties); - } - - public String getConsumerTag() { - return consumerTag; - } - - public Envelope getEnvelope() { - return envelope; - } - - public AMQP.BasicProperties getProperties() { - return properties; - } - - public byte[] getBody() { - return body; - } -} diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerConsumeObservationConvention.java b/src/main/java/com/rabbitmq/client/impl/MicrometerConsumeObservationConvention.java deleted file mode 100644 index 01dd6612af..0000000000 --- a/src/main/java/com/rabbitmq/client/impl/MicrometerConsumeObservationConvention.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2022 VMware, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.rabbitmq.client.impl; - -import io.micrometer.observation.Observation; -import io.micrometer.observation.ObservationConvention; - -/** - * {@link ObservationConvention} for RabbitMQ client instrumentation. - * - * @since 6.0.0 - * @see DefaultMicrometerPublishObservationConvention - */ -public interface MicrometerConsumeObservationConvention extends ObservationConvention { - - @Override - default boolean supportsContext(Observation.Context context) { - return context instanceof MicrometerConsumeContext; - } - -} diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerMetricsCollector.java b/src/main/java/com/rabbitmq/client/impl/MicrometerMetricsCollector.java index f5000c5362..3713720c45 100644 --- a/src/main/java/com/rabbitmq/client/impl/MicrometerMetricsCollector.java +++ b/src/main/java/com/rabbitmq/client/impl/MicrometerMetricsCollector.java @@ -15,22 +15,14 @@ package com.rabbitmq.client.impl; -import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Channel; import com.rabbitmq.client.Connection; -import com.rabbitmq.client.Consumer; -import com.rabbitmq.client.Envelope; import com.rabbitmq.client.MetricsCollector; -import com.rabbitmq.client.ShutdownSignalException; -import io.micrometer.common.lang.Nullable; import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Tag; import io.micrometer.core.instrument.Tags; -import io.micrometer.observation.Observation; -import io.micrometer.observation.ObservationRegistry; -import java.io.IOException; import java.util.Collections; import java.util.concurrent.atomic.AtomicLong; import java.util.function.Function; @@ -51,8 +43,6 @@ */ public class MicrometerMetricsCollector extends AbstractMetricsCollector { - private static final String MICROMETER_OBSERVATION_KEY = "micrometer.observation"; - private final AtomicLong connections; private final AtomicLong channels; @@ -73,12 +63,6 @@ public class MicrometerMetricsCollector extends AbstractMetricsCollector { private final Counter rejectedMessages; - private MicrometerPublishObservationConvention publishObservationConvention; - - private MicrometerConsumeObservationConvention consumeObservationConvention; - - private ObservationRegistry observationRegistry = ObservationRegistry.NOOP; - public MicrometerMetricsCollector(MeterRegistry registry) { this(registry, "rabbitmq"); } @@ -168,53 +152,6 @@ protected void markPublishedMessageUnrouted() { unroutedPublishedMessages.increment(); } - @Override - public void basicPrePublish(Channel channel, long deliveryTag, PublishArguments publishArguments) { - if (observationRegistry.isNoop()) { - return; - } - // TODO: Is this for fire and forget or request reply too? If r-r then we have to have 2 contexts - MicrometerPublishContext micrometerPublishContext = new MicrometerPublishContext(publishArguments); - Observation observation = MicrometerRabbitMqObservationDocumentation.PUBLISH_OBSERVATION.observation(this.publishObservationConvention, DefaultMicrometerPublishObservationConvention.INSTANCE, () -> micrometerPublishContext, observationRegistry); - publishArguments.getContext().put(MICROMETER_OBSERVATION_KEY, observation.start()); - publishArguments.setProps(micrometerPublishContext.getPropertiesBuilder().build()); - } - - @Override - public void basicPublishFailure(Channel channel, Exception exception, PublishArguments publishArguments) { - if (observationRegistry.isNoop()) { - super.basicPublishFailure(channel, exception); // TODO: Do we want both the observation and the metrics? - return; - } - Observation observation = getObservation(publishArguments); - if (observation == null) { - return; - } - observation.error(exception); - } - - @Override - public void basicPublish(Channel channel, long deliveryTag, PublishArguments publishArguments) { - if (observationRegistry.isNoop()) { - super.basicPublish(channel, deliveryTag); // TODO: Do we want both the observation and the metrics? - return; - } - Observation observation = getObservation(publishArguments); - if (observation == null) { - return; - } - observation.stop(); - } - - @Override - public Consumer basicPreConsume(Channel channel, String consumerTag, boolean autoAck, AMQCommand amqCommand, Consumer callback) { - return new ObservationConsumer(callback, observationRegistry, consumeObservationConvention); - } - - private static Observation getObservation(PublishArguments publishArguments) { - return (Observation) publishArguments.getContext().get(MICROMETER_OBSERVATION_KEY); - } - public AtomicLong getConnections() { return connections; } @@ -255,18 +192,6 @@ public Counter getRejectedMessages() { return rejectedMessages; } - public void setPublishObservationConvention(MicrometerPublishObservationConvention publishObservationConvention) { - this.publishObservationConvention = publishObservationConvention; - } - - public void setConsumeObservationConvention(MicrometerConsumeObservationConvention consumeObservationConvention) { - this.consumeObservationConvention = consumeObservationConvention; - } - - public void setObservationRegistry(ObservationRegistry observationRegistry) { - this.observationRegistry = observationRegistry; - } - public enum Metrics { CONNECTIONS { @Override @@ -344,51 +269,4 @@ Object create(MeterRegistry registry, String prefix) { } - private static class ObservationConsumer implements Consumer { - - private final Consumer delegate; - - private final ObservationRegistry observationRegistry; - - private final MicrometerConsumeObservationConvention observationConvention; - - ObservationConsumer(Consumer delegate, ObservationRegistry observationRegistry, @Nullable MicrometerConsumeObservationConvention observationConvention) { - this.delegate = delegate; - this.observationRegistry = observationRegistry; - this.observationConvention = observationConvention; - } - - @Override - public void handleConsumeOk(String consumerTag) { - delegate.handleConsumeOk(consumerTag); - } - - @Override - public void handleCancelOk(String consumerTag) { - delegate.handleCancelOk(consumerTag); - } - - @Override - public void handleCancel(String consumerTag) throws IOException { - delegate.handleCancel(consumerTag); - } - - @Override - public void handleShutdownSignal(String consumerTag, ShutdownSignalException sig) { - delegate.handleShutdownSignal(consumerTag, sig); - } - - @Override - public void handleRecoverOk(String consumerTag) { - delegate.handleRecoverOk(consumerTag); - } - - @Override - public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { - MicrometerConsumeContext context = new MicrometerConsumeContext(consumerTag, envelope, properties, body); - Observation observation = MicrometerRabbitMqObservationDocumentation.CONSUME_OBSERVATION.observation(observationConvention, DefaultMicrometerConsumeObservationConvention.INSTANCE, () -> context, observationRegistry); - observation.observeChecked(() -> delegate.handleDelivery(consumerTag, envelope, properties, body)); - } - } - -} +} \ No newline at end of file diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerPublishContext.java b/src/main/java/com/rabbitmq/client/impl/MicrometerPublishContext.java deleted file mode 100644 index 72b1e83c01..0000000000 --- a/src/main/java/com/rabbitmq/client/impl/MicrometerPublishContext.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2022 VMware, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.rabbitmq.client.impl; - -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -import com.rabbitmq.client.AMQP; -import com.rabbitmq.client.MetricsCollector; -import io.micrometer.observation.transport.SenderContext; - -/** - * {@link io.micrometer.observation.Observation.Context} for use with RabbitMQ client - * {@link io.micrometer.observation.Observation} instrumentation. - * - * @since 6.0.0 - */ -public class MicrometerPublishContext extends SenderContext { - - private final MetricsCollector.PublishArguments publishArguments; - - private final AMQP.BasicProperties.Builder builder; - - public MicrometerPublishContext(MetricsCollector.PublishArguments publishArguments) { - super((basicProperties, key, value) -> { - Map headers = publishArguments.getHeaders(); - headers.put(key, value); - Objects.requireNonNull(basicProperties, "Properties must not be null").headers(headers); - }); - this.publishArguments = publishArguments; - this.builder = publishArguments.getProps().builder(); - if (publishArguments.getProps().getHeaders() == null) { - this.builder.headers(new HashMap<>()); - } - setCarrier(this.builder); - } - - public MetricsCollector.PublishArguments getPublishArguments() { - return publishArguments; - } - - public AMQP.BasicProperties.Builder getPropertiesBuilder() { - return builder; - } -} diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerPublishObservationConvention.java b/src/main/java/com/rabbitmq/client/impl/MicrometerPublishObservationConvention.java deleted file mode 100644 index 8ccb64375f..0000000000 --- a/src/main/java/com/rabbitmq/client/impl/MicrometerPublishObservationConvention.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2022 VMware, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.rabbitmq.client.impl; - -import io.micrometer.core.instrument.binder.httpcomponents.ApacheHttpClientContext; -import io.micrometer.core.instrument.binder.httpcomponents.DefaultApacheHttpClientObservationConvention; -import io.micrometer.observation.Observation; -import io.micrometer.observation.ObservationConvention; - -/** - * {@link ObservationConvention} for RabbitMQ client instrumentation. - * - * @since 6.0.0 - * @see DefaultMicrometerPublishObservationConvention - */ -public interface MicrometerPublishObservationConvention extends ObservationConvention { - - @Override - default boolean supportsContext(Observation.Context context) { - return context instanceof MicrometerPublishContext; - } - -} diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerRabbitMqObservationDocumentation.java b/src/main/java/com/rabbitmq/client/impl/MicrometerRabbitMqObservationDocumentation.java deleted file mode 100644 index 63c2a38541..0000000000 --- a/src/main/java/com/rabbitmq/client/impl/MicrometerRabbitMqObservationDocumentation.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2022 VMware, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.rabbitmq.client.impl; - -import io.micrometer.common.docs.KeyName; -import io.micrometer.observation.Observation; -import io.micrometer.observation.ObservationConvention; -import io.micrometer.observation.docs.ObservationDocumentation; - -/** - * {@link ObservationDocumentation} for RabbitMQ Clients. - * - * @since 6.0.0 - */ -public enum MicrometerRabbitMqObservationDocumentation implements ObservationDocumentation { - - /** - * Observation for Rabbit Client publishers. - */ - PUBLISH_OBSERVATION { - - @Override - public Class> getDefaultConvention() { - return DefaultMicrometerPublishObservationConvention.class; - } - - @Override - public KeyName[] getLowCardinalityKeyNames() { - return LowCardinalityTags.values(); - } - - }, - - /** - * Observation for Rabbit Client consumers. - */ - CONSUME_OBSERVATION { - - @Override - public Class> getDefaultConvention() { - return DefaultMicrometerConsumeObservationConvention.class; - } - - @Override - public KeyName[] getLowCardinalityKeyNames() { - return LowCardinalityTags.values(); - } - - }; - - // SPAN NAME - // - // topic with spaces process - // (anonymous) publish ((anonymous) being a stable identifier for an unnamed destination) - // (anonymous) receive ((anonymous) being a stable identifier for an unnamed destination) - - // LOW CARDINALITY - // messaging.system = rabbitmq - // messaging.operation = publish - - // HIGH CARDINALITY - - // messaging.rabbitmq.destination.routing_key - // messaging.destination.anonymous - // messaging.destination.name - // messaging.destination.template - // messaging.destination.temporary - // messaging.batch.message_count - // messaging.message.conversation_id - // messaging.message.id - // messaging.message.payload_compressed_size_bytes - // messaging.message.payload_size_bytes - - // net.peer.name - // net.protocol.name - // net.protocol.version - // net.sock.family - // net.sock.peer.addr - // net.sock.peer.name - // net.sock.peer.port - - /** - * Low cardinality tags. - */ - public enum LowCardinalityTags implements KeyName { - - /** - * A string identifying the messaging system. - */ - MESSAGING_SYSTEM { - - @Override - public String asString() { - return "messaging.system"; - } - - }, - - /** - * A string identifying the kind of messaging operation. - */ - MESSAGING_OPERATION { - - @Override - public String asString() { - return "messaging.operation"; - } - - } - - } - - /** - * High cardinality tags. - */ - public enum HighCardinalityTags implements KeyName { - - /** - * The message destination name. - */ - MESSAGING_DESTINATION_NAME { - - @Override - public String asString() { - return "messaging.destination.name"; - } - - }, - - /** - * RabbitMQ message routing key. - */ - MESSAGING_ROUTING_KEY { - - @Override - public String asString() { - return "messaging.rabbitmq.destination.routing_key"; - } - - } - - } - -} diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java b/src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java index 743fdd8958..70004ae749 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -20,6 +20,7 @@ import com.rabbitmq.client.impl.ConnectionParams; import com.rabbitmq.client.impl.FrameHandlerFactory; import com.rabbitmq.client.impl.NetworkConnection; +import com.rabbitmq.client.observation.ObservationCollector; import com.rabbitmq.utility.Utility; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -104,11 +105,15 @@ public AutorecoveringConnection(ConnectionParams params, FrameHandlerFactory f, } public AutorecoveringConnection(ConnectionParams params, FrameHandlerFactory f, AddressResolver addressResolver) { - this(params, f, addressResolver, new NoOpMetricsCollector()); + this(params, f, addressResolver, new NoOpMetricsCollector(), ObservationCollector.NO_OP); } - public AutorecoveringConnection(ConnectionParams params, FrameHandlerFactory f, AddressResolver addressResolver, MetricsCollector metricsCollector) { - this.cf = new RecoveryAwareAMQConnectionFactory(params, f, addressResolver, metricsCollector); + public AutorecoveringConnection(ConnectionParams params, FrameHandlerFactory f, AddressResolver addressResolver, + MetricsCollector metricsCollector, ObservationCollector observationCollector) { + this.cf = new RecoveryAwareAMQConnectionFactory( + params, f, addressResolver, + metricsCollector, observationCollector + ); this.params = params; this.connectionRecoveryTriggeringCondition = params.getConnectionRecoveryTriggeringCondition() == null ? diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnection.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnection.java index 251f0aaaa1..7060407363 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnection.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -19,6 +19,7 @@ import com.rabbitmq.client.impl.AMQConnection; import com.rabbitmq.client.impl.ConnectionParams; import com.rabbitmq.client.impl.FrameHandler; +import com.rabbitmq.client.observation.ObservationCollector; import java.util.concurrent.ThreadFactory; @@ -28,8 +29,9 @@ */ public class RecoveryAwareAMQConnection extends AMQConnection { - public RecoveryAwareAMQConnection(ConnectionParams params, FrameHandler handler, MetricsCollector metricsCollector) { - super(params, handler, metricsCollector); + public RecoveryAwareAMQConnection(ConnectionParams params, FrameHandler handler, + MetricsCollector metricsCollector, ObservationCollector observationCollector) { + super(params, handler, metricsCollector, observationCollector); } public RecoveryAwareAMQConnection(ConnectionParams params, FrameHandler handler) { @@ -38,8 +40,9 @@ public RecoveryAwareAMQConnection(ConnectionParams params, FrameHandler handler) @Override protected RecoveryAwareChannelManager instantiateChannelManager(int channelMax, ThreadFactory threadFactory) { - RecoveryAwareChannelManager recoveryAwareChannelManager = new RecoveryAwareChannelManager(super._workService, channelMax, threadFactory, - this.metricsCollector); + RecoveryAwareChannelManager recoveryAwareChannelManager = new RecoveryAwareChannelManager( + super._workService, channelMax, threadFactory, + this.metricsCollector, this.observationCollector); configureChannelManager(recoveryAwareChannelManager); return recoveryAwareChannelManager; } diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnectionFactory.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnectionFactory.java index 0dc677363f..535330c24e 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnectionFactory.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnectionFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -19,6 +19,7 @@ import com.rabbitmq.client.impl.ConnectionParams; import com.rabbitmq.client.impl.FrameHandler; import com.rabbitmq.client.impl.FrameHandlerFactory; +import com.rabbitmq.client.observation.ObservationCollector; import java.io.IOException; import java.util.ArrayList; @@ -32,20 +33,25 @@ public class RecoveryAwareAMQConnectionFactory { private final FrameHandlerFactory factory; private final AddressResolver addressResolver; private final MetricsCollector metricsCollector; + private final ObservationCollector observationCollector; public RecoveryAwareAMQConnectionFactory(ConnectionParams params, FrameHandlerFactory factory, List

addrs) { - this(params, factory, new ListAddressResolver(addrs), new NoOpMetricsCollector()); + this(params, factory, new ListAddressResolver(addrs), new NoOpMetricsCollector(), + ObservationCollector.NO_OP); } public RecoveryAwareAMQConnectionFactory(ConnectionParams params, FrameHandlerFactory factory, AddressResolver addressResolver) { - this(params, factory, addressResolver, new NoOpMetricsCollector()); + this(params, factory, addressResolver, new NoOpMetricsCollector(), + ObservationCollector.NO_OP); } - public RecoveryAwareAMQConnectionFactory(ConnectionParams params, FrameHandlerFactory factory, AddressResolver addressResolver, MetricsCollector metricsCollector) { + public RecoveryAwareAMQConnectionFactory(ConnectionParams params, FrameHandlerFactory factory, AddressResolver addressResolver, + MetricsCollector metricsCollector, ObservationCollector observationCollector) { this.params = params; this.factory = factory; this.addressResolver = addressResolver; this.metricsCollector = metricsCollector; + this.observationCollector = observationCollector; } /** @@ -83,7 +89,8 @@ public RecoveryAwareAMQConnection newConnection() throws IOException, TimeoutExc } protected RecoveryAwareAMQConnection createConnection(ConnectionParams params, FrameHandler handler, MetricsCollector metricsCollector) { - return new RecoveryAwareAMQConnection(params, handler, metricsCollector); + return new RecoveryAwareAMQConnection(params, handler, metricsCollector, + this.observationCollector); } private String connectionName() { diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelManager.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelManager.java index d8aa7123cb..d4208d340b 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelManager.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelManager.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -21,6 +21,7 @@ import com.rabbitmq.client.impl.ChannelManager; import com.rabbitmq.client.impl.ChannelN; import com.rabbitmq.client.impl.ConsumerWorkService; +import com.rabbitmq.client.observation.ObservationCollector; import java.util.concurrent.Executors; import java.util.concurrent.ThreadFactory; @@ -34,15 +35,18 @@ public RecoveryAwareChannelManager(ConsumerWorkService workService, int channelM } public RecoveryAwareChannelManager(ConsumerWorkService workService, int channelMax, ThreadFactory threadFactory) { - super(workService, channelMax, threadFactory, new NoOpMetricsCollector()); + super(workService, channelMax, threadFactory, new NoOpMetricsCollector(), ObservationCollector.NO_OP); } - public RecoveryAwareChannelManager(ConsumerWorkService workService, int channelMax, ThreadFactory threadFactory, MetricsCollector metricsCollector) { - super(workService, channelMax, threadFactory, metricsCollector); + public RecoveryAwareChannelManager(ConsumerWorkService workService, int channelMax, + ThreadFactory threadFactory, MetricsCollector metricsCollector, + ObservationCollector observationCollector) { + super(workService, channelMax, threadFactory, metricsCollector, observationCollector); } @Override protected ChannelN instantiateChannel(AMQConnection connection, int channelNumber, ConsumerWorkService workService) { - return new RecoveryAwareChannelN(connection, channelNumber, workService, this.metricsCollector); + return new RecoveryAwareChannelN(connection, channelNumber, workService, + this.metricsCollector, this.observationCollector); } } diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelN.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelN.java index 01cf1c74ee..f4ddd97330 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelN.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -23,6 +23,7 @@ import com.rabbitmq.client.impl.ChannelN; import com.rabbitmq.client.impl.ConsumerWorkService; import com.rabbitmq.client.impl.AMQImpl.Basic; +import com.rabbitmq.client.observation.ObservationCollector; import java.io.IOException; @@ -47,7 +48,8 @@ public class RecoveryAwareChannelN extends ChannelN { * @param workService service for managing this channel's consumer callbacks */ public RecoveryAwareChannelN(AMQConnection connection, int channelNumber, ConsumerWorkService workService) { - this(connection, channelNumber, workService, new NoOpMetricsCollector()); + this(connection, channelNumber, workService, new NoOpMetricsCollector(), + ObservationCollector.NO_OP); } /** @@ -60,8 +62,10 @@ public RecoveryAwareChannelN(AMQConnection connection, int channelNumber, Consum * @param workService service for managing this channel's consumer callbacks * @param metricsCollector service for managing metrics */ - public RecoveryAwareChannelN(AMQConnection connection, int channelNumber, ConsumerWorkService workService, MetricsCollector metricsCollector) { - super(connection, channelNumber, workService, metricsCollector); + public RecoveryAwareChannelN(AMQConnection connection, int channelNumber, ConsumerWorkService workService, + MetricsCollector metricsCollector, ObservationCollector observationCollector) { + super(connection, channelNumber, workService, + metricsCollector, observationCollector); } @Override diff --git a/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java new file mode 100644 index 0000000000..338a4a0480 --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java @@ -0,0 +1,34 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation; + +import com.rabbitmq.client.AMQP; +import com.rabbitmq.client.Consumer; +import java.io.IOException; + +final class NoOpObservationCollector implements ObservationCollector { + + @Override + public void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProperties properties) + throws IOException { + call.publish(properties); + } + + @Override + public Consumer basicConsume(Consumer consumer) { + return consumer; + } +} diff --git a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java new file mode 100644 index 0000000000..1196df818c --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java @@ -0,0 +1,39 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation; + +import com.rabbitmq.client.AMQP; +import com.rabbitmq.client.Consumer; +import java.io.IOException; + +/** + * + * @since 5.18.0 + */ +public interface ObservationCollector { + + ObservationCollector NO_OP = new NoOpObservationCollector(); + + void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProperties properties) + throws IOException; + + Consumer basicConsume(Consumer consumer); + + interface PublishCall { + + void publish(AMQP.BasicProperties properties) throws IOException; + } +} diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java new file mode 100644 index 0000000000..c1f33f2dc2 --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java @@ -0,0 +1,53 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation.micrometer; + +import io.micrometer.observation.transport.ReceiverContext; +import java.util.Map; + +/** + * {@link io.micrometer.observation.Observation.Context} for use with RabbitMQ client {@link + * io.micrometer.observation.Observation} instrumentation. + * + * @since 5.18.0 + */ +public class ConsumeContext extends ReceiverContext> { + + private final String exchange; + private final String routingKey; + + ConsumeContext(String exchange, String routingKey, Map headers) { + super( + (hdrs, key) -> { + Object result = hdrs.get(key); + if (result == null) { + return null; + } + return String.valueOf(result); + }); + this.exchange = exchange; + this.routingKey = routingKey; + setCarrier(headers); + } + + public String getExchange() { + return exchange; + } + + public String getRoutingKey() { + return routingKey; + } +} diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeObservationConvention.java new file mode 100644 index 0000000000..38ce2aa333 --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeObservationConvention.java @@ -0,0 +1,33 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation.micrometer; + +import io.micrometer.observation.Observation; +import io.micrometer.observation.ObservationConvention; + +/** + * {@link ObservationConvention} for RabbitMQ client instrumentation. + * + * @since 5.18.0 + * @see DefaultPublishObservationConvention + */ +public interface ConsumeObservationConvention extends ObservationConvention { + + @Override + default boolean supportsContext(Observation.Context context) { + return context instanceof ConsumeContext; + } +} diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java new file mode 100644 index 0000000000..50fcad31a0 --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java @@ -0,0 +1,68 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation.micrometer; + +import com.rabbitmq.client.observation.micrometer.RabbitMqObservationDocumentation.HighCardinalityTags; +import com.rabbitmq.client.observation.micrometer.RabbitMqObservationDocumentation.LowCardinalityTags; +import io.micrometer.common.KeyValues; +import io.micrometer.common.util.StringUtils; + +/** + * Default implementation of {@link ConsumeObservationConvention}. + * + * @since 5.18.0 + * @see ConsumeObservationConvention + */ +public class DefaultConsumeObservationConvention implements ConsumeObservationConvention { + + private final String name; + + public DefaultConsumeObservationConvention() { + this("rabbitmq.consume"); + } + + public DefaultConsumeObservationConvention(String name) { + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getContextualName(ConsumeContext context) { + return destination(context.getRoutingKey()) + " consume"; + } + + private String destination(String destination) { + return StringUtils.isNotBlank(destination) ? destination : "(anonymous)"; + } + + @Override + public KeyValues getLowCardinalityKeyValues(ConsumeContext context) { + return KeyValues.of( + LowCardinalityTags.MESSAGING_OPERATION.withValue("publish"), + LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq")); + } + + @Override + public KeyValues getHighCardinalityKeyValues(ConsumeContext context) { + return KeyValues.of( + HighCardinalityTags.MESSAGING_ROUTING_KEY.withValue(context.getRoutingKey()), + HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(context.getExchange())); + } +} diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java new file mode 100644 index 0000000000..cc60a39ebd --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java @@ -0,0 +1,68 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation.micrometer; + +import com.rabbitmq.client.observation.micrometer.RabbitMqObservationDocumentation.HighCardinalityTags; +import com.rabbitmq.client.observation.micrometer.RabbitMqObservationDocumentation.LowCardinalityTags; +import io.micrometer.common.KeyValues; +import io.micrometer.common.util.StringUtils; + +/** + * Default implementation of {@link PublishObservationConvention}. + * + * @since 5.18.0 + * @see RabbitMqObservationDocumentation + */ +public class DefaultPublishObservationConvention implements PublishObservationConvention { + + private final String name; + + public DefaultPublishObservationConvention() { + this("rabbitmq.publish"); + } + + public DefaultPublishObservationConvention(String name) { + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getContextualName(PublishContext context) { + return destination(context.getRoutingKey()) + " publish"; + } + + private String destination(String destination) { + return StringUtils.isNotBlank(destination) ? destination : "(anonymous)"; + } + + @Override + public KeyValues getLowCardinalityKeyValues(PublishContext context) { + return KeyValues.of( + LowCardinalityTags.MESSAGING_OPERATION.withValue("publish"), + LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq")); + } + + @Override + public KeyValues getHighCardinalityKeyValues(PublishContext context) { + return KeyValues.of( + HighCardinalityTags.MESSAGING_ROUTING_KEY.withValue(context.getRoutingKey()), + HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(context.getExchange())); + } +} diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java new file mode 100644 index 0000000000..83b17913fb --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -0,0 +1,162 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation.micrometer; + +import com.rabbitmq.client.*; +import com.rabbitmq.client.observation.ObservationCollector; +import io.micrometer.observation.Observation; +import io.micrometer.observation.ObservationRegistry; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +class MicrometerObservationCollector implements ObservationCollector { + + private final ObservationRegistry registry; + + private final PublishObservationConvention customPublishConvention, defaultPublishConvention; + private final ConsumeObservationConvention customConsumeConvention, defaultConsumeConvention; + + MicrometerObservationCollector( + ObservationRegistry registry, + PublishObservationConvention customPublishConvention, + PublishObservationConvention defaultPublishConvention, + ConsumeObservationConvention customConsumeConvention, + ConsumeObservationConvention defaultConsumeConvention) { + this.registry = registry; + this.customPublishConvention = customPublishConvention; + this.defaultPublishConvention = defaultPublishConvention; + this.customConsumeConvention = customConsumeConvention; + this.defaultConsumeConvention = defaultConsumeConvention; + } + + @Override + public void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProperties properties) + throws IOException { + // TODO: Is this for fire and forget or request reply too? If r-r then we have to have 2 + // contexts + Map headers; + if (properties.getHeaders() == null) { + headers = new HashMap<>(); + } else { + headers = new HashMap<>(properties.getHeaders()); + } + PublishContext micrometerPublishContext = + new PublishContext(publish.getExchange(), publish.getRoutingKey(), headers); + AMQP.BasicProperties.Builder builder = properties.builder(); + builder.headers(headers); + // TODO give possibility to create the publish observation + // the custom convention is already a property, the default convention could be a property as + // well. + // the name (in default convention) could also be set in a simple way, from the base + // configuration + // no need to give access to the other 2 parameters + Observation observation = + RabbitMqObservationDocumentation.PUBLISH_OBSERVATION.observation( + this.customPublishConvention, + this.defaultPublishConvention, + () -> micrometerPublishContext, + registry); + observation.start(); + try { + call.publish(builder.build()); + } catch (IOException | AlreadyClosedException e) { + observation.error(e); + throw e; + } + observation.stop(); + } + + @Override + public Consumer basicConsume(Consumer consumer) { + return new ObservationConsumer( + consumer, this.registry, this.customConsumeConvention, this.defaultConsumeConvention); + } + + private static class ObservationConsumer implements Consumer { + + private final Consumer delegate; + + private final ObservationRegistry observationRegistry; + + private final ConsumeObservationConvention customConsumeConvention, defaultConsumeConvention; + + private ObservationConsumer( + Consumer delegate, + ObservationRegistry observationRegistry, + ConsumeObservationConvention customConsumeConvention, + ConsumeObservationConvention defaultConsumeConvention) { + this.delegate = delegate; + this.observationRegistry = observationRegistry; + this.customConsumeConvention = customConsumeConvention; + this.defaultConsumeConvention = defaultConsumeConvention; + } + + @Override + public void handleConsumeOk(String consumerTag) { + delegate.handleConsumeOk(consumerTag); + } + + @Override + public void handleCancelOk(String consumerTag) { + delegate.handleCancelOk(consumerTag); + } + + @Override + public void handleCancel(String consumerTag) throws IOException { + delegate.handleCancel(consumerTag); + } + + @Override + public void handleShutdownSignal(String consumerTag, ShutdownSignalException sig) { + delegate.handleShutdownSignal(consumerTag, sig); + } + + @Override + public void handleRecoverOk(String consumerTag) { + delegate.handleRecoverOk(consumerTag); + } + + @Override + public void handleDelivery( + String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) + throws IOException { + Map headers; + if (properties == null || properties.getHeaders() == null) { + headers = Collections.emptyMap(); + } else { + headers = properties.getHeaders(); + } + ConsumeContext context = + new ConsumeContext(envelope.getExchange(), envelope.getRoutingKey(), headers); + // TODO give possibility to create the consume observation + // the custom convention is already a property, the default convention could be a property as + // well. + // the name (in default convention) could also be set in a simple way, from the base + // configuration + // no need to give access to the other 2 parameters + Observation observation = + RabbitMqObservationDocumentation.CONSUME_OBSERVATION.observation( + customConsumeConvention, + defaultConsumeConvention, + () -> context, + observationRegistry); + observation.observeChecked( + () -> delegate.handleDelivery(consumerTag, envelope, properties, body)); + } + } +} diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java new file mode 100644 index 0000000000..fa78587066 --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java @@ -0,0 +1,72 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation.micrometer; + +import com.rabbitmq.client.observation.ObservationCollector; +import io.micrometer.observation.ObservationRegistry; + +/** + * @since 5.18.0 + */ +public class MicrometerObservationCollectorBuilder { + + private ObservationRegistry registry = ObservationRegistry.NOOP; + private PublishObservationConvention customPublishObservationConvention; + private PublishObservationConvention defaultPublishObservationConvention = + new DefaultPublishObservationConvention(); + private ConsumeObservationConvention customConsumeObservationConvention; + private ConsumeObservationConvention defaultConsumeObservationConvention = + new DefaultConsumeObservationConvention(); + + public MicrometerObservationCollectorBuilder registry(ObservationRegistry registry) { + this.registry = registry; + return this; + } + + public MicrometerObservationCollectorBuilder customPublishObservationConvention( + PublishObservationConvention customPublishObservationConvention) { + this.customPublishObservationConvention = customPublishObservationConvention; + return this; + } + + public MicrometerObservationCollectorBuilder defaultPublishObservationConvention( + PublishObservationConvention defaultPublishObservationConvention) { + this.defaultPublishObservationConvention = defaultPublishObservationConvention; + return this; + } + + public MicrometerObservationCollectorBuilder customConsumeObservationConvention( + ConsumeObservationConvention customConsumeObservationConvention) { + this.customConsumeObservationConvention = customConsumeObservationConvention; + return this; + } + + public MicrometerObservationCollectorBuilder defaultConsumeObservationConvention( + ConsumeObservationConvention defaultConsumeObservationConvention) { + this.defaultConsumeObservationConvention = defaultConsumeObservationConvention; + return this; + } + + public ObservationCollector build() { + return new MicrometerObservationCollector( + this.registry, + this.customPublishObservationConvention, + this.defaultPublishObservationConvention, + this.customConsumeObservationConvention, + this.defaultConsumeObservationConvention + ); + } +} diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java new file mode 100644 index 0000000000..558fb71936 --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java @@ -0,0 +1,46 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation.micrometer; + +import io.micrometer.observation.transport.SenderContext; +import java.util.Map; + +/** + * {@link io.micrometer.observation.Observation.Context} for use with RabbitMQ client {@link + * io.micrometer.observation.Observation} instrumentation. + * + * @since 5.18.0 + */ +public class PublishContext extends SenderContext> { + + private final String exchange; + private final String routingKey; + + PublishContext(String exchange, String routingKey, Map headers) { + super((hdrs, key, value) -> hdrs.put(key, value)); + this.exchange = exchange; + this.routingKey = routingKey; + setCarrier(headers); + } + + public String getExchange() { + return this.exchange; + } + + public String getRoutingKey() { + return this.routingKey; + } +} diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java new file mode 100644 index 0000000000..699921ba6f --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java @@ -0,0 +1,33 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation.micrometer; + +import io.micrometer.observation.Observation; +import io.micrometer.observation.ObservationConvention; + +/** + * {@link ObservationConvention} for RabbitMQ client instrumentation. + * + * @since 5.18.0 + * @see DefaultPublishObservationConvention + */ +public interface PublishObservationConvention extends ObservationConvention { + + @Override + default boolean supportsContext(Observation.Context context) { + return context instanceof PublishContext; + } +} diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java new file mode 100644 index 0000000000..80d121b349 --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java @@ -0,0 +1,134 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation.micrometer; + +import io.micrometer.common.docs.KeyName; +import io.micrometer.observation.Observation; +import io.micrometer.observation.ObservationConvention; +import io.micrometer.observation.docs.ObservationDocumentation; + +/** + * {@link ObservationDocumentation} for RabbitMQ Clients. + * + * @since 5.18.0 + */ +public enum RabbitMqObservationDocumentation implements ObservationDocumentation { + + /** Observation for Rabbit Client publishers. */ + PUBLISH_OBSERVATION { + + @Override + public Class> + getDefaultConvention() { + return DefaultPublishObservationConvention.class; + } + + @Override + public KeyName[] getLowCardinalityKeyNames() { + return LowCardinalityTags.values(); + } + }, + + /** Observation for Rabbit Client consumers. */ + CONSUME_OBSERVATION { + + @Override + public Class> + getDefaultConvention() { + return DefaultConsumeObservationConvention.class; + } + + @Override + public KeyName[] getLowCardinalityKeyNames() { + return LowCardinalityTags.values(); + } + }; + + // SPAN NAME + // + // topic with spaces process + // (anonymous) publish ((anonymous) being a stable identifier for an unnamed destination) + // (anonymous) receive ((anonymous) being a stable identifier for an unnamed destination) + + // LOW CARDINALITY + // messaging.system = rabbitmq + // messaging.operation = publish + + // HIGH CARDINALITY + + // messaging.rabbitmq.destination.routing_key + // messaging.destination.anonymous + // messaging.destination.name + // messaging.destination.template + // messaging.destination.temporary + // messaging.batch.message_count + // messaging.message.conversation_id + // messaging.message.id + // messaging.message.payload_compressed_size_bytes + // messaging.message.payload_size_bytes + + // net.peer.name + // net.protocol.name + // net.protocol.version + // net.sock.family + // net.sock.peer.addr + // net.sock.peer.name + // net.sock.peer.port + + /** Low cardinality tags. */ + public enum LowCardinalityTags implements KeyName { + + /** A string identifying the messaging system. */ + MESSAGING_SYSTEM { + + @Override + public String asString() { + return "messaging.system"; + } + }, + + /** A string identifying the kind of messaging operation. */ + MESSAGING_OPERATION { + + @Override + public String asString() { + return "messaging.operation"; + } + } + } + + /** High cardinality tags. */ + public enum HighCardinalityTags implements KeyName { + + /** The message destination name. */ + MESSAGING_DESTINATION_NAME { + + @Override + public String asString() { + return "messaging.destination.name"; + } + }, + + /** RabbitMQ message routing key. */ + MESSAGING_ROUTING_KEY { + + @Override + public String asString() { + return "messaging.rabbitmq.destination.routing_key"; + } + } + } +} diff --git a/src/test/java/com/rabbitmq/client/impl/AMQConnectionRefreshCredentialsTest.java b/src/test/java/com/rabbitmq/client/impl/AMQConnectionRefreshCredentialsTest.java index a5fce8a561..96d40cc4cf 100644 --- a/src/test/java/com/rabbitmq/client/impl/AMQConnectionRefreshCredentialsTest.java +++ b/src/test/java/com/rabbitmq/client/impl/AMQConnectionRefreshCredentialsTest.java @@ -17,6 +17,7 @@ import com.rabbitmq.client.Method; import com.rabbitmq.client.*; +import com.rabbitmq.client.observation.ObservationCollector; import com.rabbitmq.client.test.TestUtils; import com.rabbitmq.client.test.TestUtils.BrokerVersion; import com.rabbitmq.client.test.TestUtils.BrokerVersionAtLeast; @@ -64,7 +65,7 @@ private static ConnectionFactory connectionFactoryThatSendsGarbageAfterUpdateSec ConnectionFactory cf = new ConnectionFactory() { @Override protected AMQConnection createConnection(ConnectionParams params, FrameHandler frameHandler, MetricsCollector metricsCollector) { - return new AMQConnection(params, frameHandler, metricsCollector) { + return new AMQConnection(params, frameHandler, metricsCollector, ObservationCollector.NO_OP) { @Override AMQChannel createChannel0() { diff --git a/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java b/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java index eb1ac8d3aa..ec06db3553 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java +++ b/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java @@ -76,7 +76,7 @@ Nack.class, ExceptionMessages.class, Metrics.class, - MicrometerMetrics.class, + MicrometerObservationCollectorMetrics.class, TopologyRecoveryFiltering.class, TopologyRecoveryRetry.class }) diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerMetrics.java deleted file mode 100644 index 1cb0b240f9..0000000000 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerMetrics.java +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. -// -// This software, the RabbitMQ Java client library, is triple-licensed under the -// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 -// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see -// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.test.functional; - -import java.io.IOException; -import java.time.Duration; - -import com.rabbitmq.client.AMQP; -import com.rabbitmq.client.Channel; -import com.rabbitmq.client.Connection; -import com.rabbitmq.client.ConnectionFactory; -import com.rabbitmq.client.DefaultConsumer; -import com.rabbitmq.client.Envelope; -import com.rabbitmq.client.impl.MicrometerMetricsCollector; -import com.rabbitmq.client.test.BrokerTestCase; -import com.rabbitmq.client.test.TestUtils; -import io.micrometer.tracing.Span; -import io.micrometer.tracing.Tracer; -import io.micrometer.tracing.test.SampleTestRunner; -import org.junit.jupiter.api.Nested; - -import static com.rabbitmq.client.test.TestUtils.waitAtMost; -import static org.assertj.core.api.Assertions.assertThat; - -public class MicrometerMetrics extends BrokerTestCase { - - static final String QUEUE = "metrics.queue"; - - @Override - protected void createResources() throws IOException { - channel.queueDeclare(QUEUE, true, false, false, null); - } - - @Override - protected void releaseResources() throws IOException { - channel.queueDelete(QUEUE); - } - - - @Nested - class IntegrationTest extends SampleTestRunner { - - @Override - public TracingSetup[] getTracingSetup() { - return new TracingSetup[] { TracingSetup.IN_MEMORY_BRAVE, TracingSetup.ZIPKIN_BRAVE }; - } - - @Override - public SampleTestRunnerConsumer yourCode() throws Exception { - return (buildingBlocks, meterRegistry) -> { - ConnectionFactory connectionFactory = createConnectionFactory(); - MicrometerMetricsCollector collector = new MicrometerMetricsCollector(meterRegistry); - collector.setObservationRegistry(getObservationRegistry()); - connectionFactory.setMetricsCollector(collector); - Connection connection1 = null; - try { - connection1 = connectionFactory.newConnection(); - Channel channel = connection1.createChannel(); - - sendMessage(channel); - - TestingConsumer testingConsumer = new TestingConsumer(channel, buildingBlocks.getTracer(), buildingBlocks.getTracer().currentSpan()); - channel.basicConsume(QUEUE, true, testingConsumer); - waitAtMost(timeout(), () -> testingConsumer.executed); - waitAtMost(timeout(), () -> testingConsumer.assertionsPassed); - getMeterRegistry().get("rabbit.publish") - .tag("messaging.operation", "publish") - .tag("messaging.system", "rabbitmq") - .timer(); - getMeterRegistry().get("rabbit.consume") - .tag("messaging.operation", "publish") - .tag("messaging.system", "rabbitmq") - .timer(); - } finally { - safeClose(connection1); - } - }; - } - } - - private Duration timeout() { - return Duration.ofSeconds(10); - } - - private static ConnectionFactory createConnectionFactory() { - ConnectionFactory connectionFactory = TestUtils.connectionFactory(); - connectionFactory.setAutomaticRecoveryEnabled(false); - return connectionFactory; - } - - private void safeClose(Connection connection) { - if(connection != null) { - try { - connection.abort(); - } catch (Exception e) { - // OK - } - } - } - - private void sendMessage(Channel channel) throws IOException { - channel.basicPublish("", QUEUE, null, "msg".getBytes("UTF-8")); - } - - static class TestingConsumer extends DefaultConsumer { - - volatile boolean executed; - - volatile boolean assertionsPassed; - - private final Tracer tracer; - - private final Span rootSpan; - - public TestingConsumer(Channel channel, Tracer tracer, Span rootSpan) { - super(channel); - this.tracer = tracer; - this.rootSpan = rootSpan; - } - - @Override - public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { - executed = true; - assertThat(tracer.currentSpan()).as("Span must be put in scope").isNotNull(); - assertThat(tracer.currentSpan().context().traceId()).as("Trace id must be propagated").isEqualTo(rootSpan.context().traceId()); - System.out.println("Current span [" + tracer.currentSpan() + "]"); - assertionsPassed = true; - } - } - -} diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java new file mode 100644 index 0000000000..b216863fcc --- /dev/null +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -0,0 +1,164 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.test.functional; + +import static com.rabbitmq.client.test.TestUtils.waitAtMost; +import static org.assertj.core.api.Assertions.assertThat; + +import com.rabbitmq.client.*; +import com.rabbitmq.client.observation.ObservationCollector; +import com.rabbitmq.client.observation.micrometer.MicrometerObservationCollectorBuilder; +import com.rabbitmq.client.test.BrokerTestCase; +import com.rabbitmq.client.test.TestUtils; +import io.micrometer.tracing.Span; +import io.micrometer.tracing.Tracer; +import io.micrometer.tracing.test.SampleTestRunner; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +public class MicrometerObservationCollectorMetrics extends BrokerTestCase { + + static final String QUEUE = "metrics.queue"; + + private static ConnectionFactory createConnectionFactory() { + ConnectionFactory connectionFactory = TestUtils.connectionFactory(); + connectionFactory.setAutomaticRecoveryEnabled(true); + return connectionFactory; + } + + private static Consumer consumer(DeliverCallback callback) { + return new Consumer() { + @Override + public void handleConsumeOk(String consumerTag) {} + + @Override + public void handleCancelOk(String consumerTag) {} + + @Override + public void handleCancel(String consumerTag) throws IOException {} + + @Override + public void handleShutdownSignal(String consumerTag, ShutdownSignalException sig) {} + + @Override + public void handleRecoverOk(String consumerTag) {} + + @Override + public void handleDelivery( + String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) + throws IOException { + callback.handle(consumerTag, new Delivery(envelope, properties, body)); + } + }; + } + + @Override + protected void createResources() throws IOException { + channel.queueDeclare(QUEUE, true, false, false, null); + } + + @Override + protected void releaseResources() throws IOException { + channel.queueDelete(QUEUE); + } + + private Duration timeout() { + return Duration.ofSeconds(10); + } + + private void safeClose(Connection connection) { + if (connection != null) { + try { + connection.abort(); + } catch (Exception e) { + // OK + } + } + } + + private void sendMessage(Channel channel) throws IOException { + channel.basicPublish("", QUEUE, null, "msg".getBytes(StandardCharsets.UTF_8)); + } + + @Nested + class IntegrationTest extends SampleTestRunner { + + @Override + public TracingSetup[] getTracingSetup() { + return new TracingSetup[] {TracingSetup.IN_MEMORY_BRAVE, TracingSetup.ZIPKIN_BRAVE}; + } + + @Test + void test() {} + + @Override + public SampleTestRunnerConsumer yourCode() { + return (buildingBlocks, meterRegistry) -> { + ConnectionFactory connectionFactory = createConnectionFactory(); + ObservationCollector collector = + new MicrometerObservationCollectorBuilder().registry(getObservationRegistry()).build(); + connectionFactory.setObservationCollector(collector); + Connection publishConnection = null, consumeConnection = null; + try { + publishConnection = connectionFactory.newConnection(); + Channel channel = publishConnection.createChannel(); + + sendMessage(channel); + + Tracer tracer = buildingBlocks.getTracer(); + Span rootSpan = buildingBlocks.getTracer().currentSpan(); + CountDownLatch consumeLatch = new CountDownLatch(1); + Consumer consumer = + consumer( + (consumerTag, message) -> { + assertThat(tracer.currentSpan()).as("Span must be put in scope").isNotNull(); + assertThat(tracer.currentSpan().context().traceId()) + .as("Trace id must be propagated") + .isEqualTo(rootSpan.context().traceId()); + System.out.println("Current span [" + tracer.currentSpan() + "]"); + consumeLatch.countDown(); + }); + + consumeConnection = connectionFactory.newConnection(); + channel = consumeConnection.createChannel(); + channel.basicConsume(QUEUE, true, consumer); + + assertThat(consumeLatch.await(10, TimeUnit.SECONDS)).isTrue(); + waitAtMost(() -> getMeterRegistry().find("rabbitmq.publish").timer() != null && + getMeterRegistry().find("rabbitmq.consume").timer() != null); + getMeterRegistry() + .get("rabbitmq.publish") + .tag("messaging.operation", "publish") + .tag("messaging.system", "rabbitmq") + .timer(); + getMeterRegistry() + .get("rabbitmq.consume") + .tag("messaging.operation", "publish") + .tag("messaging.system", "rabbitmq") + .timer(); + } finally { + safeClose(publishConnection); + safeClose(consumeConnection); + } + }; + } + } +} From 950231a3d3d164ff76632aed3d51cd3de90578db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 3 May 2023 09:48:40 +0200 Subject: [PATCH 283/657] Test "non-observable" consumed message does not fail If observation is enabled. (cherry picked from commit 4ff96ec1963b37ab3ead90cde62f08ed4c876914) --- .../DefaultConsumeObservationConvention.java | 2 +- ...MicrometerObservationCollectorMetrics.java | 83 ++++++++++++++----- 2 files changed, 61 insertions(+), 24 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java index 50fcad31a0..aad7386d1b 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java @@ -55,7 +55,7 @@ private String destination(String destination) { @Override public KeyValues getLowCardinalityKeyValues(ConsumeContext context) { return KeyValues.of( - LowCardinalityTags.MESSAGING_OPERATION.withValue("publish"), + LowCardinalityTags.MESSAGING_OPERATION.withValue("consume"), LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq")); } diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index b216863fcc..ba86b6dc99 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -23,24 +23,34 @@ import com.rabbitmq.client.observation.micrometer.MicrometerObservationCollectorBuilder; import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; +import io.micrometer.observation.ObservationRegistry; import io.micrometer.tracing.Span; import io.micrometer.tracing.Tracer; import io.micrometer.tracing.test.SampleTestRunner; import java.io.IOException; import java.nio.charset.StandardCharsets; -import java.time.Duration; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; import org.junit.jupiter.api.Nested; -import org.junit.jupiter.api.Test; public class MicrometerObservationCollectorMetrics extends BrokerTestCase { static final String QUEUE = "metrics.queue"; private static ConnectionFactory createConnectionFactory() { + return createConnectionFactory(null); + } + + private static ConnectionFactory createConnectionFactory( + ObservationRegistry observationRegistry) { ConnectionFactory connectionFactory = TestUtils.connectionFactory(); connectionFactory.setAutomaticRecoveryEnabled(true); + if (observationRegistry != null) { + ObservationCollector collector = + new MicrometerObservationCollectorBuilder().registry(observationRegistry).build(); + connectionFactory.setObservationCollector(collector); + } return connectionFactory; } @@ -53,7 +63,7 @@ public void handleConsumeOk(String consumerTag) {} public void handleCancelOk(String consumerTag) {} @Override - public void handleCancel(String consumerTag) throws IOException {} + public void handleCancel(String consumerTag) {} @Override public void handleShutdownSignal(String consumerTag, ShutdownSignalException sig) {} @@ -80,10 +90,6 @@ protected void releaseResources() throws IOException { channel.queueDelete(QUEUE); } - private Duration timeout() { - return Duration.ofSeconds(10); - } - private void safeClose(Connection connection) { if (connection != null) { try { @@ -98,24 +104,21 @@ private void sendMessage(Channel channel) throws IOException { channel.basicPublish("", QUEUE, null, "msg".getBytes(StandardCharsets.UTF_8)); } - @Nested - class IntegrationTest extends SampleTestRunner { + private abstract static class IntegrationTest extends SampleTestRunner { @Override public TracingSetup[] getTracingSetup() { return new TracingSetup[] {TracingSetup.IN_MEMORY_BRAVE, TracingSetup.ZIPKIN_BRAVE}; } + } - @Test - void test() {} + @Nested + class PublishConsume extends IntegrationTest { @Override public SampleTestRunnerConsumer yourCode() { return (buildingBlocks, meterRegistry) -> { - ConnectionFactory connectionFactory = createConnectionFactory(); - ObservationCollector collector = - new MicrometerObservationCollectorBuilder().registry(getObservationRegistry()).build(); - connectionFactory.setObservationCollector(collector); + ConnectionFactory connectionFactory = createConnectionFactory(getObservationRegistry()); Connection publishConnection = null, consumeConnection = null; try { publishConnection = connectionFactory.newConnection(); @@ -125,15 +128,12 @@ public SampleTestRunnerConsumer yourCode() { Tracer tracer = buildingBlocks.getTracer(); Span rootSpan = buildingBlocks.getTracer().currentSpan(); + AtomicReference consumeSpan = new AtomicReference<>(); CountDownLatch consumeLatch = new CountDownLatch(1); Consumer consumer = consumer( (consumerTag, message) -> { - assertThat(tracer.currentSpan()).as("Span must be put in scope").isNotNull(); - assertThat(tracer.currentSpan().context().traceId()) - .as("Trace id must be propagated") - .isEqualTo(rootSpan.context().traceId()); - System.out.println("Current span [" + tracer.currentSpan() + "]"); + consumeSpan.set(tracer.currentSpan()); consumeLatch.countDown(); }); @@ -142,8 +142,14 @@ public SampleTestRunnerConsumer yourCode() { channel.basicConsume(QUEUE, true, consumer); assertThat(consumeLatch.await(10, TimeUnit.SECONDS)).isTrue(); - waitAtMost(() -> getMeterRegistry().find("rabbitmq.publish").timer() != null && - getMeterRegistry().find("rabbitmq.consume").timer() != null); + assertThat(consumeSpan.get()).as("Span must be put in scope").isNotNull(); + assertThat(consumeSpan.get().context().traceId()) + .as("Trace id must be propagated") + .isEqualTo(rootSpan.context().traceId()); + waitAtMost( + () -> + getMeterRegistry().find("rabbitmq.publish").timer() != null + && getMeterRegistry().find("rabbitmq.consume").timer() != null); getMeterRegistry() .get("rabbitmq.publish") .tag("messaging.operation", "publish") @@ -151,7 +157,7 @@ public SampleTestRunnerConsumer yourCode() { .timer(); getMeterRegistry() .get("rabbitmq.consume") - .tag("messaging.operation", "publish") + .tag("messaging.operation", "consume") .tag("messaging.system", "rabbitmq") .timer(); } finally { @@ -161,4 +167,35 @@ public SampleTestRunnerConsumer yourCode() { }; } } + + @Nested + class ConsumeWithoutObservationShouldNotFail extends IntegrationTest { + + @Override + public SampleTestRunnerConsumer yourCode() { + return (buildingBlocks, meterRegistry) -> { + ConnectionFactory publishCf = createConnectionFactory(); + ConnectionFactory consumeCf = createConnectionFactory(getObservationRegistry()); + Connection publishConnection = null, consumeConnection = null; + try { + publishConnection = publishCf.newConnection(); + Channel channel = publishConnection.createChannel(); + + sendMessage(channel); + + CountDownLatch consumeLatch = new CountDownLatch(1); + Consumer consumer = consumer((consumerTag, message) -> consumeLatch.countDown()); + + consumeConnection = consumeCf.newConnection(); + channel = consumeConnection.createChannel(); + channel.basicConsume(QUEUE, true, consumer); + + assertThat(consumeLatch.await(10, TimeUnit.SECONDS)).isTrue(); + } finally { + safeClose(publishConnection); + safeClose(consumeConnection); + } + }; + } + } } From df5bf6bd7876a6948dca82cbe0bff599d42d8383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 3 May 2023 10:05:42 +0200 Subject: [PATCH 284/657] Add queue and consumer tag to ObservationCollector#basicConsume Could be used for tag values. (cherry picked from commit a24b47f74d7e8caca926ad925419ad07e348ff7c) --- src/main/java/com/rabbitmq/client/impl/ChannelN.java | 2 +- .../rabbitmq/client/observation/NoOpObservationCollector.java | 2 +- .../com/rabbitmq/client/observation/ObservationCollector.java | 2 +- .../observation/micrometer/MicrometerObservationCollector.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelN.java b/src/main/java/com/rabbitmq/client/impl/ChannelN.java index 96bfac0369..b18434fbad 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelN.java @@ -1368,7 +1368,7 @@ public String basicConsume(String queue, final boolean autoAck, String consumerT @Override public String transformReply(AMQCommand replyCommand) { String actualConsumerTag = ((Basic.ConsumeOk) replyCommand.getMethod()).getConsumerTag(); - Consumer wrappedCallback = observationCollector.basicConsume(callback); + Consumer wrappedCallback = observationCollector.basicConsume(queue, consumerTag, callback); _consumers.put(actualConsumerTag, wrappedCallback); // need to register consumer in stats before it actually starts consuming diff --git a/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java index 338a4a0480..00d765e2e6 100644 --- a/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java @@ -28,7 +28,7 @@ public void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProp } @Override - public Consumer basicConsume(Consumer consumer) { + public Consumer basicConsume(String queue, String consumerTag, Consumer consumer) { return consumer; } } diff --git a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java index 1196df818c..5d0c2d0020 100644 --- a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java @@ -30,7 +30,7 @@ public interface ObservationCollector { void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProperties properties) throws IOException; - Consumer basicConsume(Consumer consumer); + Consumer basicConsume(String queue, String consumerTag, Consumer consumer); interface PublishCall { diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java index 83b17913fb..27016943a9 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -82,7 +82,7 @@ public void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProp } @Override - public Consumer basicConsume(Consumer consumer) { + public Consumer basicConsume(String queue, String consumerTag, Consumer consumer) { return new ObservationConsumer( consumer, this.registry, this.customConsumeConvention, this.defaultConsumeConvention); } From e2d5d9c02f53c535a3416a528528d1c269a12821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 4 May 2023 15:46:25 +0200 Subject: [PATCH 285/657] Update observation tag names Based on the OpenTelemetry attributes. https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/messaging.md (cherry picked from commit 73f7ab893b94cc29842559afca990c3d97e64e39) --- .../micrometer/ConsumeContext.java | 15 ++++------ .../DefaultConsumeObservationConvention.java | 7 ++--- .../DefaultPublishObservationConvention.java | 4 +-- .../MicrometerObservationCollector.java | 6 +++- .../RabbitMqObservationDocumentation.java | 11 +++++++- ...MicrometerObservationCollectorMetrics.java | 28 ++++++++----------- 6 files changed, 37 insertions(+), 34 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java index c1f33f2dc2..d265e2c02c 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java @@ -26,10 +26,9 @@ */ public class ConsumeContext extends ReceiverContext> { - private final String exchange; - private final String routingKey; + private final String queue; - ConsumeContext(String exchange, String routingKey, Map headers) { + ConsumeContext(String queue, Map headers) { super( (hdrs, key) -> { Object result = hdrs.get(key); @@ -38,16 +37,12 @@ public class ConsumeContext extends ReceiverContext> { } return String.valueOf(result); }); - this.exchange = exchange; - this.routingKey = routingKey; + this.queue = queue; setCarrier(headers); } - public String getExchange() { - return exchange; + public String getQueue() { + return queue; } - public String getRoutingKey() { - return routingKey; - } } diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java index aad7386d1b..5e5bc4a30c 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java @@ -45,10 +45,10 @@ public String getName() { @Override public String getContextualName(ConsumeContext context) { - return destination(context.getRoutingKey()) + " consume"; + return source(context.getQueue()) + " consume"; } - private String destination(String destination) { + private String source(String destination) { return StringUtils.isNotBlank(destination) ? destination : "(anonymous)"; } @@ -62,7 +62,6 @@ public KeyValues getLowCardinalityKeyValues(ConsumeContext context) { @Override public KeyValues getHighCardinalityKeyValues(ConsumeContext context) { return KeyValues.of( - HighCardinalityTags.MESSAGING_ROUTING_KEY.withValue(context.getRoutingKey()), - HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(context.getExchange())); + HighCardinalityTags.MESSAGING_SOURCE_NAME.withValue(context.getQueue())); } } diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java index cc60a39ebd..24bd9776bd 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java @@ -49,7 +49,7 @@ public String getContextualName(PublishContext context) { } private String destination(String destination) { - return StringUtils.isNotBlank(destination) ? destination : "(anonymous)"; + return StringUtils.isNotBlank(destination) ? destination : "amq.default"; } @Override @@ -63,6 +63,6 @@ public KeyValues getLowCardinalityKeyValues(PublishContext context) { public KeyValues getHighCardinalityKeyValues(PublishContext context) { return KeyValues.of( HighCardinalityTags.MESSAGING_ROUTING_KEY.withValue(context.getRoutingKey()), - HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(context.getExchange())); + HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(destination(context.getExchange()))); } } diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java index 27016943a9..7839548bc1 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -84,11 +84,13 @@ public void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProp @Override public Consumer basicConsume(String queue, String consumerTag, Consumer consumer) { return new ObservationConsumer( + queue, consumer, this.registry, this.customConsumeConvention, this.defaultConsumeConvention); } private static class ObservationConsumer implements Consumer { + private final String queue; private final Consumer delegate; private final ObservationRegistry observationRegistry; @@ -96,10 +98,12 @@ private static class ObservationConsumer implements Consumer { private final ConsumeObservationConvention customConsumeConvention, defaultConsumeConvention; private ObservationConsumer( + String queue, Consumer delegate, ObservationRegistry observationRegistry, ConsumeObservationConvention customConsumeConvention, ConsumeObservationConvention defaultConsumeConvention) { + this.queue = queue; this.delegate = delegate; this.observationRegistry = observationRegistry; this.customConsumeConvention = customConsumeConvention; @@ -142,7 +146,7 @@ public void handleDelivery( headers = properties.getHeaders(); } ConsumeContext context = - new ConsumeContext(envelope.getExchange(), envelope.getRoutingKey(), headers); + new ConsumeContext(queue, headers); // TODO give possibility to create the consume observation // the custom convention is already a property, the default convention could be a property as // well. diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java index 80d121b349..9dc51f0495 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java @@ -129,6 +129,15 @@ public String asString() { public String asString() { return "messaging.rabbitmq.destination.routing_key"; } - } + }, + + /** The message destination name. */ + MESSAGING_SOURCE_NAME { + + @Override + public String asString() { + return "messaging.source.name"; + } + }, } } diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index ba86b6dc99..3a6d429129 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -24,14 +24,13 @@ import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; import io.micrometer.observation.ObservationRegistry; -import io.micrometer.tracing.Span; -import io.micrometer.tracing.Tracer; import io.micrometer.tracing.test.SampleTestRunner; +import io.micrometer.tracing.test.simple.SpanAssert; +import io.micrometer.tracing.test.simple.SpansAssert; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicReference; import org.junit.jupiter.api.Nested; public class MicrometerObservationCollectorMetrics extends BrokerTestCase { @@ -126,26 +125,23 @@ public SampleTestRunnerConsumer yourCode() { sendMessage(channel); - Tracer tracer = buildingBlocks.getTracer(); - Span rootSpan = buildingBlocks.getTracer().currentSpan(); - AtomicReference consumeSpan = new AtomicReference<>(); CountDownLatch consumeLatch = new CountDownLatch(1); - Consumer consumer = - consumer( - (consumerTag, message) -> { - consumeSpan.set(tracer.currentSpan()); - consumeLatch.countDown(); - }); + Consumer consumer = consumer((consumerTag, message) -> consumeLatch.countDown()); consumeConnection = connectionFactory.newConnection(); channel = consumeConnection.createChannel(); channel.basicConsume(QUEUE, true, consumer); assertThat(consumeLatch.await(10, TimeUnit.SECONDS)).isTrue(); - assertThat(consumeSpan.get()).as("Span must be put in scope").isNotNull(); - assertThat(consumeSpan.get().context().traceId()) - .as("Trace id must be propagated") - .isEqualTo(rootSpan.context().traceId()); + waitAtMost(() -> buildingBlocks.getFinishedSpans().size() == 2); + SpansAssert.assertThat(buildingBlocks.getFinishedSpans()).haveSameTraceId().hasSize(2); + SpanAssert.assertThat(buildingBlocks.getFinishedSpans().get(0)) + .hasNameEqualTo("metrics.queue publish") + .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") + .hasTag("messaging.destination.name", "amq.default"); + SpanAssert.assertThat(buildingBlocks.getFinishedSpans().get(1)) + .hasNameEqualTo("metrics.queue consume") + .hasTag("messaging.source.name", "metrics.queue"); waitAtMost( () -> getMeterRegistry().find("rabbitmq.publish").timer() != null From 0cc047fc448550bddc9fd241a94515fb3a597f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 5 May 2023 16:41:28 +0200 Subject: [PATCH 286/657] Use OpenTelemetry guidelines for observation attributes For Micrometer Observation collector implementation. This is based on what the OTel Java agent exports. The guidelines for attributes may change, but that is a good starting point for now. https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/messaging.md (cherry picked from commit b3251b5902c5c895e7d4468973b3516edede5b5d) --- .../com/rabbitmq/client/impl/AMQChannel.java | 8 +++++ .../rabbitmq/client/impl/AMQConnection.java | 32 +++++++++++++++++++ .../com/rabbitmq/client/impl/ChannelN.java | 2 +- .../observation/NoOpObservationCollector.java | 7 +++- .../observation/ObservationCollector.java | 15 +++++++-- .../micrometer/ConsumeContext.java | 21 +++++++++++- .../DefaultConsumeObservationConvention.java | 10 +++++- .../DefaultPublishObservationConvention.java | 12 +++++-- .../MicrometerObservationCollector.java | 9 ++++-- .../micrometer/PublishContext.java | 17 +++++++++- .../RabbitMqObservationDocumentation.java | 22 +++++++++++++ ...MicrometerObservationCollectorMetrics.java | 13 ++++++-- 12 files changed, 152 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/AMQChannel.java b/src/main/java/com/rabbitmq/client/impl/AMQChannel.java index f863edfd3a..0695c8072f 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQChannel.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQChannel.java @@ -23,6 +23,7 @@ import com.rabbitmq.client.AMQP.Queue; import com.rabbitmq.client.AMQP.Tx; import com.rabbitmq.client.Method; +import com.rabbitmq.client.observation.ObservationCollector; import com.rabbitmq.utility.BlockingValueOrException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -78,6 +79,8 @@ public abstract class AMQChannel extends ShutdownNotifierComponent { private final TrafficListener _trafficListener; private final int maxInboundMessageBodySize; + private final ObservationCollector.ConnectionInfo connectionInfo; + /** * Construct a channel on the given connection, with the given channel number. * @param connection the underlying connection for this channel @@ -94,6 +97,7 @@ public AMQChannel(AMQConnection connection, int channelNumber) { this._trafficListener = connection.getTrafficListener(); this.maxInboundMessageBodySize = connection.getMaxInboundMessageBodySize(); this._command = new AMQCommand(this.maxInboundMessageBodySize); + this.connectionInfo = connection.connectionInfo(); } /** @@ -586,4 +590,8 @@ public AMQCommand transformReply(AMQCommand command) { return command; } } + + protected ObservationCollector.ConnectionInfo connectionInfo() { + return this.connectionInfo; + } } diff --git a/src/main/java/com/rabbitmq/client/impl/AMQConnection.java b/src/main/java/com/rabbitmq/client/impl/AMQConnection.java index 58c5f1e688..4e6b0f63a9 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQConnection.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQConnection.java @@ -69,6 +69,7 @@ public class AMQConnection extends ShutdownNotifierComponent implements Connecti private final int workPoolTimeout; private final AtomicBoolean finalShutdownStarted = new AtomicBoolean(false); + private volatile ObservationCollector.ConnectionInfo connectionInfo; /** * Retrieve a copy of the default table of client properties that @@ -438,6 +439,11 @@ public void start() setHeartbeat(heartbeat); + this.connectionInfo = new DefaultConnectionInfo( + this._frameHandler.getAddress().getHostAddress(), + this._frameHandler.getPort() + ); + _channel0.transmit(new AMQP.Connection.TuneOk.Builder() .channelMax(channelMax) .frameMax(frameMax) @@ -1215,4 +1221,30 @@ public TrafficListener getTrafficListener() { int getMaxInboundMessageBodySize() { return maxInboundMessageBodySize; } + + private static class DefaultConnectionInfo implements ObservationCollector.ConnectionInfo { + + private final String peerAddress; + private final int peerPort; + + private DefaultConnectionInfo(String peerAddress, int peerPort) { + this.peerAddress = peerAddress; + this.peerPort = peerPort; + } + + @Override + public String getPeerAddress() { + return peerAddress; + } + + @Override + public int getPeerPort() { + return this.peerPort; + } + + } + + ObservationCollector.ConnectionInfo connectionInfo() { + return this.connectionInfo; + } } diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelN.java b/src/main/java/com/rabbitmq/client/impl/ChannelN.java index b18434fbad..34fc4c47fe 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelN.java @@ -718,7 +718,7 @@ public void basicPublish(String exchange, String routingKey, AMQCommand command = new AMQCommand(publish, properties, body); transmit(command); }; - observationCollector.publish(publishCall, publish, props); + observationCollector.publish(publishCall, publish, props, body, this.connectionInfo()); } catch (IOException | AlreadyClosedException e) { metricsCollector.basicPublishFailure(this, e); throw e; diff --git a/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java index 00d765e2e6..783d6769ea 100644 --- a/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java @@ -22,7 +22,12 @@ final class NoOpObservationCollector implements ObservationCollector { @Override - public void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProperties properties) + public void publish( + PublishCall call, + AMQP.Basic.Publish publish, + AMQP.BasicProperties properties, + byte[] body, + ConnectionInfo connectionInfo) throws IOException { call.publish(properties); } diff --git a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java index 5d0c2d0020..fe88d5c355 100644 --- a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java @@ -20,14 +20,18 @@ import java.io.IOException; /** - * * @since 5.18.0 */ public interface ObservationCollector { ObservationCollector NO_OP = new NoOpObservationCollector(); - void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProperties properties) + void publish( + PublishCall call, + AMQP.Basic.Publish publish, + AMQP.BasicProperties properties, + byte[] body, + ConnectionInfo connectionInfo) throws IOException; Consumer basicConsume(String queue, String consumerTag, Consumer consumer); @@ -36,4 +40,11 @@ interface PublishCall { void publish(AMQP.BasicProperties properties) throws IOException; } + + interface ConnectionInfo { + + String getPeerAddress(); + + int getPeerPort(); + } } diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java index d265e2c02c..f7cbb53d96 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java @@ -26,9 +26,13 @@ */ public class ConsumeContext extends ReceiverContext> { + private final String exchange; + private final String routingKey; + private final int payloadSizeBytes; private final String queue; - ConsumeContext(String queue, Map headers) { + ConsumeContext(String exchange, String routingKey, String queue, Map headers, + int payloadSizeBytes) { super( (hdrs, key) -> { Object result = hdrs.get(key); @@ -37,10 +41,25 @@ public class ConsumeContext extends ReceiverContext> { } return String.valueOf(result); }); + this.exchange = exchange; + this.routingKey = routingKey; + this.payloadSizeBytes = payloadSizeBytes; this.queue = queue; setCarrier(headers); } + public String getExchange() { + return this.exchange; + } + + public String getRoutingKey() { + return this.routingKey; + } + + public int getPayloadSizeBytes() { + return this.payloadSizeBytes; + } + public String getQueue() { return queue; } diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java index 5e5bc4a30c..6b8401d807 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java @@ -48,6 +48,10 @@ public String getContextualName(ConsumeContext context) { return source(context.getQueue()) + " consume"; } + private String exchange(String destination) { + return StringUtils.isNotBlank(destination) ? destination : "amq.default"; + } + private String source(String destination) { return StringUtils.isNotBlank(destination) ? destination : "(anonymous)"; } @@ -62,6 +66,10 @@ public KeyValues getLowCardinalityKeyValues(ConsumeContext context) { @Override public KeyValues getHighCardinalityKeyValues(ConsumeContext context) { return KeyValues.of( - HighCardinalityTags.MESSAGING_SOURCE_NAME.withValue(context.getQueue())); + HighCardinalityTags.MESSAGING_ROUTING_KEY.withValue(context.getRoutingKey()), + HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(exchange(context.getExchange())), + HighCardinalityTags.MESSAGING_SOURCE_NAME.withValue(context.getQueue()), + HighCardinalityTags.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES.withValue( + String.valueOf(context.getPayloadSizeBytes()))); } } diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java index 24bd9776bd..5610ac77bb 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java @@ -45,10 +45,10 @@ public String getName() { @Override public String getContextualName(PublishContext context) { - return destination(context.getRoutingKey()) + " publish"; + return exchange(context.getRoutingKey()) + " publish"; } - private String destination(String destination) { + private String exchange(String destination) { return StringUtils.isNotBlank(destination) ? destination : "amq.default"; } @@ -63,6 +63,12 @@ public KeyValues getLowCardinalityKeyValues(PublishContext context) { public KeyValues getHighCardinalityKeyValues(PublishContext context) { return KeyValues.of( HighCardinalityTags.MESSAGING_ROUTING_KEY.withValue(context.getRoutingKey()), - HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(destination(context.getExchange()))); + HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(exchange(context.getExchange())), + HighCardinalityTags.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES.withValue( + String.valueOf(context.getPayloadSizeBytes())), + HighCardinalityTags.NET_SOCK_PEER_ADDR.withValue( + context.getConnectionInfo().getPeerAddress()), + HighCardinalityTags.NET_SOCK_PEER_PORT.withValue( + String.valueOf(context.getConnectionInfo().getPeerPort()))); } } diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java index 7839548bc1..fa42721255 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -45,7 +45,8 @@ class MicrometerObservationCollector implements ObservationCollector { } @Override - public void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProperties properties) + public void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProperties properties, + byte [] body, ConnectionInfo connectionInfo) throws IOException { // TODO: Is this for fire and forget or request reply too? If r-r then we have to have 2 // contexts @@ -56,7 +57,9 @@ public void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProp headers = new HashMap<>(properties.getHeaders()); } PublishContext micrometerPublishContext = - new PublishContext(publish.getExchange(), publish.getRoutingKey(), headers); + new PublishContext(publish.getExchange(), publish.getRoutingKey(), headers, + body == null ? 0 : body.length, + connectionInfo); AMQP.BasicProperties.Builder builder = properties.builder(); builder.headers(headers); // TODO give possibility to create the publish observation @@ -146,7 +149,7 @@ public void handleDelivery( headers = properties.getHeaders(); } ConsumeContext context = - new ConsumeContext(queue, headers); + new ConsumeContext(envelope.getExchange(), envelope.getRoutingKey(), queue, headers, body == null ? 0 : body.length); // TODO give possibility to create the consume observation // the custom convention is already a property, the default convention could be a property as // well. diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java index 558fb71936..d5c450279d 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java @@ -15,6 +15,7 @@ package com.rabbitmq.client.observation.micrometer; +import com.rabbitmq.client.observation.ObservationCollector; import io.micrometer.observation.transport.SenderContext; import java.util.Map; @@ -28,11 +29,17 @@ public class PublishContext extends SenderContext> { private final String exchange; private final String routingKey; + private final int payloadSizeBytes; + private final ObservationCollector.ConnectionInfo connectionInfo; - PublishContext(String exchange, String routingKey, Map headers) { + PublishContext( + String exchange, String routingKey, Map headers, int payloadSizeBytes, + ObservationCollector.ConnectionInfo connectionInfo) { super((hdrs, key, value) -> hdrs.put(key, value)); this.exchange = exchange; this.routingKey = routingKey; + this.payloadSizeBytes = payloadSizeBytes; + this.connectionInfo = connectionInfo; setCarrier(headers); } @@ -43,4 +50,12 @@ public String getExchange() { public String getRoutingKey() { return this.routingKey; } + + public int getPayloadSizeBytes() { + return this.payloadSizeBytes; + } + + public ObservationCollector.ConnectionInfo getConnectionInfo() { + return this.connectionInfo; + } } diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java index 9dc51f0495..2b4be9008f 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java @@ -139,5 +139,27 @@ public String asString() { return "messaging.source.name"; } }, + + MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES { + + @Override + public String asString() { + return "messaging.message.payload_size_bytes"; + } + }, + + NET_SOCK_PEER_PORT { + @Override + public String asString() { + return "net.sock.peer.port"; + } + }, + + NET_SOCK_PEER_ADDR { + @Override + public String asString() { + return "net.sock.peer.addr"; + } + } } } diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index 3a6d429129..4955611b12 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -36,6 +36,7 @@ public class MicrometerObservationCollectorMetrics extends BrokerTestCase { static final String QUEUE = "metrics.queue"; + private static final byte[] PAYLOAD = "msg".getBytes(StandardCharsets.UTF_8); private static ConnectionFactory createConnectionFactory() { return createConnectionFactory(null); @@ -100,7 +101,7 @@ private void safeClose(Connection connection) { } private void sendMessage(Channel channel) throws IOException { - channel.basicPublish("", QUEUE, null, "msg".getBytes(StandardCharsets.UTF_8)); + channel.basicPublish("", QUEUE, null, PAYLOAD); } private abstract static class IntegrationTest extends SampleTestRunner { @@ -138,10 +139,16 @@ public SampleTestRunnerConsumer yourCode() { SpanAssert.assertThat(buildingBlocks.getFinishedSpans().get(0)) .hasNameEqualTo("metrics.queue publish") .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") - .hasTag("messaging.destination.name", "amq.default"); + .hasTag("messaging.destination.name", "amq.default") + .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)) + .hasTagWithKey("net.sock.peer.addr") + .hasTag("net.sock.peer.port", "5672"); SpanAssert.assertThat(buildingBlocks.getFinishedSpans().get(1)) .hasNameEqualTo("metrics.queue consume") - .hasTag("messaging.source.name", "metrics.queue"); + .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") + .hasTag("messaging.destination.name", "amq.default") + .hasTag("messaging.source.name", "metrics.queue") + .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)); waitAtMost( () -> getMeterRegistry().find("rabbitmq.publish").timer() != null From 8f15e8cb342f60b679c701421838e7f9b24b4b6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 16 May 2023 10:23:35 +0200 Subject: [PATCH 287/657] Add protocol and version to observation attributes (cherry picked from commit 7752e1288e8bf2d601b04c60ef5add1ad3a8d818) --- .../DefaultPublishObservationConvention.java | 4 +++- .../RabbitMqObservationDocumentation.java | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java index 5610ac77bb..3880eec4ff 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java @@ -56,7 +56,9 @@ private String exchange(String destination) { public KeyValues getLowCardinalityKeyValues(PublishContext context) { return KeyValues.of( LowCardinalityTags.MESSAGING_OPERATION.withValue("publish"), - LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq")); + LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq"), + LowCardinalityTags.NET_PROTOCOL_NAME.withValue("amqp"), + LowCardinalityTags.NET_PROTOCOL_VERSION.withValue("0.9.1")); } @Override diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java index 2b4be9008f..be0f98d6dd 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java @@ -107,7 +107,23 @@ public String asString() { public String asString() { return "messaging.operation"; } - } + }, + + NET_PROTOCOL_NAME { + + @Override + public String asString() { + return "net.protocol.name"; + } + }, + + NET_PROTOCOL_VERSION { + + @Override + public String asString() { + return "net.protocol.version"; + } + }, } /** High cardinality tags. */ From 7799dd0cf4cc08d3114836e07c90e4c9f1455fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 17 May 2023 16:01:41 +0200 Subject: [PATCH 288/657] Instrument basic.get (cherry picked from commit fef51f29dcf274a615f1a239ef5e278c19279086) --- pom.xml | 40 +++++++- .../com/rabbitmq/client/impl/ChannelN.java | 42 +++++---- .../observation/NoOpObservationCollector.java | 7 +- .../observation/ObservationCollector.java | 56 ++++++++++- ... DefaultDeliverObservationConvention.java} | 25 +++-- .../DefaultPublishObservationConvention.java | 2 - ...onsumeContext.java => DeliverContext.java} | 12 ++- ...java => DeliverObservationConvention.java} | 6 +- .../MicrometerObservationCollector.java | 92 +++++++++++++------ ...MicrometerObservationCollectorBuilder.java | 50 ++++++---- .../micrometer/PublishContext.java | 6 +- .../PublishObservationConvention.java | 2 - .../RabbitMqObservationDocumentation.java | 22 +++-- ...MicrometerObservationCollectorMetrics.java | 76 +++++++++++++-- 14 files changed, 330 insertions(+), 108 deletions(-) rename src/main/java/com/rabbitmq/client/observation/micrometer/{DefaultConsumeObservationConvention.java => DefaultDeliverObservationConvention.java} (76%) rename src/main/java/com/rabbitmq/client/observation/micrometer/{ConsumeContext.java => DeliverContext.java} (89%) rename src/main/java/com/rabbitmq/client/observation/micrometer/{ConsumeObservationConvention.java => DeliverObservationConvention.java} (85%) diff --git a/pom.xml b/pom.xml index 4074a1d163..30519fea95 100644 --- a/pom.xml +++ b/pom.xml @@ -54,6 +54,7 @@ UTF-8 UTF-8 + true 1.7.36 4.2.19 1.11.1 @@ -89,7 +90,8 @@ 1.6.13 1.11 1.3 - + 2.35.0 + 1.17.0 + + // Copyright (c) $YEAR VMware, Inc. or its affiliates. All rights reserved. + // + // This software, the RabbitMQ Java client library, is triple-licensed under the + // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 + // ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see + // LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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. + + + + + diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelN.java b/src/main/java/com/rabbitmq/client/impl/ChannelN.java index 34fc4c47fe..e4fcabd14b 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelN.java @@ -1166,26 +1166,28 @@ public GetResponse basicGet(String queue, boolean autoAck) .queue(queue) .noAck(autoAck) .build()); - Method method = replyCommand.getMethod(); - - if (method instanceof Basic.GetOk) { - Basic.GetOk getOk = (Basic.GetOk)method; - Envelope envelope = new Envelope(getOk.getDeliveryTag(), - getOk.getRedelivered(), - getOk.getExchange(), - getOk.getRoutingKey()); - BasicProperties props = (BasicProperties)replyCommand.getContentHeader(); - byte[] body = replyCommand.getContentBody(); - int messageCount = getOk.getMessageCount(); - - metricsCollector.consumedMessage(this, getOk.getDeliveryTag(), autoAck); - - return new GetResponse(envelope, props, body, messageCount); - } else if (method instanceof Basic.GetEmpty) { - return null; - } else { - throw new UnexpectedMethodError(method); - } + return this.observationCollector.basicGet(() -> { + Method method = replyCommand.getMethod(); + + if (method instanceof Basic.GetOk) { + Basic.GetOk getOk = (Basic.GetOk)method; + Envelope envelope = new Envelope(getOk.getDeliveryTag(), + getOk.getRedelivered(), + getOk.getExchange(), + getOk.getRoutingKey()); + BasicProperties props = (BasicProperties)replyCommand.getContentHeader(); + byte[] body = replyCommand.getContentBody(); + int messageCount = getOk.getMessageCount(); + + metricsCollector.consumedMessage(this, getOk.getDeliveryTag(), autoAck); + + return new GetResponse(envelope, props, body, messageCount); + } else if (method instanceof Basic.GetEmpty) { + return null; + } else { + throw new UnexpectedMethodError(method); + } + }, queue); } /** Public API - {@inheritDoc} */ diff --git a/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java index 783d6769ea..76ddd82a70 100644 --- a/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java @@ -12,11 +12,11 @@ // // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.observation; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Consumer; +import com.rabbitmq.client.GetResponse; import java.io.IOException; final class NoOpObservationCollector implements ObservationCollector { @@ -36,4 +36,9 @@ public void publish( public Consumer basicConsume(String queue, String consumerTag, Consumer consumer) { return consumer; } + + @Override + public GetResponse basicGet(BasicGetCall call, String queue) { + return call.get(); + } } diff --git a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java index fe88d5c355..bc10f8d684 100644 --- a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java @@ -12,20 +12,43 @@ // // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.observation; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Consumer; +import com.rabbitmq.client.GetResponse; import java.io.IOException; /** + * API to instrument operations in the AMQP client. The supported operations are publishing, + * asynchronous delivery, and synchronous delivery (basic.get). + * + *

Implementations can gather information and send it to tracing backends. This allows e.g. + * following the processing steps of a given message through different systems. + * + *

This is considered an SPI and is susceptible to change at any time. + * * @since 5.18.0 + * @see com.rabbitmq.client.ConnectionFactory#setObservationCollector( ObservationCollector) */ public interface ObservationCollector { ObservationCollector NO_OP = new NoOpObservationCollector(); + /** + * Decorate message publishing. + * + *

Implementations are expected to call {@link PublishCall#publish( PublishCall, + * AMQP.Basic.Publish, AMQP.BasicProperties, byte[], ConnectionInfo)} to make sure the message is + * actually sent. + * + * @param call + * @param publish + * @param properties + * @param body + * @param connectionInfo + * @throws IOException + */ void publish( PublishCall call, AMQP.Basic.Publish publish, @@ -34,13 +57,44 @@ void publish( ConnectionInfo connectionInfo) throws IOException; + /** + * Decorate consumer registration. + * + *

Implementations are expected to decorate the appropriate {@link Consumer} callbacks. The + * original {@link Consumer} behavior should not be changed though. + * + * @param queue + * @param consumerTag + * @param consumer + * @return + */ Consumer basicConsume(String queue, String consumerTag, Consumer consumer); + /** + * Decorate message polling with basic.get. + * + *

Implementations are expected to {@link BasicGetCall#basicGet( BasicGetCall, String)} and + * return the same result. + * + * @param call + * @param queue + * @return + */ + GetResponse basicGet(BasicGetCall call, String queue); + + /** Underlying publishing call. */ interface PublishCall { void publish(AMQP.BasicProperties properties) throws IOException; } + /** Underlying basic.get call. */ + interface BasicGetCall { + + GetResponse get(); + } + + /** Connection information. */ interface ConnectionInfo { String getPeerAddress(); diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java similarity index 76% rename from src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java rename to src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java index 6b8401d807..88821b7120 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultConsumeObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java @@ -12,7 +12,6 @@ // // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.observation.micrometer; import com.rabbitmq.client.observation.micrometer.RabbitMqObservationDocumentation.HighCardinalityTags; @@ -21,21 +20,19 @@ import io.micrometer.common.util.StringUtils; /** - * Default implementation of {@link ConsumeObservationConvention}. + * Default implementation of {@link DeliverObservationConvention}. * * @since 5.18.0 - * @see ConsumeObservationConvention + * @see DeliverObservationConvention */ -public class DefaultConsumeObservationConvention implements ConsumeObservationConvention { +public class DefaultDeliverObservationConvention implements DeliverObservationConvention { private final String name; + private final String operation; - public DefaultConsumeObservationConvention() { - this("rabbitmq.consume"); - } - - public DefaultConsumeObservationConvention(String name) { + public DefaultDeliverObservationConvention(String name, String operation) { this.name = name; + this.operation = operation; } @Override @@ -44,8 +41,8 @@ public String getName() { } @Override - public String getContextualName(ConsumeContext context) { - return source(context.getQueue()) + " consume"; + public String getContextualName(DeliverContext context) { + return source(context.getQueue()) + " " + operation; } private String exchange(String destination) { @@ -57,14 +54,14 @@ private String source(String destination) { } @Override - public KeyValues getLowCardinalityKeyValues(ConsumeContext context) { + public KeyValues getLowCardinalityKeyValues(DeliverContext context) { return KeyValues.of( - LowCardinalityTags.MESSAGING_OPERATION.withValue("consume"), + LowCardinalityTags.MESSAGING_OPERATION.withValue(this.operation), LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq")); } @Override - public KeyValues getHighCardinalityKeyValues(ConsumeContext context) { + public KeyValues getHighCardinalityKeyValues(DeliverContext context) { return KeyValues.of( HighCardinalityTags.MESSAGING_ROUTING_KEY.withValue(context.getRoutingKey()), HighCardinalityTags.MESSAGING_DESTINATION_NAME.withValue(exchange(context.getExchange())), diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java index 3880eec4ff..84c450fdda 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java @@ -12,7 +12,6 @@ // // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.observation.micrometer; import com.rabbitmq.client.observation.micrometer.RabbitMqObservationDocumentation.HighCardinalityTags; @@ -24,7 +23,6 @@ * Default implementation of {@link PublishObservationConvention}. * * @since 5.18.0 - * @see RabbitMqObservationDocumentation */ public class DefaultPublishObservationConvention implements PublishObservationConvention { diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java similarity index 89% rename from src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java rename to src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java index f7cbb53d96..86f2eb1468 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeContext.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java @@ -12,7 +12,6 @@ // // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.observation.micrometer; import io.micrometer.observation.transport.ReceiverContext; @@ -24,15 +23,19 @@ * * @since 5.18.0 */ -public class ConsumeContext extends ReceiverContext> { +public class DeliverContext extends ReceiverContext> { private final String exchange; private final String routingKey; private final int payloadSizeBytes; private final String queue; - ConsumeContext(String exchange, String routingKey, String queue, Map headers, - int payloadSizeBytes) { + DeliverContext( + String exchange, + String routingKey, + String queue, + Map headers, + int payloadSizeBytes) { super( (hdrs, key) -> { Object result = hdrs.get(key); @@ -63,5 +66,4 @@ public int getPayloadSizeBytes() { public String getQueue() { return queue; } - } diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java similarity index 85% rename from src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeObservationConvention.java rename to src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java index 38ce2aa333..c34ec4094f 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/ConsumeObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java @@ -12,7 +12,6 @@ // // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.observation.micrometer; import io.micrometer.observation.Observation; @@ -22,12 +21,11 @@ * {@link ObservationConvention} for RabbitMQ client instrumentation. * * @since 5.18.0 - * @see DefaultPublishObservationConvention */ -public interface ConsumeObservationConvention extends ObservationConvention { +public interface DeliverObservationConvention extends ObservationConvention { @Override default boolean supportsContext(Observation.Context context) { - return context instanceof ConsumeContext; + return context instanceof DeliverContext; } } diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java index fa42721255..2060cff0e1 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -12,7 +12,6 @@ // // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.observation.micrometer; import com.rabbitmq.client.*; @@ -29,24 +28,33 @@ class MicrometerObservationCollector implements ObservationCollector { private final ObservationRegistry registry; private final PublishObservationConvention customPublishConvention, defaultPublishConvention; - private final ConsumeObservationConvention customConsumeConvention, defaultConsumeConvention; + private final DeliverObservationConvention customProcessConvention, defaultProcessConvention; + private final DeliverObservationConvention customReceiveConvention, defaultReceiveConvention; MicrometerObservationCollector( ObservationRegistry registry, PublishObservationConvention customPublishConvention, PublishObservationConvention defaultPublishConvention, - ConsumeObservationConvention customConsumeConvention, - ConsumeObservationConvention defaultConsumeConvention) { + DeliverObservationConvention customProcessConvention, + DeliverObservationConvention defaultProcessConvention, + DeliverObservationConvention customReceiveConvention, + DeliverObservationConvention defaultReceiveConvention) { this.registry = registry; this.customPublishConvention = customPublishConvention; this.defaultPublishConvention = defaultPublishConvention; - this.customConsumeConvention = customConsumeConvention; - this.defaultConsumeConvention = defaultConsumeConvention; + this.customProcessConvention = customProcessConvention; + this.defaultProcessConvention = defaultProcessConvention; + this.customReceiveConvention = customReceiveConvention; + this.defaultReceiveConvention = defaultReceiveConvention; } @Override - public void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProperties properties, - byte [] body, ConnectionInfo connectionInfo) + public void publish( + PublishCall call, + AMQP.Basic.Publish publish, + AMQP.BasicProperties properties, + byte[] body, + ConnectionInfo connectionInfo) throws IOException { // TODO: Is this for fire and forget or request reply too? If r-r then we have to have 2 // contexts @@ -57,17 +65,14 @@ public void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProp headers = new HashMap<>(properties.getHeaders()); } PublishContext micrometerPublishContext = - new PublishContext(publish.getExchange(), publish.getRoutingKey(), headers, + new PublishContext( + publish.getExchange(), + publish.getRoutingKey(), + headers, body == null ? 0 : body.length, connectionInfo); AMQP.BasicProperties.Builder builder = properties.builder(); builder.headers(headers); - // TODO give possibility to create the publish observation - // the custom convention is already a property, the default convention could be a property as - // well. - // the name (in default convention) could also be set in a simple way, from the base - // configuration - // no need to give access to the other 2 parameters Observation observation = RabbitMqObservationDocumentation.PUBLISH_OBSERVATION.observation( this.customPublishConvention, @@ -88,7 +93,39 @@ public void publish(PublishCall call, AMQP.Basic.Publish publish, AMQP.BasicProp public Consumer basicConsume(String queue, String consumerTag, Consumer consumer) { return new ObservationConsumer( queue, - consumer, this.registry, this.customConsumeConvention, this.defaultConsumeConvention); + consumer, + this.registry, + this.customProcessConvention, + this.defaultProcessConvention); + } + + @Override + public GetResponse basicGet(BasicGetCall call, String queue) { + Observation parentObservation = Observation.start("rabbitmq.receive", registry); + try { + GetResponse response = call.get(); + if (response != null) { + DeliverContext context = + new DeliverContext( + response.getEnvelope().getExchange(), + response.getEnvelope().getRoutingKey(), + queue, + response.getProps().getHeaders(), + response.getBody() == null ? 0 : response.getBody().length); + Observation observation = + RabbitMqObservationDocumentation.RECEIVE_OBSERVATION.observation( + customReceiveConvention, defaultReceiveConvention, () -> context, registry); + observation.parentObservation(parentObservation); + observation.start(); + observation.stop(); + } + return response; + } catch (RuntimeException e) { + parentObservation.error(e); + throw e; + } finally { + parentObservation.stop(); + } } private static class ObservationConsumer implements Consumer { @@ -98,14 +135,14 @@ private static class ObservationConsumer implements Consumer { private final ObservationRegistry observationRegistry; - private final ConsumeObservationConvention customConsumeConvention, defaultConsumeConvention; + private final DeliverObservationConvention customConsumeConvention, defaultConsumeConvention; private ObservationConsumer( String queue, Consumer delegate, ObservationRegistry observationRegistry, - ConsumeObservationConvention customConsumeConvention, - ConsumeObservationConvention defaultConsumeConvention) { + DeliverObservationConvention customConsumeConvention, + DeliverObservationConvention defaultConsumeConvention) { this.queue = queue; this.delegate = delegate; this.observationRegistry = observationRegistry; @@ -148,16 +185,15 @@ public void handleDelivery( } else { headers = properties.getHeaders(); } - ConsumeContext context = - new ConsumeContext(envelope.getExchange(), envelope.getRoutingKey(), queue, headers, body == null ? 0 : body.length); - // TODO give possibility to create the consume observation - // the custom convention is already a property, the default convention could be a property as - // well. - // the name (in default convention) could also be set in a simple way, from the base - // configuration - // no need to give access to the other 2 parameters + DeliverContext context = + new DeliverContext( + envelope.getExchange(), + envelope.getRoutingKey(), + queue, + headers, + body == null ? 0 : body.length); Observation observation = - RabbitMqObservationDocumentation.CONSUME_OBSERVATION.observation( + RabbitMqObservationDocumentation.PROCESS_OBSERVATION.observation( customConsumeConvention, defaultConsumeConvention, () -> context, diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java index fa78587066..10e80556d4 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java @@ -12,13 +12,15 @@ // // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.observation.micrometer; import com.rabbitmq.client.observation.ObservationCollector; import io.micrometer.observation.ObservationRegistry; /** + * Builder to configure and create Micrometer + * Observation implementation of {@link ObservationCollector}. + * * @since 5.18.0 */ public class MicrometerObservationCollectorBuilder { @@ -27,9 +29,12 @@ public class MicrometerObservationCollectorBuilder { private PublishObservationConvention customPublishObservationConvention; private PublishObservationConvention defaultPublishObservationConvention = new DefaultPublishObservationConvention(); - private ConsumeObservationConvention customConsumeObservationConvention; - private ConsumeObservationConvention defaultConsumeObservationConvention = - new DefaultConsumeObservationConvention(); + private DeliverObservationConvention customProcessObservationConvention; + private DeliverObservationConvention defaultProcessObservationConvention = + new DefaultDeliverObservationConvention("rabbitmq.process", "process"); + private DeliverObservationConvention customReceiveObservationConvention; + private DeliverObservationConvention defaultReceiveObservationConvention = + new DefaultDeliverObservationConvention("rabbitmq.receive", "receive"); public MicrometerObservationCollectorBuilder registry(ObservationRegistry registry) { this.registry = registry; @@ -48,25 +53,38 @@ public MicrometerObservationCollectorBuilder defaultPublishObservationConvention return this; } - public MicrometerObservationCollectorBuilder customConsumeObservationConvention( - ConsumeObservationConvention customConsumeObservationConvention) { - this.customConsumeObservationConvention = customConsumeObservationConvention; + public MicrometerObservationCollectorBuilder customProcessObservationConvention( + DeliverObservationConvention customConsumeObservationConvention) { + this.customProcessObservationConvention = customConsumeObservationConvention; + return this; + } + + public MicrometerObservationCollectorBuilder defaultProcessObservationConvention( + DeliverObservationConvention defaultConsumeObservationConvention) { + this.defaultProcessObservationConvention = defaultConsumeObservationConvention; + return this; + } + + public MicrometerObservationCollectorBuilder customReceiveObservationConvention( + DeliverObservationConvention customReceiveObservationConvention) { + this.customReceiveObservationConvention = customReceiveObservationConvention; return this; } - public MicrometerObservationCollectorBuilder defaultConsumeObservationConvention( - ConsumeObservationConvention defaultConsumeObservationConvention) { - this.defaultConsumeObservationConvention = defaultConsumeObservationConvention; + public MicrometerObservationCollectorBuilder defaultReceiveObservationConvention( + DeliverObservationConvention defaultReceiveObservationConvention) { + this.defaultReceiveObservationConvention = defaultReceiveObservationConvention; return this; } public ObservationCollector build() { return new MicrometerObservationCollector( - this.registry, - this.customPublishObservationConvention, - this.defaultPublishObservationConvention, - this.customConsumeObservationConvention, - this.defaultConsumeObservationConvention - ); + this.registry, + this.customPublishObservationConvention, + this.defaultPublishObservationConvention, + this.customProcessObservationConvention, + this.defaultProcessObservationConvention, + this.customReceiveObservationConvention, + this.defaultReceiveObservationConvention); } } diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java index d5c450279d..a559b0b526 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java @@ -12,7 +12,6 @@ // // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.observation.micrometer; import com.rabbitmq.client.observation.ObservationCollector; @@ -33,7 +32,10 @@ public class PublishContext extends SenderContext> { private final ObservationCollector.ConnectionInfo connectionInfo; PublishContext( - String exchange, String routingKey, Map headers, int payloadSizeBytes, + String exchange, + String routingKey, + Map headers, + int payloadSizeBytes, ObservationCollector.ConnectionInfo connectionInfo) { super((hdrs, key, value) -> hdrs.put(key, value)); this.exchange = exchange; diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java index 699921ba6f..8b9aeaf03f 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java @@ -12,7 +12,6 @@ // // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.observation.micrometer; import io.micrometer.observation.Observation; @@ -22,7 +21,6 @@ * {@link ObservationConvention} for RabbitMQ client instrumentation. * * @since 5.18.0 - * @see DefaultPublishObservationConvention */ public interface PublishObservationConvention extends ObservationConvention { diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java index be0f98d6dd..f6563a1b2e 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java @@ -12,7 +12,6 @@ // // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.observation.micrometer; import io.micrometer.common.docs.KeyName; @@ -26,8 +25,6 @@ * @since 5.18.0 */ public enum RabbitMqObservationDocumentation implements ObservationDocumentation { - - /** Observation for Rabbit Client publishers. */ PUBLISH_OBSERVATION { @Override @@ -42,13 +39,26 @@ public KeyName[] getLowCardinalityKeyNames() { } }, - /** Observation for Rabbit Client consumers. */ - CONSUME_OBSERVATION { + PROCESS_OBSERVATION { + + @Override + public Class> + getDefaultConvention() { + return DefaultDeliverObservationConvention.class; + } + + @Override + public KeyName[] getLowCardinalityKeyNames() { + return LowCardinalityTags.values(); + } + }, + + RECEIVE_OBSERVATION { @Override public Class> getDefaultConvention() { - return DefaultConsumeObservationConvention.class; + return DefaultDeliverObservationConvention.class; } @Override diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index 4955611b12..0af4d3ecfd 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -12,7 +12,6 @@ // // If you have any questions regarding licensing, please contact us at // info@rabbitmq.com. - package com.rabbitmq.client.test.functional; import static com.rabbitmq.client.test.TestUtils.waitAtMost; @@ -29,8 +28,10 @@ import io.micrometer.tracing.test.simple.SpansAssert; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.util.Objects; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; import org.junit.jupiter.api.Nested; public class MicrometerObservationCollectorMetrics extends BrokerTestCase { @@ -142,9 +143,72 @@ public SampleTestRunnerConsumer yourCode() { .hasTag("messaging.destination.name", "amq.default") .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)) .hasTagWithKey("net.sock.peer.addr") - .hasTag("net.sock.peer.port", "5672"); + .hasTag("net.sock.peer.port", "5672") + .hasTag("net.protocol.name", "amqp") + .hasTag("net.protocol.version", "0.9.1"); + SpanAssert.assertThat(buildingBlocks.getFinishedSpans().get(1)) + .hasNameEqualTo("metrics.queue process") + .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") + .hasTag("messaging.destination.name", "amq.default") + .hasTag("messaging.source.name", "metrics.queue") + .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)); + waitAtMost( + () -> + getMeterRegistry().find("rabbitmq.publish").timer() != null + && getMeterRegistry().find("rabbitmq.process").timer() != null); + getMeterRegistry() + .get("rabbitmq.publish") + .tag("messaging.operation", "publish") + .tag("messaging.system", "rabbitmq") + .timer(); + getMeterRegistry() + .get("rabbitmq.process") + .tag("messaging.operation", "process") + .tag("messaging.system", "rabbitmq") + .timer(); + } finally { + safeClose(publishConnection); + safeClose(consumeConnection); + } + }; + } + } + + @Nested + class PublishBasicGet extends IntegrationTest { + + @Override + public SampleTestRunnerConsumer yourCode() { + return (buildingBlocks, meterRegistry) -> { + ConnectionFactory connectionFactory = createConnectionFactory(getObservationRegistry()); + Connection publishConnection = null, consumeConnection = null; + try { + publishConnection = connectionFactory.newConnection(); + Channel channel = publishConnection.createChannel(); + + sendMessage(channel); + + consumeConnection = connectionFactory.newConnection(); + Channel basicGetChannel = consumeConnection.createChannel(); + waitAtMost(() -> basicGetChannel.basicGet(QUEUE, true) != null); + + waitAtMost(() -> buildingBlocks.getFinishedSpans().size() >= 3); + System.out.println( + buildingBlocks.getFinishedSpans().stream() + .map(Objects::toString) + .collect(Collectors.joining("\n"))); + SpansAssert.assertThat(buildingBlocks.getFinishedSpans()).haveSameTraceId(); + SpanAssert.assertThat(buildingBlocks.getFinishedSpans().get(0)) + .hasNameEqualTo("metrics.queue publish") + .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") + .hasTag("messaging.destination.name", "amq.default") + .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)) + .hasTagWithKey("net.sock.peer.addr") + .hasTag("net.sock.peer.port", "5672") + .hasTag("net.protocol.name", "amqp") + .hasTag("net.protocol.version", "0.9.1"); SpanAssert.assertThat(buildingBlocks.getFinishedSpans().get(1)) - .hasNameEqualTo("metrics.queue consume") + .hasNameEqualTo("metrics.queue receive") .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") .hasTag("messaging.destination.name", "amq.default") .hasTag("messaging.source.name", "metrics.queue") @@ -152,15 +216,15 @@ public SampleTestRunnerConsumer yourCode() { waitAtMost( () -> getMeterRegistry().find("rabbitmq.publish").timer() != null - && getMeterRegistry().find("rabbitmq.consume").timer() != null); + && getMeterRegistry().find("rabbitmq.receive").timer() != null); getMeterRegistry() .get("rabbitmq.publish") .tag("messaging.operation", "publish") .tag("messaging.system", "rabbitmq") .timer(); getMeterRegistry() - .get("rabbitmq.consume") - .tag("messaging.operation", "consume") + .get("rabbitmq.receive") + .tag("messaging.operation", "receive") .tag("messaging.system", "rabbitmq") .timer(); } finally { From 4cd64315b7762ee9d851923c1211866a2aeadf26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 17 May 2023 16:40:38 +0200 Subject: [PATCH 289/657] Make sure headers are not null (cherry picked from commit 5c03a2ab69ee9897415916728e110ae132a1ffa4) --- .../micrometer/MicrometerObservationCollector.java | 11 +++++++++-- .../MicrometerObservationCollectorMetrics.java | 1 - 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java index 2060cff0e1..26f00de845 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -85,8 +85,9 @@ public void publish( } catch (IOException | AlreadyClosedException e) { observation.error(e); throw e; + } finally { + observation.stop(); } - observation.stop(); } @Override @@ -105,12 +106,18 @@ public GetResponse basicGet(BasicGetCall call, String queue) { try { GetResponse response = call.get(); if (response != null) { + Map headers; + if (response.getProps() == null || response.getProps().getHeaders() == null) { + headers = Collections.emptyMap(); + } else { + headers = response.getProps().getHeaders(); + } DeliverContext context = new DeliverContext( response.getEnvelope().getExchange(), response.getEnvelope().getRoutingKey(), queue, - response.getProps().getHeaders(), + headers, response.getBody() == null ? 0 : response.getBody().length); Observation observation = RabbitMqObservationDocumentation.RECEIVE_OBSERVATION.observation( diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index 0af4d3ecfd..9c11d8d098 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -191,7 +191,6 @@ public SampleTestRunnerConsumer yourCode() { consumeConnection = connectionFactory.newConnection(); Channel basicGetChannel = consumeConnection.createChannel(); waitAtMost(() -> basicGetChannel.basicGet(QUEUE, true) != null); - waitAtMost(() -> buildingBlocks.getFinishedSpans().size() >= 3); System.out.println( buildingBlocks.getFinishedSpans().stream() From c7321724fb9e1df4febeaa580178a93213f913df Mon Sep 17 00:00:00 2001 From: Marcin Grzejszczak Date: Mon, 22 May 2023 16:15:08 +0200 Subject: [PATCH 290/657] Wrapping call in observe(...) and nulling sender Due to the fact that in the tests we have both the producer and the consumer and they have the same parent, the zipkin graph looks bizarre. With these changes we're changing the test sending code to simulate sending a message from a different service that will result in a creation of a new trace identifier. Due to this we will have 2 sets of trace ids created, one for sending and one for polling. Sending: null_observation -> send -> receive message Polling: test_span -> receive (very short) (cherry picked from commit c854a0a7679136ef568526c72f9aa8fc2b3cf332) --- .../DefaultDeliverObservationConvention.java | 1 + .../MicrometerObservationCollector.java | 27 +++++--------- ...MicrometerObservationCollectorMetrics.java | 37 +++++++++++++++++-- 3 files changed, 44 insertions(+), 21 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java index 88821b7120..71a9ccfce6 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java @@ -35,6 +35,7 @@ public DefaultDeliverObservationConvention(String name, String operation) { this.operation = operation; } + // TODO: If the name is not fixed we won't be able to parse it to automatically document the name @Override public String getName() { return name; diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java index 26f00de845..43083e9bb1 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -102,8 +102,7 @@ public Consumer basicConsume(String queue, String consumerTag, Consumer consumer @Override public GetResponse basicGet(BasicGetCall call, String queue) { - Observation parentObservation = Observation.start("rabbitmq.receive", registry); - try { + return Observation.createNotStarted("rabbitmq.receive", registry).observe(() -> { GetResponse response = call.get(); if (response != null) { Map headers; @@ -113,26 +112,20 @@ public GetResponse basicGet(BasicGetCall call, String queue) { headers = response.getProps().getHeaders(); } DeliverContext context = - new DeliverContext( - response.getEnvelope().getExchange(), - response.getEnvelope().getRoutingKey(), - queue, - headers, - response.getBody() == null ? 0 : response.getBody().length); + new DeliverContext( + response.getEnvelope().getExchange(), + response.getEnvelope().getRoutingKey(), + queue, + headers, + response.getBody() == null ? 0 : response.getBody().length); Observation observation = - RabbitMqObservationDocumentation.RECEIVE_OBSERVATION.observation( - customReceiveConvention, defaultReceiveConvention, () -> context, registry); - observation.parentObservation(parentObservation); + RabbitMqObservationDocumentation.RECEIVE_OBSERVATION.observation( + customReceiveConvention, defaultReceiveConvention, () -> context, registry); observation.start(); observation.stop(); } return response; - } catch (RuntimeException e) { - parentObservation.error(e); - throw e; - } finally { - parentObservation.stop(); - } + }); } private static class ObservationConsumer implements Consumer { diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index 9c11d8d098..5f9538c4ab 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -22,16 +22,25 @@ import com.rabbitmq.client.observation.micrometer.MicrometerObservationCollectorBuilder; import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; +import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationRegistry; +import io.micrometer.tracing.Tracer; +import io.micrometer.tracing.exporter.FinishedSpan; import io.micrometer.tracing.test.SampleTestRunner; import io.micrometer.tracing.test.simple.SpanAssert; import io.micrometer.tracing.test.simple.SpansAssert; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.util.Collection; +import java.util.Comparator; +import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; + +import org.assertj.core.api.BDDAssertions; import org.junit.jupiter.api.Nested; public class MicrometerObservationCollectorMetrics extends BrokerTestCase { @@ -111,6 +120,17 @@ private abstract static class IntegrationTest extends SampleTestRunner { public TracingSetup[] getTracingSetup() { return new TracingSetup[] {TracingSetup.IN_MEMORY_BRAVE, TracingSetup.ZIPKIN_BRAVE}; } + + void runWithNullingObservation(ObservationRegistry registry, Tracer tracer, Observation.CheckedRunnable runnable) { + Observation noParentObservation = Observation.createNotStarted("null_observation", registry); + noParentObservation.parentObservation(null); + try (Tracer.SpanInScope ws = tracer.withSpan(null)) { + noParentObservation.observeChecked(runnable); + } + catch (Throwable e) { + throw new RuntimeException(e); + } + } } @Nested @@ -186,7 +206,7 @@ public SampleTestRunnerConsumer yourCode() { publishConnection = connectionFactory.newConnection(); Channel channel = publishConnection.createChannel(); - sendMessage(channel); + runWithNullingObservation(getObservationRegistry(), buildingBlocks.getTracer(), () -> sendMessage(channel)); consumeConnection = connectionFactory.newConnection(); Channel basicGetChannel = consumeConnection.createChannel(); @@ -196,8 +216,14 @@ public SampleTestRunnerConsumer yourCode() { buildingBlocks.getFinishedSpans().stream() .map(Objects::toString) .collect(Collectors.joining("\n"))); - SpansAssert.assertThat(buildingBlocks.getFinishedSpans()).haveSameTraceId(); - SpanAssert.assertThat(buildingBlocks.getFinishedSpans().get(0)) + Map> finishedSpans = buildingBlocks.getFinishedSpans().stream() + .collect(Collectors.groupingBy(FinishedSpan::getTraceId)); + BDDAssertions.then(finishedSpans).as("One trace id for sending, one for polling").hasSize(2); + Collection> spans = finishedSpans.values(); + List sendAndReceiveSpans = spans.stream().filter(f -> f.size() == 3).findFirst().orElseThrow(() -> new AssertionError("null_observation (fake nulling observation) -> produce -> consume")); + sendAndReceiveSpans.sort(Comparator.comparing(FinishedSpan::getStartTimestamp)); + SpanAssert.assertThat(sendAndReceiveSpans.get(0)).hasNameEqualTo("null_observation"); + SpanAssert.assertThat(sendAndReceiveSpans.get(1)) .hasNameEqualTo("metrics.queue publish") .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") .hasTag("messaging.destination.name", "amq.default") @@ -206,12 +232,15 @@ public SampleTestRunnerConsumer yourCode() { .hasTag("net.sock.peer.port", "5672") .hasTag("net.protocol.name", "amqp") .hasTag("net.protocol.version", "0.9.1"); - SpanAssert.assertThat(buildingBlocks.getFinishedSpans().get(1)) + SpanAssert.assertThat(sendAndReceiveSpans.get(2)) .hasNameEqualTo("metrics.queue receive") .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") .hasTag("messaging.destination.name", "amq.default") .hasTag("messaging.source.name", "metrics.queue") .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)); + List pollingSpans = spans.stream().filter(f -> f.size() == 1).findFirst().orElseThrow(() -> new AssertionError("rabbitmq.receive (child of test span)")); + SpanAssert.assertThat(pollingSpans.get(0)) + .hasNameEqualTo("rabbitmq.receive"); waitAtMost( () -> getMeterRegistry().find("rabbitmq.publish").timer() != null From ca3514c739bb4c2f1f58b59f264679a541ec0621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 23 Jun 2023 11:25:16 +0200 Subject: [PATCH 291/657] Finalize Micrometer Observation integration (cherry picked from commit 946d30a1042a40964034eb3e647cf8cacbda34ee) Conflicts: src/main/java/com/rabbitmq/client/ConnectionFactory.java --- pom.xml | 11 +--- .../rabbitmq/client/ConnectionFactory.java | 15 +++--- .../com/rabbitmq/client/impl/ChannelN.java | 2 +- .../observation/ObservationCollector.java | 3 +- .../DefaultDeliverObservationConvention.java | 2 +- .../DefaultPublishObservationConvention.java | 2 +- .../micrometer/DeliverContext.java | 2 +- .../DeliverObservationConvention.java | 2 +- .../MicrometerObservationCollector.java | 43 +++++++++------- ...MicrometerObservationCollectorBuilder.java | 2 +- .../micrometer/PublishContext.java | 2 +- .../PublishObservationConvention.java | 2 +- .../RabbitMqObservationDocumentation.java | 2 +- ...MicrometerObservationCollectorMetrics.java | 50 ++++++++----------- 14 files changed, 69 insertions(+), 71 deletions(-) diff --git a/pom.xml b/pom.xml index 30519fea95..18ba84db66 100644 --- a/pom.xml +++ b/pom.xml @@ -60,12 +60,12 @@ 1.11.1 1.1.4 1.28.0 - 1.1.4 2.15.2 1.2.12 5.9.3 5.4.0 3.24.2 + 1.1.2 9.4.51.v20230217 1.70 0.10 @@ -798,12 +798,12 @@ io.micrometer micrometer-tracing-integration-test + ${micrometer-tracing-test.version} test - @@ -813,13 +813,6 @@ pom import - - io.micrometer - micrometer-tracing-bom - ${micrometer-tracing.version} - pom - import - diff --git a/src/main/java/com/rabbitmq/client/ConnectionFactory.java b/src/main/java/com/rabbitmq/client/ConnectionFactory.java index 5a98f3e86b..c05cec6201 100644 --- a/src/main/java/com/rabbitmq/client/ConnectionFactory.java +++ b/src/main/java/com/rabbitmq/client/ConnectionFactory.java @@ -954,12 +954,15 @@ public MetricsCollector getMetricsCollector() { return metricsCollector; } - /** - * - * @since 5.18.0 - * @param observationCollector - */ - public void setObservationCollector(ObservationCollector observationCollector) { + /** + * Set observation collector. + * + * @param observationCollector the collector instance + * @since 5.19.0 + * @see ObservationCollector + * @see com.rabbitmq.client.observation.micrometer.MicrometerObservationCollectorBuilder + */ + public void setObservationCollector(ObservationCollector observationCollector) { this.observationCollector = observationCollector; } diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelN.java b/src/main/java/com/rabbitmq/client/impl/ChannelN.java index e4fcabd14b..d08593eaa8 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelN.java @@ -723,7 +723,7 @@ public void basicPublish(String exchange, String routingKey, metricsCollector.basicPublishFailure(this, e); throw e; } - metricsCollector.basicPublish(this, deliveryTag); + metricsCollector.basicPublish(this); } /** Public API - {@inheritDoc} */ diff --git a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java index bc10f8d684..e542d34387 100644 --- a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java @@ -28,8 +28,9 @@ * *

This is considered an SPI and is susceptible to change at any time. * - * @since 5.18.0 + * @since 5.19.0 * @see com.rabbitmq.client.ConnectionFactory#setObservationCollector( ObservationCollector) + * @see com.rabbitmq.client.observation.micrometer.MicrometerObservationCollectorBuilder */ public interface ObservationCollector { diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java index 71a9ccfce6..12b12e4b0f 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java @@ -22,7 +22,7 @@ /** * Default implementation of {@link DeliverObservationConvention}. * - * @since 5.18.0 + * @since 5.19.0 * @see DeliverObservationConvention */ public class DefaultDeliverObservationConvention implements DeliverObservationConvention { diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java index 84c450fdda..019e32367f 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java @@ -22,7 +22,7 @@ /** * Default implementation of {@link PublishObservationConvention}. * - * @since 5.18.0 + * @since 5.19.0 */ public class DefaultPublishObservationConvention implements PublishObservationConvention { diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java index 86f2eb1468..2209d7897c 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java @@ -21,7 +21,7 @@ * {@link io.micrometer.observation.Observation.Context} for use with RabbitMQ client {@link * io.micrometer.observation.Observation} instrumentation. * - * @since 5.18.0 + * @since 5.19.0 */ public class DeliverContext extends ReceiverContext> { diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java index c34ec4094f..ba10eca747 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java @@ -20,7 +20,7 @@ /** * {@link ObservationConvention} for RabbitMQ client instrumentation. * - * @since 5.18.0 + * @since 5.19.0 */ public interface DeliverObservationConvention extends ObservationConvention { diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java index 43083e9bb1..cea17f70a1 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -102,30 +102,37 @@ public Consumer basicConsume(String queue, String consumerTag, Consumer consumer @Override public GetResponse basicGet(BasicGetCall call, String queue) { - return Observation.createNotStarted("rabbitmq.receive", registry).observe(() -> { - GetResponse response = call.get(); - if (response != null) { - Map headers; - if (response.getProps() == null || response.getProps().getHeaders() == null) { - headers = Collections.emptyMap(); - } else { - headers = response.getProps().getHeaders(); - } - DeliverContext context = - new DeliverContext( + return Observation.createNotStarted("rabbitmq.receive", registry) + .observe( + () -> { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + GetResponse response = call.get(); + if (response != null) { + Map headers; + if (response.getProps() == null || response.getProps().getHeaders() == null) { + headers = Collections.emptyMap(); + } else { + headers = response.getProps().getHeaders(); + } + DeliverContext context = + new DeliverContext( response.getEnvelope().getExchange(), response.getEnvelope().getRoutingKey(), queue, headers, response.getBody() == null ? 0 : response.getBody().length); - Observation observation = - RabbitMqObservationDocumentation.RECEIVE_OBSERVATION.observation( + Observation observation = + RabbitMqObservationDocumentation.RECEIVE_OBSERVATION.observation( customReceiveConvention, defaultReceiveConvention, () -> context, registry); - observation.start(); - observation.stop(); - } - return response; - }); + observation.start(); + observation.stop(); + } + return response; + }); } private static class ObservationConsumer implements Consumer { diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java index 10e80556d4..464ec2aa15 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java @@ -21,7 +21,7 @@ * Builder to configure and create Micrometer * Observation implementation of {@link ObservationCollector}. * - * @since 5.18.0 + * @since 5.19.0 */ public class MicrometerObservationCollectorBuilder { diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java index a559b0b526..51b3e06be4 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java @@ -22,7 +22,7 @@ * {@link io.micrometer.observation.Observation.Context} for use with RabbitMQ client {@link * io.micrometer.observation.Observation} instrumentation. * - * @since 5.18.0 + * @since 5.19.0 */ public class PublishContext extends SenderContext> { diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java index 8b9aeaf03f..f6fce73ff2 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java @@ -20,7 +20,7 @@ /** * {@link ObservationConvention} for RabbitMQ client instrumentation. * - * @since 5.18.0 + * @since 5.19.0 */ public interface PublishObservationConvention extends ObservationConvention { diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java index f6563a1b2e..3ce9af4647 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java @@ -22,7 +22,7 @@ /** * {@link ObservationDocumentation} for RabbitMQ Clients. * - * @since 5.18.0 + * @since 5.19.0 */ public enum RabbitMqObservationDocumentation implements ObservationDocumentation { PUBLISH_OBSERVATION { diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index 5f9538c4ab..cfc6a01d5c 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -22,9 +22,8 @@ import com.rabbitmq.client.observation.micrometer.MicrometerObservationCollectorBuilder; import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; -import io.micrometer.observation.Observation; +import io.micrometer.observation.NullObservation; import io.micrometer.observation.ObservationRegistry; -import io.micrometer.tracing.Tracer; import io.micrometer.tracing.exporter.FinishedSpan; import io.micrometer.tracing.test.SampleTestRunner; import io.micrometer.tracing.test.simple.SpanAssert; @@ -35,11 +34,9 @@ import java.util.Comparator; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; - import org.assertj.core.api.BDDAssertions; import org.junit.jupiter.api.Nested; @@ -120,17 +117,6 @@ private abstract static class IntegrationTest extends SampleTestRunner { public TracingSetup[] getTracingSetup() { return new TracingSetup[] {TracingSetup.IN_MEMORY_BRAVE, TracingSetup.ZIPKIN_BRAVE}; } - - void runWithNullingObservation(ObservationRegistry registry, Tracer tracer, Observation.CheckedRunnable runnable) { - Observation noParentObservation = Observation.createNotStarted("null_observation", registry); - noParentObservation.parentObservation(null); - try (Tracer.SpanInScope ws = tracer.withSpan(null)) { - noParentObservation.observeChecked(runnable); - } - catch (Throwable e) { - throw new RuntimeException(e); - } - } } @Nested @@ -206,24 +192,29 @@ public SampleTestRunnerConsumer yourCode() { publishConnection = connectionFactory.newConnection(); Channel channel = publishConnection.createChannel(); - runWithNullingObservation(getObservationRegistry(), buildingBlocks.getTracer(), () -> sendMessage(channel)); + new NullObservation(getObservationRegistry()).observeChecked(() -> sendMessage(channel)); consumeConnection = connectionFactory.newConnection(); Channel basicGetChannel = consumeConnection.createChannel(); waitAtMost(() -> basicGetChannel.basicGet(QUEUE, true) != null); waitAtMost(() -> buildingBlocks.getFinishedSpans().size() >= 3); - System.out.println( + Map> finishedSpans = buildingBlocks.getFinishedSpans().stream() - .map(Objects::toString) - .collect(Collectors.joining("\n"))); - Map> finishedSpans = buildingBlocks.getFinishedSpans().stream() .collect(Collectors.groupingBy(FinishedSpan::getTraceId)); - BDDAssertions.then(finishedSpans).as("One trace id for sending, one for polling").hasSize(2); + BDDAssertions.then(finishedSpans) + .as("One trace id for sending, one for polling") + .hasSize(2); Collection> spans = finishedSpans.values(); - List sendAndReceiveSpans = spans.stream().filter(f -> f.size() == 3).findFirst().orElseThrow(() -> new AssertionError("null_observation (fake nulling observation) -> produce -> consume")); + List sendAndReceiveSpans = + spans.stream() + .filter(f -> f.size() == 2) + .findFirst() + .orElseThrow( + () -> + new AssertionError( + "null_observation (fake nulling observation) -> produce -> consume")); sendAndReceiveSpans.sort(Comparator.comparing(FinishedSpan::getStartTimestamp)); - SpanAssert.assertThat(sendAndReceiveSpans.get(0)).hasNameEqualTo("null_observation"); - SpanAssert.assertThat(sendAndReceiveSpans.get(1)) + SpanAssert.assertThat(sendAndReceiveSpans.get(0)) .hasNameEqualTo("metrics.queue publish") .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") .hasTag("messaging.destination.name", "amq.default") @@ -232,15 +223,18 @@ public SampleTestRunnerConsumer yourCode() { .hasTag("net.sock.peer.port", "5672") .hasTag("net.protocol.name", "amqp") .hasTag("net.protocol.version", "0.9.1"); - SpanAssert.assertThat(sendAndReceiveSpans.get(2)) + SpanAssert.assertThat(sendAndReceiveSpans.get(1)) .hasNameEqualTo("metrics.queue receive") .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") .hasTag("messaging.destination.name", "amq.default") .hasTag("messaging.source.name", "metrics.queue") .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)); - List pollingSpans = spans.stream().filter(f -> f.size() == 1).findFirst().orElseThrow(() -> new AssertionError("rabbitmq.receive (child of test span)")); - SpanAssert.assertThat(pollingSpans.get(0)) - .hasNameEqualTo("rabbitmq.receive"); + List pollingSpans = + spans.stream() + .filter(f -> f.size() == 1) + .findFirst() + .orElseThrow(() -> new AssertionError("rabbitmq.receive (child of test span)")); + SpanAssert.assertThat(pollingSpans.get(0)).hasNameEqualTo("rabbitmq.receive"); waitAtMost( () -> getMeterRegistry().find("rabbitmq.publish").timer() != null From 9d961f58049d036ec77fdad50b7c91fa185a0d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 23 Jun 2023 16:28:47 +0200 Subject: [PATCH 292/657] Add tags to receive observation (cherry picked from commit 25855cf6fb745d29bdc51cc26696b4c246c428ae) --- .../micrometer/MicrometerObservationCollector.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java index cea17f70a1..fa487b2f1d 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -16,6 +16,7 @@ import com.rabbitmq.client.*; import com.rabbitmq.client.observation.ObservationCollector; +import io.micrometer.common.KeyValues; import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationRegistry; import java.io.IOException; @@ -56,8 +57,6 @@ public void publish( byte[] body, ConnectionInfo connectionInfo) throws IOException { - // TODO: Is this for fire and forget or request reply too? If r-r then we have to have 2 - // contexts Map headers; if (properties.getHeaders() == null) { headers = new HashMap<>(); @@ -103,13 +102,14 @@ public Consumer basicConsume(String queue, String consumerTag, Consumer consumer @Override public GetResponse basicGet(BasicGetCall call, String queue) { return Observation.createNotStarted("rabbitmq.receive", registry) + .highCardinalityKeyValues( + KeyValues.of( + RabbitMqObservationDocumentation.LowCardinalityTags.MESSAGING_OPERATION.withValue( + "receive"), + RabbitMqObservationDocumentation.LowCardinalityTags.MESSAGING_SYSTEM.withValue( + "rabbitmq"))) .observe( () -> { - try { - Thread.sleep(100); - } catch (InterruptedException e) { - throw new RuntimeException(e); - } GetResponse response = call.get(); if (response != null) { Map headers; From d89af312e08b18eaab8ed0a56e2da4d1c98de39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 26 Jun 2023 11:20:25 +0200 Subject: [PATCH 293/657] Add observation documentation generation (cherry picked from commit d0193543e00b91489c3f86a5be5f7524f5870c42) --- generate-observation-documentation.sh | 6 +++ .../DefaultDeliverObservationConvention.java | 12 +----- .../DefaultProcessObservationConvention.java | 27 +++++++++++++ .../DefaultReceiveObservationConvention.java | 27 +++++++++++++ ...MicrometerObservationCollectorBuilder.java | 4 +- .../RabbitMqObservationDocumentation.java | 40 ++++--------------- 6 files changed, 71 insertions(+), 45 deletions(-) create mode 100755 generate-observation-documentation.sh create mode 100644 src/main/java/com/rabbitmq/client/observation/micrometer/DefaultProcessObservationConvention.java create mode 100644 src/main/java/com/rabbitmq/client/observation/micrometer/DefaultReceiveObservationConvention.java diff --git a/generate-observation-documentation.sh b/generate-observation-documentation.sh new file mode 100755 index 0000000000..be0e4815bb --- /dev/null +++ b/generate-observation-documentation.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +./mvnw -q -P '!setup-test-cluster' test-compile exec:java \ + -Dexec.mainClass=io.micrometer.docs.DocsGeneratorCommand \ + -Dexec.classpathScope="test" \ + -Dexec.args='src/main/java/com/rabbitmq/client/observation/micrometer .* target/micrometer-observation-docs' \ No newline at end of file diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java index 12b12e4b0f..55a17e5d8a 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java @@ -25,22 +25,14 @@ * @since 5.19.0 * @see DeliverObservationConvention */ -public class DefaultDeliverObservationConvention implements DeliverObservationConvention { +abstract class DefaultDeliverObservationConvention implements DeliverObservationConvention { - private final String name; private final String operation; - public DefaultDeliverObservationConvention(String name, String operation) { - this.name = name; + public DefaultDeliverObservationConvention(String operation) { this.operation = operation; } - // TODO: If the name is not fixed we won't be able to parse it to automatically document the name - @Override - public String getName() { - return name; - } - @Override public String getContextualName(DeliverContext context) { return source(context.getQueue()) + " " + operation; diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultProcessObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultProcessObservationConvention.java new file mode 100644 index 0000000000..b7233adfae --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultProcessObservationConvention.java @@ -0,0 +1,27 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation.micrometer; + +public class DefaultProcessObservationConvention extends DefaultDeliverObservationConvention { + + public DefaultProcessObservationConvention(String operation) { + super(operation); + } + + @Override + public String getName() { + return "rabbitmq.process"; + } +} diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultReceiveObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultReceiveObservationConvention.java new file mode 100644 index 0000000000..7a4bd0317b --- /dev/null +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultReceiveObservationConvention.java @@ -0,0 +1,27 @@ +// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// +// This software, the RabbitMQ Java client library, is triple-licensed under the +// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 +// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see +// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.observation.micrometer; + +public class DefaultReceiveObservationConvention extends DefaultDeliverObservationConvention { + + public DefaultReceiveObservationConvention(String operation) { + super(operation); + } + + @Override + public String getName() { + return "rabbitmq.receive"; + } +} diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java index 464ec2aa15..d808e249b5 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java @@ -31,10 +31,10 @@ public class MicrometerObservationCollectorBuilder { new DefaultPublishObservationConvention(); private DeliverObservationConvention customProcessObservationConvention; private DeliverObservationConvention defaultProcessObservationConvention = - new DefaultDeliverObservationConvention("rabbitmq.process", "process"); + new DefaultProcessObservationConvention("process"); private DeliverObservationConvention customReceiveObservationConvention; private DeliverObservationConvention defaultReceiveObservationConvention = - new DefaultDeliverObservationConvention("rabbitmq.receive", "receive"); + new DefaultReceiveObservationConvention("receive"); public MicrometerObservationCollectorBuilder registry(ObservationRegistry registry) { this.registry = registry; diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java index 3ce9af4647..1b169d838f 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java @@ -25,6 +25,7 @@ * @since 5.19.0 */ public enum RabbitMqObservationDocumentation implements ObservationDocumentation { + /** Observation for publishing a message. */ PUBLISH_OBSERVATION { @Override @@ -39,12 +40,13 @@ public KeyName[] getLowCardinalityKeyNames() { } }, + /** Observation for processing a message. */ PROCESS_OBSERVATION { @Override public Class> getDefaultConvention() { - return DefaultDeliverObservationConvention.class; + return DefaultProcessObservationConvention.class; } @Override @@ -53,12 +55,13 @@ public KeyName[] getLowCardinalityKeyNames() { } }, + /** Observation for polling for a message with basic.get. */ RECEIVE_OBSERVATION { @Override public Class> getDefaultConvention() { - return DefaultDeliverObservationConvention.class; + return DefaultReceiveObservationConvention.class; } @Override @@ -67,37 +70,6 @@ public KeyName[] getLowCardinalityKeyNames() { } }; - // SPAN NAME - // - // topic with spaces process - // (anonymous) publish ((anonymous) being a stable identifier for an unnamed destination) - // (anonymous) receive ((anonymous) being a stable identifier for an unnamed destination) - - // LOW CARDINALITY - // messaging.system = rabbitmq - // messaging.operation = publish - - // HIGH CARDINALITY - - // messaging.rabbitmq.destination.routing_key - // messaging.destination.anonymous - // messaging.destination.name - // messaging.destination.template - // messaging.destination.temporary - // messaging.batch.message_count - // messaging.message.conversation_id - // messaging.message.id - // messaging.message.payload_compressed_size_bytes - // messaging.message.payload_size_bytes - - // net.peer.name - // net.protocol.name - // net.protocol.version - // net.sock.family - // net.sock.peer.addr - // net.sock.peer.name - // net.sock.peer.port - /** Low cardinality tags. */ public enum LowCardinalityTags implements KeyName { @@ -119,6 +91,7 @@ public String asString() { } }, + /** A string identifying the protocol (AMQP). */ NET_PROTOCOL_NAME { @Override @@ -127,6 +100,7 @@ public String asString() { } }, + /** A string identifying the protocol version (0.9.1). */ NET_PROTOCOL_VERSION { @Override From e2de7bd66f376ef2ddcd3fac3bc7ae0b4462f3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 27 Jun 2023 10:42:24 +0200 Subject: [PATCH 294/657] Declare Micrometer documentation generation dependency (cherry picked from commit 0a45f101d3a4fffb4e0612df5bc0663268986391) --- pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pom.xml b/pom.xml index 18ba84db66..749fa07d71 100644 --- a/pom.xml +++ b/pom.xml @@ -66,6 +66,7 @@ 5.4.0 3.24.2 1.1.2 + 1.0.2 9.4.51.v20230217 1.70 0.10 @@ -801,6 +802,12 @@ ${micrometer-tracing-test.version} test + + io.micrometer + micrometer-docs-generator + ${micrometer-docs-generator.version} + test + From 99d806fc99431e37c7da365172a58319152a212d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 12 Jul 2023 10:59:27 +0200 Subject: [PATCH 295/657] Bump Micrometer to 1.11.2 (cherry picked from commit afb39ff21d73204810dd9e3038fa13a4b6fc356a) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 749fa07d71..4b4ec37b83 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ true 1.7.36 4.2.19 - 1.11.1 + 1.11.2 1.1.4 1.28.0 2.15.2 From 3e64b6ce89fb558347b974eac2ea28fc3f215f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 12 Jul 2023 17:40:23 +0200 Subject: [PATCH 296/657] Add flag to keep observation open (cherry picked from commit ac8c721e58dbc0901bc13321ab5b1f7e8e1971e4) --- .../MicrometerObservationCollector.java | 11 +- ...MicrometerObservationCollectorBuilder.java | 10 +- ...MicrometerObservationCollectorMetrics.java | 110 +++++++++++++++++- 3 files changed, 125 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java index fa487b2f1d..6534db522b 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -31,6 +31,7 @@ class MicrometerObservationCollector implements ObservationCollector { private final PublishObservationConvention customPublishConvention, defaultPublishConvention; private final DeliverObservationConvention customProcessConvention, defaultProcessConvention; private final DeliverObservationConvention customReceiveConvention, defaultReceiveConvention; + private final boolean keepObservationOpenOnBasicGet; MicrometerObservationCollector( ObservationRegistry registry, @@ -39,7 +40,8 @@ class MicrometerObservationCollector implements ObservationCollector { DeliverObservationConvention customProcessConvention, DeliverObservationConvention defaultProcessConvention, DeliverObservationConvention customReceiveConvention, - DeliverObservationConvention defaultReceiveConvention) { + DeliverObservationConvention defaultReceiveConvention, + boolean keepObservationOpenOnBasicGet) { this.registry = registry; this.customPublishConvention = customPublishConvention; this.defaultPublishConvention = defaultPublishConvention; @@ -47,6 +49,7 @@ class MicrometerObservationCollector implements ObservationCollector { this.defaultProcessConvention = defaultProcessConvention; this.customReceiveConvention = customReceiveConvention; this.defaultReceiveConvention = defaultReceiveConvention; + this.keepObservationOpenOnBasicGet = keepObservationOpenOnBasicGet; } @Override @@ -129,7 +132,11 @@ public GetResponse basicGet(BasicGetCall call, String queue) { RabbitMqObservationDocumentation.RECEIVE_OBSERVATION.observation( customReceiveConvention, defaultReceiveConvention, () -> context, registry); observation.start(); - observation.stop(); + if (this.keepObservationOpenOnBasicGet) { + observation.openScope(); + } else { + observation.stop(); + } } return response; }); diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java index d808e249b5..5fe73254f6 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java @@ -35,6 +35,7 @@ public class MicrometerObservationCollectorBuilder { private DeliverObservationConvention customReceiveObservationConvention; private DeliverObservationConvention defaultReceiveObservationConvention = new DefaultReceiveObservationConvention("receive"); + private boolean keepObservationOpenOnBasicGet = false; public MicrometerObservationCollectorBuilder registry(ObservationRegistry registry) { this.registry = registry; @@ -77,6 +78,12 @@ public MicrometerObservationCollectorBuilder defaultReceiveObservationConvention return this; } + public MicrometerObservationCollectorBuilder keepObservationOpenOnBasicGet( + boolean keepObservationOpenOnBasicGet) { + this.keepObservationOpenOnBasicGet = keepObservationOpenOnBasicGet; + return this; + } + public ObservationCollector build() { return new MicrometerObservationCollector( this.registry, @@ -85,6 +92,7 @@ public ObservationCollector build() { this.customProcessObservationConvention, this.defaultProcessObservationConvention, this.customReceiveObservationConvention, - this.defaultReceiveObservationConvention); + this.defaultReceiveObservationConvention, + keepObservationOpenOnBasicGet); } } diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index cfc6a01d5c..884b924629 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -23,6 +23,7 @@ import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; import io.micrometer.observation.NullObservation; +import io.micrometer.observation.Observation; import io.micrometer.observation.ObservationRegistry; import io.micrometer.tracing.exporter.FinishedSpan; import io.micrometer.tracing.test.SampleTestRunner; @@ -51,11 +52,19 @@ private static ConnectionFactory createConnectionFactory() { private static ConnectionFactory createConnectionFactory( ObservationRegistry observationRegistry) { + return createConnectionFactory(false, observationRegistry); + } + + private static ConnectionFactory createConnectionFactory( + boolean keepObservationOpenOnBasicGet, ObservationRegistry observationRegistry) { ConnectionFactory connectionFactory = TestUtils.connectionFactory(); connectionFactory.setAutomaticRecoveryEnabled(true); if (observationRegistry != null) { ObservationCollector collector = - new MicrometerObservationCollectorBuilder().registry(observationRegistry).build(); + new MicrometerObservationCollectorBuilder() + .keepObservationOpenOnBasicGet(keepObservationOpenOnBasicGet) + .registry(observationRegistry) + .build(); connectionFactory.setObservationCollector(collector); } return connectionFactory; @@ -186,18 +195,113 @@ class PublishBasicGet extends IntegrationTest { @Override public SampleTestRunnerConsumer yourCode() { return (buildingBlocks, meterRegistry) -> { - ConnectionFactory connectionFactory = createConnectionFactory(getObservationRegistry()); + ObservationRegistry observationRegistry = getObservationRegistry(); + ConnectionFactory connectionFactory = createConnectionFactory(observationRegistry); + Connection publishConnection = null, consumeConnection = null; + try { + publishConnection = connectionFactory.newConnection(); + Channel channel = publishConnection.createChannel(); + + new NullObservation(observationRegistry).observeChecked(() -> sendMessage(channel)); + + consumeConnection = connectionFactory.newConnection(); + Channel basicGetChannel = consumeConnection.createChannel(); + waitAtMost(() -> basicGetChannel.basicGet(QUEUE, true) != null); + waitAtMost(() -> buildingBlocks.getFinishedSpans().size() >= 3); + buildingBlocks + .getFinishedSpans() + .forEach( + s -> { + System.out.println(s.getName() + " " + s.getTraceId()); + }); + Map> finishedSpans = + buildingBlocks.getFinishedSpans().stream() + .collect(Collectors.groupingBy(FinishedSpan::getTraceId)); + BDDAssertions.then(finishedSpans) + .as("One trace id for sending, one for polling") + .hasSize(2); + Collection> spans = finishedSpans.values(); + List sendAndReceiveSpans = + spans.stream() + .filter(f -> f.size() == 2) + .findFirst() + .orElseThrow( + () -> + new AssertionError( + "null_observation (fake nulling observation) -> produce -> consume")); + sendAndReceiveSpans.sort(Comparator.comparing(FinishedSpan::getStartTimestamp)); + SpanAssert.assertThat(sendAndReceiveSpans.get(0)) + .hasNameEqualTo("metrics.queue publish") + .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") + .hasTag("messaging.destination.name", "amq.default") + .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)) + .hasTagWithKey("net.sock.peer.addr") + .hasTag("net.sock.peer.port", "5672") + .hasTag("net.protocol.name", "amqp") + .hasTag("net.protocol.version", "0.9.1"); + SpanAssert.assertThat(sendAndReceiveSpans.get(1)) + .hasNameEqualTo("metrics.queue receive") + .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") + .hasTag("messaging.destination.name", "amq.default") + .hasTag("messaging.source.name", "metrics.queue") + .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)); + List pollingSpans = + spans.stream() + .filter(f -> f.size() == 1) + .findFirst() + .orElseThrow(() -> new AssertionError("rabbitmq.receive (child of test span)")); + SpanAssert.assertThat(pollingSpans.get(0)).hasNameEqualTo("rabbitmq.receive"); + waitAtMost( + () -> + getMeterRegistry().find("rabbitmq.publish").timer() != null + && getMeterRegistry().find("rabbitmq.receive").timer() != null); + getMeterRegistry() + .get("rabbitmq.publish") + .tag("messaging.operation", "publish") + .tag("messaging.system", "rabbitmq") + .timer(); + getMeterRegistry() + .get("rabbitmq.receive") + .tag("messaging.operation", "receive") + .tag("messaging.system", "rabbitmq") + .timer(); + } finally { + safeClose(publishConnection); + safeClose(consumeConnection); + } + }; + } + } + +// @Nested + class PublishBasicGetKeepObservationOpen extends IntegrationTest { + + @Override + public SampleTestRunnerConsumer yourCode() { + return (buildingBlocks, meterRegistry) -> { + ObservationRegistry observationRegistry = getObservationRegistry(); + ConnectionFactory connectionFactory = createConnectionFactory(true, observationRegistry); Connection publishConnection = null, consumeConnection = null; try { publishConnection = connectionFactory.newConnection(); Channel channel = publishConnection.createChannel(); - new NullObservation(getObservationRegistry()).observeChecked(() -> sendMessage(channel)); + new NullObservation(observationRegistry).observeChecked(() -> sendMessage(channel)); consumeConnection = connectionFactory.newConnection(); Channel basicGetChannel = consumeConnection.createChannel(); waitAtMost(() -> basicGetChannel.basicGet(QUEUE, true) != null); + Observation.Scope scope = observationRegistry.getCurrentObservationScope(); + assertThat(scope).isNotNull(); + scope.close(); + scope.getCurrentObservation().stop(); waitAtMost(() -> buildingBlocks.getFinishedSpans().size() >= 3); + buildingBlocks + .getFinishedSpans() + .forEach( + s -> { + System.out.println(s.getName() + " " + s.getTraceId()); + }); Map> finishedSpans = buildingBlocks.getFinishedSpans().stream() .collect(Collectors.groupingBy(FinishedSpan::getTraceId)); From 5665368b89df0264781c6cc32020850e3a7e8d70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 13 Jul 2023 11:18:57 +0200 Subject: [PATCH 297/657] Use 2 distinct observations for basic.get This way it is possible to keep the second observation for the application processing of the message. The observation will have to be closed by the application in this case. (cherry picked from commit bc2a9963c9cf59430ce9ad5b5bbd0326ec77d484) --- .../MicrometerObservationCollector.java | 83 +++++++++++-------- ...MicrometerObservationCollectorMetrics.java | 21 ++--- 2 files changed, 53 insertions(+), 51 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java index 6534db522b..cd0b1ca500 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -104,42 +104,53 @@ public Consumer basicConsume(String queue, String consumerTag, Consumer consumer @Override public GetResponse basicGet(BasicGetCall call, String queue) { - return Observation.createNotStarted("rabbitmq.receive", registry) - .highCardinalityKeyValues( - KeyValues.of( - RabbitMqObservationDocumentation.LowCardinalityTags.MESSAGING_OPERATION.withValue( - "receive"), - RabbitMqObservationDocumentation.LowCardinalityTags.MESSAGING_SYSTEM.withValue( - "rabbitmq"))) - .observe( - () -> { - GetResponse response = call.get(); - if (response != null) { - Map headers; - if (response.getProps() == null || response.getProps().getHeaders() == null) { - headers = Collections.emptyMap(); - } else { - headers = response.getProps().getHeaders(); - } - DeliverContext context = - new DeliverContext( - response.getEnvelope().getExchange(), - response.getEnvelope().getRoutingKey(), - queue, - headers, - response.getBody() == null ? 0 : response.getBody().length); - Observation observation = - RabbitMqObservationDocumentation.RECEIVE_OBSERVATION.observation( - customReceiveConvention, defaultReceiveConvention, () -> context, registry); - observation.start(); - if (this.keepObservationOpenOnBasicGet) { - observation.openScope(); - } else { - observation.stop(); - } - } - return response; - }); + Observation observation = + Observation.createNotStarted("rabbitmq.receive", registry) + .highCardinalityKeyValues( + KeyValues.of( + RabbitMqObservationDocumentation.LowCardinalityTags.MESSAGING_OPERATION + .withValue("receive"), + RabbitMqObservationDocumentation.LowCardinalityTags.MESSAGING_SYSTEM.withValue( + "rabbitmq"))) + .start(); + boolean stopped = false; + try { + GetResponse response = call.get(); + if (response != null) { + observation.stop(); + stopped = true; + Map headers; + if (response.getProps() == null || response.getProps().getHeaders() == null) { + headers = Collections.emptyMap(); + } else { + headers = response.getProps().getHeaders(); + } + DeliverContext context = + new DeliverContext( + response.getEnvelope().getExchange(), + response.getEnvelope().getRoutingKey(), + queue, + headers, + response.getBody() == null ? 0 : response.getBody().length); + Observation receiveObservation = + RabbitMqObservationDocumentation.RECEIVE_OBSERVATION.observation( + customReceiveConvention, defaultReceiveConvention, () -> context, registry); + receiveObservation.start(); + if (this.keepObservationOpenOnBasicGet) { + receiveObservation.openScope(); + } else { + receiveObservation.stop(); + } + } + return response; + } catch (RuntimeException e) { + observation.error(e); + throw e; + } finally { + if (!stopped) { + observation.stop(); + } + } } private static class ObservationConsumer implements Consumer { diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index 884b924629..048ada0916 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -208,12 +208,7 @@ public SampleTestRunnerConsumer yourCode() { Channel basicGetChannel = consumeConnection.createChannel(); waitAtMost(() -> basicGetChannel.basicGet(QUEUE, true) != null); waitAtMost(() -> buildingBlocks.getFinishedSpans().size() >= 3); - buildingBlocks - .getFinishedSpans() - .forEach( - s -> { - System.out.println(s.getName() + " " + s.getTraceId()); - }); + Map> finishedSpans = buildingBlocks.getFinishedSpans().stream() .collect(Collectors.groupingBy(FinishedSpan::getTraceId)); @@ -273,7 +268,7 @@ public SampleTestRunnerConsumer yourCode() { } } -// @Nested + @Nested class PublishBasicGetKeepObservationOpen extends IntegrationTest { @Override @@ -293,15 +288,11 @@ public SampleTestRunnerConsumer yourCode() { waitAtMost(() -> basicGetChannel.basicGet(QUEUE, true) != null); Observation.Scope scope = observationRegistry.getCurrentObservationScope(); assertThat(scope).isNotNull(); + // creating a dummy span to make sure it's wrapped into the receive one + buildingBlocks.getTracer().nextSpan().name("foobar").start().end(); scope.close(); scope.getCurrentObservation().stop(); - waitAtMost(() -> buildingBlocks.getFinishedSpans().size() >= 3); - buildingBlocks - .getFinishedSpans() - .forEach( - s -> { - System.out.println(s.getName() + " " + s.getTraceId()); - }); + waitAtMost(() -> buildingBlocks.getFinishedSpans().size() >= 3 + 1); Map> finishedSpans = buildingBlocks.getFinishedSpans().stream() .collect(Collectors.groupingBy(FinishedSpan::getTraceId)); @@ -311,7 +302,7 @@ public SampleTestRunnerConsumer yourCode() { Collection> spans = finishedSpans.values(); List sendAndReceiveSpans = spans.stream() - .filter(f -> f.size() == 2) + .filter(f -> f.size() == 2 + 1) .findFirst() .orElseThrow( () -> From d2840fb81ef6fea7035d1e8e91b34fac39ff8a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 13 Jul 2023 12:24:03 +0200 Subject: [PATCH 298/657] Add Javadoc for Micrometer observability (cherry picked from commit 0f57d516e3b2ab1e6f77ddbbdca809840e5422c8) --- ...MicrometerObservationCollectorBuilder.java | 115 ++++++++++++++++-- ...MicrometerObservationCollectorMetrics.java | 4 +- 2 files changed, 108 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java index 5fe73254f6..0e3f36ba9a 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java @@ -15,7 +15,9 @@ package com.rabbitmq.client.observation.micrometer; import com.rabbitmq.client.observation.ObservationCollector; +import io.micrometer.observation.ObservationConvention; import io.micrometer.observation.ObservationRegistry; +import java.util.function.Supplier; /** * Builder to configure and create Micrometer @@ -35,52 +37,147 @@ public class MicrometerObservationCollectorBuilder { private DeliverObservationConvention customReceiveObservationConvention; private DeliverObservationConvention defaultReceiveObservationConvention = new DefaultReceiveObservationConvention("receive"); - private boolean keepObservationOpenOnBasicGet = false; + private boolean keepObservationStartedOnBasicGet = false; + /** + * Set the {@link ObservationRegistry} to use. + * + * @param registry the registry + * @return this builder instance + */ public MicrometerObservationCollectorBuilder registry(ObservationRegistry registry) { this.registry = registry; return this; } + /** + * Custom convention for basic.publish. + * + *

If not null, it will override any pre-configured conventions. + * + * @param customPublishObservationConvention the convention + * @return this builder instance + * @see io.micrometer.observation.docs.ObservationDocumentation#observation(ObservationConvention, + * ObservationConvention, Supplier, ObservationRegistry) + */ public MicrometerObservationCollectorBuilder customPublishObservationConvention( PublishObservationConvention customPublishObservationConvention) { this.customPublishObservationConvention = customPublishObservationConvention; return this; } + /** + * Default convention for basic.publish. + * + *

It will be picked if there was neither custom convention nor a pre-configured one via {@link + * ObservationRegistry}. + * + * @param defaultPublishObservationConvention the convention + * @return this builder instance + * @see io.micrometer.observation.docs.ObservationDocumentation#observation(ObservationConvention, + * ObservationConvention, Supplier, ObservationRegistry) + */ public MicrometerObservationCollectorBuilder defaultPublishObservationConvention( PublishObservationConvention defaultPublishObservationConvention) { this.defaultPublishObservationConvention = defaultPublishObservationConvention; return this; } + /** + * Custom convention for basic.deliver. + * + *

If not null, it will override any pre-configured conventions. + * + * @param customProcessObservationConvention the convention + * @return this builder instance + * @see io.micrometer.observation.docs.ObservationDocumentation#observation(ObservationConvention, + * ObservationConvention, Supplier, ObservationRegistry) + */ public MicrometerObservationCollectorBuilder customProcessObservationConvention( - DeliverObservationConvention customConsumeObservationConvention) { - this.customProcessObservationConvention = customConsumeObservationConvention; + DeliverObservationConvention customProcessObservationConvention) { + this.customProcessObservationConvention = customProcessObservationConvention; return this; } + /** + * Default convention for basic.delivery. + * + *

It will be picked if there was neither custom convention nor a pre-configured one via {@link + * ObservationRegistry}. + * + * @param defaultProcessObservationConvention the convention + * @return this builder instance + * @see io.micrometer.observation.docs.ObservationDocumentation#observation(ObservationConvention, + * ObservationConvention, Supplier, ObservationRegistry) + */ public MicrometerObservationCollectorBuilder defaultProcessObservationConvention( - DeliverObservationConvention defaultConsumeObservationConvention) { - this.defaultProcessObservationConvention = defaultConsumeObservationConvention; + DeliverObservationConvention defaultProcessObservationConvention) { + this.defaultProcessObservationConvention = defaultProcessObservationConvention; return this; } + /** + * Custom convention for basic.get. + * + *

If not null, it will override any pre-configured conventions. + * + * @param customReceiveObservationConvention the convention + * @return this builder instance + * @see io.micrometer.observation.docs.ObservationDocumentation#observation(ObservationConvention, + * ObservationConvention, Supplier, ObservationRegistry) + */ public MicrometerObservationCollectorBuilder customReceiveObservationConvention( DeliverObservationConvention customReceiveObservationConvention) { this.customReceiveObservationConvention = customReceiveObservationConvention; return this; } + /** + * Default convention for basic.get. + * + *

It will be picked if there was neither custom convention nor a pre-configured one via {@link + * ObservationRegistry}. + * + * @param defaultReceiveObservationConvention the convention + * @return this builder instance + * @see io.micrometer.observation.docs.ObservationDocumentation#observation(ObservationConvention, + * ObservationConvention, Supplier, ObservationRegistry) + */ public MicrometerObservationCollectorBuilder defaultReceiveObservationConvention( DeliverObservationConvention defaultReceiveObservationConvention) { this.defaultReceiveObservationConvention = defaultReceiveObservationConvention; return this; } - public MicrometerObservationCollectorBuilder keepObservationOpenOnBasicGet( - boolean keepObservationOpenOnBasicGet) { - this.keepObservationOpenOnBasicGet = keepObservationOpenOnBasicGet; + /** + * Whether to keep the basic.get observation started or not. + * + *

The {@link MicrometerObservationCollector} starts and stops the observation immediately + * after the message reception. This way the observation can have all the context from the + * received message but has a very short duration. This is the default behavior. + * + *

By setting this flag to true the collector does not stop the observation and + * opens a scope. The processing of the message can then be included in the observation. + * + *

This is then the responsibility of the developer to retrieve the observation and stop it to + * avoid memory leaks. Here is an example: + * + *

+   * GetResponse response = channel.basicGet(queue, true);
+   * // process the message...
+   * // stop the observation
+   * Observation.Scope scope = observationRegistry.getCurrentObservationScope();
+   * scope.close();
+   * scope.getCurrentObservation().stop();
+ * + * Default is false, that is stopping the observation immediately. + * + * @param keepObservationStartedOnBasicGet whether to keep the observation started or not + * @return this builder instance + */ + public MicrometerObservationCollectorBuilder keepObservationStartedOnBasicGet( + boolean keepObservationStartedOnBasicGet) { + this.keepObservationStartedOnBasicGet = keepObservationStartedOnBasicGet; return this; } @@ -93,6 +190,6 @@ public ObservationCollector build() { this.defaultProcessObservationConvention, this.customReceiveObservationConvention, this.defaultReceiveObservationConvention, - keepObservationOpenOnBasicGet); + keepObservationStartedOnBasicGet); } } diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index 048ada0916..40dde8609e 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -56,13 +56,13 @@ private static ConnectionFactory createConnectionFactory( } private static ConnectionFactory createConnectionFactory( - boolean keepObservationOpenOnBasicGet, ObservationRegistry observationRegistry) { + boolean keepObservationStartedOnBasicGet, ObservationRegistry observationRegistry) { ConnectionFactory connectionFactory = TestUtils.connectionFactory(); connectionFactory.setAutomaticRecoveryEnabled(true); if (observationRegistry != null) { ObservationCollector collector = new MicrometerObservationCollectorBuilder() - .keepObservationOpenOnBasicGet(keepObservationOpenOnBasicGet) + .keepObservationStartedOnBasicGet(keepObservationStartedOnBasicGet) .registry(observationRegistry) .build(); connectionFactory.setObservationCollector(collector); From 468bb51e97446fac99fc8b6e9bc6d21bd7f01268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 13 Jul 2023 14:52:01 +0200 Subject: [PATCH 299/657] Complete Micrometer observation Javadoc (cherry picked from commit ee87b27d05b431231ac71e61a097f2c8975c2f73) --- ...MicrometerObservationCollectorBuilder.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java index 0e3f36ba9a..1a15a7e762 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java @@ -42,6 +42,8 @@ public class MicrometerObservationCollectorBuilder { /** * Set the {@link ObservationRegistry} to use. * + *

Default is {@link ObservationRegistry#NOOP}. + * * @param registry the registry * @return this builder instance */ @@ -55,6 +57,8 @@ public MicrometerObservationCollectorBuilder registry(ObservationRegistry regist * *

If not null, it will override any pre-configured conventions. * + *

Default is null. + * * @param customPublishObservationConvention the convention * @return this builder instance * @see io.micrometer.observation.docs.ObservationDocumentation#observation(ObservationConvention, @@ -72,6 +76,8 @@ public MicrometerObservationCollectorBuilder customPublishObservationConvention( *

It will be picked if there was neither custom convention nor a pre-configured one via {@link * ObservationRegistry}. * + *

Default is {@link DefaultPublishObservationConvention}. + * * @param defaultPublishObservationConvention the convention * @return this builder instance * @see io.micrometer.observation.docs.ObservationDocumentation#observation(ObservationConvention, @@ -88,6 +94,8 @@ public MicrometerObservationCollectorBuilder defaultPublishObservationConvention * *

If not null, it will override any pre-configured conventions. * + *

Default is null. + * * @param customProcessObservationConvention the convention * @return this builder instance * @see io.micrometer.observation.docs.ObservationDocumentation#observation(ObservationConvention, @@ -105,6 +113,8 @@ public MicrometerObservationCollectorBuilder customProcessObservationConvention( *

It will be picked if there was neither custom convention nor a pre-configured one via {@link * ObservationRegistry}. * + *

Default is DefaultProcessObservationConvention("process"). + * * @param defaultProcessObservationConvention the convention * @return this builder instance * @see io.micrometer.observation.docs.ObservationDocumentation#observation(ObservationConvention, @@ -121,6 +131,8 @@ public MicrometerObservationCollectorBuilder defaultProcessObservationConvention * *

If not null, it will override any pre-configured conventions. * + *

Default is null. + * * @param customReceiveObservationConvention the convention * @return this builder instance * @see io.micrometer.observation.docs.ObservationDocumentation#observation(ObservationConvention, @@ -138,6 +150,8 @@ public MicrometerObservationCollectorBuilder customReceiveObservationConvention( *

It will be picked if there was neither custom convention nor a pre-configured one via {@link * ObservationRegistry}. * + *

Default is DefaultReceiveObservationConvention("receive"). + * * @param defaultReceiveObservationConvention the convention * @return this builder instance * @see io.micrometer.observation.docs.ObservationDocumentation#observation(ObservationConvention, @@ -181,6 +195,11 @@ public MicrometerObservationCollectorBuilder keepObservationStartedOnBasicGet( return this; } + /** + * Create the Micrometer {@link ObservationCollector}. + * + * @return the Micrometer observation collector + */ public ObservationCollector build() { return new MicrometerObservationCollector( this.registry, From 7da405dba9838ac15f0369fbb1eec7748e010eba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Tue, 18 Jul 2023 15:42:02 +0200 Subject: [PATCH 300/657] Add protocol name and version tags on deliver operation References #952 (cherry picked from commit 014dc655a84a97e5128d4e2e4a40d290469e9f0a) --- .../DefaultDeliverObservationConvention.java | 4 +++- .../MicrometerObservationCollectorMetrics.java | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java index 55a17e5d8a..1bfa512b86 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java @@ -50,7 +50,9 @@ private String source(String destination) { public KeyValues getLowCardinalityKeyValues(DeliverContext context) { return KeyValues.of( LowCardinalityTags.MESSAGING_OPERATION.withValue(this.operation), - LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq")); + LowCardinalityTags.MESSAGING_SYSTEM.withValue("rabbitmq"), + LowCardinalityTags.NET_PROTOCOL_NAME.withValue("amqp"), + LowCardinalityTags.NET_PROTOCOL_VERSION.withValue("0.9.1")); } @Override diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index 40dde8609e..36de057b90 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -166,7 +166,9 @@ public SampleTestRunnerConsumer yourCode() { .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") .hasTag("messaging.destination.name", "amq.default") .hasTag("messaging.source.name", "metrics.queue") - .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)); + .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)) + .hasTag("net.protocol.name", "amqp") + .hasTag("net.protocol.version", "0.9.1"); waitAtMost( () -> getMeterRegistry().find("rabbitmq.publish").timer() != null @@ -239,7 +241,9 @@ public SampleTestRunnerConsumer yourCode() { .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") .hasTag("messaging.destination.name", "amq.default") .hasTag("messaging.source.name", "metrics.queue") - .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)); + .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)) + .hasTag("net.protocol.name", "amqp") + .hasTag("net.protocol.version", "0.9.1"); List pollingSpans = spans.stream() .filter(f -> f.size() == 1) @@ -323,7 +327,9 @@ public SampleTestRunnerConsumer yourCode() { .hasTag("messaging.rabbitmq.destination.routing_key", "metrics.queue") .hasTag("messaging.destination.name", "amq.default") .hasTag("messaging.source.name", "metrics.queue") - .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)); + .hasTag("messaging.message.payload_size_bytes", String.valueOf(PAYLOAD.length)) + .hasTag("net.protocol.name", "amqp") + .hasTag("net.protocol.version", "0.9.1"); List pollingSpans = spans.stream() .filter(f -> f.size() == 1) From 8998c82beb38389d44f39dc99fbe4984256c419f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 00:16:15 +0000 Subject: [PATCH 301/657] Bump spotless-maven-plugin from 2.35.0 to 2.38.0 Bumps [spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.35.0 to 2.38.0. - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/lib/2.35.0...lib/2.38.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 4b4ec37b83..c74e86e829 100644 --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ 1.6.13 1.11 1.3 - 2.35.0 + 2.38.0 1.17.0 - -Djdk.net.URLClassPath.disableClassPathURLCheck=true + ${test-arguments} @@ -473,13 +480,10 @@ ${maven.failsafe.plugin.version} + true true - - -Djdk.net.URLClassPath.disableClassPathURLCheck=true + ${test-arguments} From 976c0f4c4f35f2c6a47bac890bc4759c3d17807f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Thu, 21 Sep 2023 09:28:28 +0200 Subject: [PATCH 333/657] Bump Maven to 3.9.4 --- .mvn/wrapper/maven-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 6d3a56651d..ac184013fc 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.3/apache-maven-3.9.3-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.4/apache-maven-3.9.4-bin.zip wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar From d061fe39b9431832981dfbd80cfaf684c3450465 Mon Sep 17 00:00:00 2001 From: "Rogelio J. Baucells" Date: Fri, 22 Sep 2023 19:01:20 -0400 Subject: [PATCH 334/657] Replaced synchronized() by ReentrantLock --- .../com/rabbitmq/client/impl/AMQChannel.java | 78 ++++++++++++++----- .../com/rabbitmq/client/impl/AMQCommand.java | 12 ++- .../com/rabbitmq/client/impl/ChannelN.java | 28 +++++-- .../client/impl/SocketFrameHandler.java | 23 +++++- 4 files changed, 111 insertions(+), 30 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/AMQChannel.java b/src/main/java/com/rabbitmq/client/impl/AMQChannel.java index 0695c8072f..029c29ebf8 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQChannel.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQChannel.java @@ -31,6 +31,8 @@ import java.io.IOException; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeoutException; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.ReentrantLock; import java.util.function.Supplier; /** @@ -54,7 +56,8 @@ public abstract class AMQChannel extends ShutdownNotifierComponent { * so that clients can themselves use the channel to synchronize * on. */ - protected final Object _channelMutex = new Object(); + protected final ReentrantLock _channelMutex = new ReentrantLock(); + protected final Condition _channelMutexCondition = _channelMutex.newCondition(); /** The connection this channel is associated with. */ private final AMQConnection _connection; @@ -191,7 +194,8 @@ public void handleCompleteInboundCommand(AMQCommand command) throws IOException // so it must be a response to an earlier RPC. if (_checkRpcResponseType) { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { // check if this reply command is intended for the current waiting request before calling nextOutstandingRpc() if (_activeRpc != null && !_activeRpc.canHandleReply(command)) { // this reply command is not intended for the current waiting request @@ -199,6 +203,8 @@ public void handleCompleteInboundCommand(AMQCommand command) throws IOException // Throw this reply command away so we don't stop the current request from waiting for its reply return; } + } finally { + _channelMutex.unlock(); } } final RpcWrapper nextOutstandingRpc = nextOutstandingRpc(); @@ -220,11 +226,12 @@ public void enqueueAsyncRpc(Method method, CompletableFuture future) { } private void doEnqueueRpc(Supplier rpcWrapperSupplier) { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { boolean waitClearedInterruptStatus = false; while (_activeRpc != null) { try { - _channelMutex.wait(); + _channelMutexCondition.await(); } catch (InterruptedException e) { //NOSONAR waitClearedInterruptStatus = true; // No Sonar: we re-interrupt the thread later @@ -234,23 +241,31 @@ private void doEnqueueRpc(Supplier rpcWrapperSupplier) { Thread.currentThread().interrupt(); } _activeRpc = rpcWrapperSupplier.get(); + } finally { + _channelMutex.unlock(); } } public boolean isOutstandingRpc() { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { return (_activeRpc != null); + } finally { + _channelMutex.unlock(); } } public RpcWrapper nextOutstandingRpc() { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { RpcWrapper result = _activeRpc; _activeRpc = null; - _channelMutex.notifyAll(); + _channelMutexCondition.signalAll(); return result; + } finally { + _channelMutex.unlock(); } } @@ -344,36 +359,48 @@ private AMQCommand privateRpc(Method m, int timeout) public void rpc(Method m, RpcContinuation k) throws IOException { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { ensureIsOpen(); quiescingRpc(m, k); + } finally { + _channelMutex.unlock(); } } public void quiescingRpc(Method m, RpcContinuation k) throws IOException { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { enqueueRpc(k); quiescingTransmit(m); + } finally { + _channelMutex.unlock(); } } public void asyncRpc(Method m, CompletableFuture future) throws IOException { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { ensureIsOpen(); quiescingAsyncRpc(m, future); + } finally { + _channelMutex.unlock(); } } public void quiescingAsyncRpc(Method m, CompletableFuture future) throws IOException { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { enqueueAsyncRpc(m, future); quiescingTransmit(m); + } finally { + _channelMutex.unlock(); } } @@ -402,13 +429,16 @@ public void processShutdownSignal(ShutdownSignalException signal, boolean ignoreClosed, boolean notifyRpc) { try { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { if (!setShutdownCauseIfOpen(signal)) { if (!ignoreClosed) throw new AlreadyClosedException(getCloseReason()); } - _channelMutex.notifyAll(); + _channelMutexCondition.signalAll(); + } finally { + _channelMutex.unlock(); } } finally { if (notifyRpc) @@ -424,30 +454,40 @@ public void notifyOutstandingRpc(ShutdownSignalException signal) { } public void transmit(Method m) throws IOException { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { transmit(new AMQCommand(m)); + } finally { + _channelMutex.unlock(); } } public void transmit(AMQCommand c) throws IOException { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { ensureIsOpen(); quiescingTransmit(c); + } finally { + _channelMutex.unlock(); } } public void quiescingTransmit(Method m) throws IOException { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { quiescingTransmit(new AMQCommand(m)); + } finally { + _channelMutex.unlock(); } } public void quiescingTransmit(AMQCommand c) throws IOException { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { if (c.getMethod().hasContent()) { while (_blockContent) { try { - _channelMutex.wait(); + _channelMutexCondition.await(); } catch (InterruptedException ignored) { Thread.currentThread().interrupt(); } @@ -460,6 +500,8 @@ public void quiescingTransmit(AMQCommand c) throws IOException { } this._trafficListener.write(c); c.transmit(this); + } finally { + _channelMutex.unlock(); } } diff --git a/src/main/java/com/rabbitmq/client/impl/AMQCommand.java b/src/main/java/com/rabbitmq/client/impl/AMQCommand.java index a761e5cce6..8ee99c9701 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQCommand.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQCommand.java @@ -18,6 +18,7 @@ import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; +import java.util.concurrent.locks.ReentrantLock; import com.rabbitmq.client.AMQP; import com.rabbitmq.client.Command; @@ -43,6 +44,7 @@ public class AMQCommand implements Command { /** The assembler for this command - synchronised on - contains all the state */ private final CommandAssembler assembler; + private final ReentrantLock assemblerLock = new ReentrantLock(); AMQCommand(int maxBodyLength) { this(null, null, null, maxBodyLength); @@ -115,7 +117,8 @@ public void transmit(AMQChannel channel) throws IOException { int channelNumber = channel.getChannelNumber(); AMQConnection connection = channel.getConnection(); - synchronized (assembler) { + assemblerLock.lock(); + try { Method m = this.assembler.getMethod(); if (m.hasContent()) { byte[] body = this.assembler.getContentBody(); @@ -145,6 +148,8 @@ public void transmit(AMQChannel channel) throws IOException { } else { connection.writeFrame(m.toFrame(channelNumber)); } + } finally { + assemblerLock.unlock(); } connection.flush(); @@ -155,7 +160,8 @@ public void transmit(AMQChannel channel) throws IOException { } public String toString(boolean suppressBody){ - synchronized (assembler) { + assemblerLock.lock(); + try { return new StringBuilder() .append('{') .append(this.assembler.getMethod()) @@ -165,6 +171,8 @@ public String toString(boolean suppressBody){ .append(contentBodyStringBuilder( this.assembler.getContentBody(), suppressBody)) .append('}').toString(); + } finally { + assemblerLock.unlock(); } } diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelN.java b/src/main/java/com/rabbitmq/client/impl/ChannelN.java index d08593eaa8..30bccc15f0 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelN.java @@ -361,10 +361,13 @@ private void releaseChannel() { return true; } else if (method instanceof Channel.Flow) { Channel.Flow channelFlow = (Channel.Flow) method; - synchronized (_channelMutex) { + _channelMutex.lock(); + try { _blockContent = !channelFlow.getActive(); transmit(new Channel.FlowOk(!_blockContent)); - _channelMutex.notifyAll(); + _channelMutexCondition.signalAll(); + } finally { + _channelMutex.unlock(); } return true; } else if (method instanceof Basic.Ack) { @@ -524,7 +527,8 @@ private void asyncShutdown(Command command) throws IOException { false, command.getMethod(), this); - synchronized (_channelMutex) { + _channelMutex.lock(); + try { try { processShutdownSignal(signal, true, false); quiescingTransmit(new Channel.CloseOk()); @@ -533,6 +537,9 @@ private void asyncShutdown(Command command) throws IOException { notifyOutstandingRpc(signal); } } + finally { + _channelMutex.unlock(); + } notifyListeners(); } @@ -612,9 +619,12 @@ public AMQCommand transformReply(AMQCommand command) { try { // Synchronize the block below to avoid race conditions in case // connection wants to send Connection-CloseOK - synchronized (_channelMutex) { + _channelMutex.lock(); + try { startProcessShutdownSignal(signal, !initiatedByApplication, true); quiescingRpc(reason, k); + } finally { + _channelMutex.unlock(); } // Now that we're in quiescing state, channel.close was sent and @@ -1602,16 +1612,22 @@ public CompletableFuture asyncCompletableRpc(Method method) throws IOEx @Override public void enqueueRpc(RpcContinuation k) { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { super.enqueueRpc(k); dispatcher.setUnlimited(true); + } finally { + _channelMutex.unlock(); } } @Override protected void markRpcFinished() { - synchronized (_channelMutex) { + _channelMutex.lock(); + try { dispatcher.setUnlimited(false); + } finally { + _channelMutex.unlock(); } } diff --git a/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java b/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java index 5048100a7b..607f4c4112 100644 --- a/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java +++ b/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java @@ -29,6 +29,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.ReentrantLock; /** * A socket-based frame handler. @@ -48,9 +49,11 @@ public class SocketFrameHandler implements FrameHandler { /** Socket's inputstream - data from the broker - synchronized on */ private final DataInputStream _inputStream; + private final ReentrantLock _inputStreamLock = new ReentrantLock(); /** Socket's outputstream - data to the broker - synchronized on */ private final DataOutputStream _outputStream; + private final ReentrantLock _outputStreamLock = new ReentrantLock(); private final int maxInboundMessageBodySize; @@ -127,7 +130,8 @@ public int getTimeout() * @see #sendHeader() */ public void sendHeader(int major, int minor) throws IOException { - synchronized (_outputStream) { + _outputStreamLock.lock(); + try { _outputStream.write("AMQP".getBytes("US-ASCII")); _outputStream.write(1); _outputStream.write(1); @@ -139,6 +143,8 @@ public void sendHeader(int major, int minor) throws IOException { LOGGER.error("TLS connection failed: {}", e.getMessage()); throw e; } + } finally { + _outputStreamLock.unlock(); } } @@ -154,7 +160,8 @@ public void sendHeader(int major, int minor) throws IOException { * @see #sendHeader() */ public void sendHeader(int major, int minor, int revision) throws IOException { - synchronized (_outputStream) { + _outputStreamLock.lock(); + try { _outputStream.write("AMQP".getBytes("US-ASCII")); _outputStream.write(0); _outputStream.write(major); @@ -166,6 +173,8 @@ public void sendHeader(int major, int minor, int revision) throws IOException { LOGGER.error("TLS connection failed: {}", e.getMessage()); throw e; } + } finally { + _outputStreamLock.unlock(); } } @@ -184,15 +193,21 @@ public void initialize(AMQConnection connection) { @Override public Frame readFrame() throws IOException { - synchronized (_inputStream) { + _inputStreamLock.lock(); + try { return Frame.readFrom(_inputStream, this.maxInboundMessageBodySize); + } finally { + _inputStreamLock.unlock(); } } @Override public void writeFrame(Frame frame) throws IOException { - synchronized (_outputStream) { + _outputStreamLock.lock(); + try { frame.writeTo(_outputStream); + } finally { + _outputStreamLock.unlock(); } } From 8e855a34f620f3b5a9d0ca0f5ecced42c94769e0 Mon Sep 17 00:00:00 2001 From: "Rogelio J. Baucells" Date: Fri, 22 Sep 2023 19:25:56 -0400 Subject: [PATCH 335/657] renamed Mutex => Lock --- .../com/rabbitmq/client/impl/AMQChannel.java | 64 +++++++++---------- .../com/rabbitmq/client/impl/ChannelN.java | 22 +++---- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/AMQChannel.java b/src/main/java/com/rabbitmq/client/impl/AMQChannel.java index 029c29ebf8..8965704811 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQChannel.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQChannel.java @@ -56,8 +56,8 @@ public abstract class AMQChannel extends ShutdownNotifierComponent { * so that clients can themselves use the channel to synchronize * on. */ - protected final ReentrantLock _channelMutex = new ReentrantLock(); - protected final Condition _channelMutexCondition = _channelMutex.newCondition(); + protected final ReentrantLock _channelLock = new ReentrantLock(); + protected final Condition _channelLockCondition = _channelLock.newCondition(); /** The connection this channel is associated with. */ private final AMQConnection _connection; @@ -194,7 +194,7 @@ public void handleCompleteInboundCommand(AMQCommand command) throws IOException // so it must be a response to an earlier RPC. if (_checkRpcResponseType) { - _channelMutex.lock(); + _channelLock.lock(); try { // check if this reply command is intended for the current waiting request before calling nextOutstandingRpc() if (_activeRpc != null && !_activeRpc.canHandleReply(command)) { @@ -204,7 +204,7 @@ public void handleCompleteInboundCommand(AMQCommand command) throws IOException return; } } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } final RpcWrapper nextOutstandingRpc = nextOutstandingRpc(); @@ -226,12 +226,12 @@ public void enqueueAsyncRpc(Method method, CompletableFuture future) { } private void doEnqueueRpc(Supplier rpcWrapperSupplier) { - _channelMutex.lock(); + _channelLock.lock(); try { boolean waitClearedInterruptStatus = false; while (_activeRpc != null) { try { - _channelMutexCondition.await(); + _channelLockCondition.await(); } catch (InterruptedException e) { //NOSONAR waitClearedInterruptStatus = true; // No Sonar: we re-interrupt the thread later @@ -242,30 +242,30 @@ private void doEnqueueRpc(Supplier rpcWrapperSupplier) { } _activeRpc = rpcWrapperSupplier.get(); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } public boolean isOutstandingRpc() { - _channelMutex.lock(); + _channelLock.lock(); try { return (_activeRpc != null); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } public RpcWrapper nextOutstandingRpc() { - _channelMutex.lock(); + _channelLock.lock(); try { RpcWrapper result = _activeRpc; _activeRpc = null; - _channelMutexCondition.signalAll(); + _channelLockCondition.signalAll(); return result; } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } @@ -359,48 +359,48 @@ private AMQCommand privateRpc(Method m, int timeout) public void rpc(Method m, RpcContinuation k) throws IOException { - _channelMutex.lock(); + _channelLock.lock(); try { ensureIsOpen(); quiescingRpc(m, k); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } public void quiescingRpc(Method m, RpcContinuation k) throws IOException { - _channelMutex.lock(); + _channelLock.lock(); try { enqueueRpc(k); quiescingTransmit(m); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } public void asyncRpc(Method m, CompletableFuture future) throws IOException { - _channelMutex.lock(); + _channelLock.lock(); try { ensureIsOpen(); quiescingAsyncRpc(m, future); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } public void quiescingAsyncRpc(Method m, CompletableFuture future) throws IOException { - _channelMutex.lock(); + _channelLock.lock(); try { enqueueAsyncRpc(m, future); quiescingTransmit(m); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } @@ -429,16 +429,16 @@ public void processShutdownSignal(ShutdownSignalException signal, boolean ignoreClosed, boolean notifyRpc) { try { - _channelMutex.lock(); + _channelLock.lock(); try { if (!setShutdownCauseIfOpen(signal)) { if (!ignoreClosed) throw new AlreadyClosedException(getCloseReason()); } - _channelMutexCondition.signalAll(); + _channelLockCondition.signalAll(); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } finally { if (notifyRpc) @@ -454,40 +454,40 @@ public void notifyOutstandingRpc(ShutdownSignalException signal) { } public void transmit(Method m) throws IOException { - _channelMutex.lock(); + _channelLock.lock(); try { transmit(new AMQCommand(m)); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } public void transmit(AMQCommand c) throws IOException { - _channelMutex.lock(); + _channelLock.lock(); try { ensureIsOpen(); quiescingTransmit(c); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } public void quiescingTransmit(Method m) throws IOException { - _channelMutex.lock(); + _channelLock.lock(); try { quiescingTransmit(new AMQCommand(m)); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } public void quiescingTransmit(AMQCommand c) throws IOException { - _channelMutex.lock(); + _channelLock.lock(); try { if (c.getMethod().hasContent()) { while (_blockContent) { try { - _channelMutexCondition.await(); + _channelLockCondition.await(); } catch (InterruptedException ignored) { Thread.currentThread().interrupt(); } @@ -501,7 +501,7 @@ public void quiescingTransmit(AMQCommand c) throws IOException { this._trafficListener.write(c); c.transmit(this); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelN.java b/src/main/java/com/rabbitmq/client/impl/ChannelN.java index 30bccc15f0..9a3ee7cc83 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelN.java @@ -361,13 +361,13 @@ private void releaseChannel() { return true; } else if (method instanceof Channel.Flow) { Channel.Flow channelFlow = (Channel.Flow) method; - _channelMutex.lock(); + _channelLock.lock(); try { _blockContent = !channelFlow.getActive(); transmit(new Channel.FlowOk(!_blockContent)); - _channelMutexCondition.signalAll(); + _channelLockCondition.signalAll(); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } return true; } else if (method instanceof Basic.Ack) { @@ -527,7 +527,7 @@ private void asyncShutdown(Command command) throws IOException { false, command.getMethod(), this); - _channelMutex.lock(); + _channelLock.lock(); try { try { processShutdownSignal(signal, true, false); @@ -538,7 +538,7 @@ private void asyncShutdown(Command command) throws IOException { } } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } notifyListeners(); } @@ -619,12 +619,12 @@ public AMQCommand transformReply(AMQCommand command) { try { // Synchronize the block below to avoid race conditions in case // connection wants to send Connection-CloseOK - _channelMutex.lock(); + _channelLock.lock(); try { startProcessShutdownSignal(signal, !initiatedByApplication, true); quiescingRpc(reason, k); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } // Now that we're in quiescing state, channel.close was sent and @@ -1612,22 +1612,22 @@ public CompletableFuture asyncCompletableRpc(Method method) throws IOEx @Override public void enqueueRpc(RpcContinuation k) { - _channelMutex.lock(); + _channelLock.lock(); try { super.enqueueRpc(k); dispatcher.setUnlimited(true); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } @Override protected void markRpcFinished() { - _channelMutex.lock(); + _channelLock.lock(); try { dispatcher.setUnlimited(false); } finally { - _channelMutex.unlock(); + _channelLock.unlock(); } } From fb64c5ffa035a8c17fbe887ab098bba5151c8eab Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Fri, 22 Sep 2023 23:51:52 -0400 Subject: [PATCH 336/657] Remove a stray conflict resolution marker in RUNNING_TESTS.md --- RUNNING_TESTS.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/RUNNING_TESTS.md b/RUNNING_TESTS.md index b2c0fa4920..0f193bfc7d 100644 --- a/RUNNING_TESTS.md +++ b/RUNNING_TESTS.md @@ -166,8 +166,6 @@ Tests run: 121, Failures: 0, Errors: 0, Skipped: 0 Test reports can be found in `target/failsafe-reports`. -<<<<<<< HEAD - ## Running tests against an externally provided broker or cluster By default, if the RabbitMQ broker sources are available, the testsuite From 3f72657e8875f99740992d42625eba8558c858c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 25 Sep 2023 09:21:24 +0200 Subject: [PATCH 337/657] Use Lock interface to declare properties Not ReentrantLock. References #1119 --- src/main/java/com/rabbitmq/client/impl/AMQChannel.java | 3 ++- src/main/java/com/rabbitmq/client/impl/AMQCommand.java | 3 ++- .../java/com/rabbitmq/client/impl/SocketFrameHandler.java | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/AMQChannel.java b/src/main/java/com/rabbitmq/client/impl/AMQChannel.java index 8965704811..238e162ee7 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQChannel.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQChannel.java @@ -32,6 +32,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeoutException; import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import java.util.function.Supplier; @@ -56,7 +57,7 @@ public abstract class AMQChannel extends ShutdownNotifierComponent { * so that clients can themselves use the channel to synchronize * on. */ - protected final ReentrantLock _channelLock = new ReentrantLock(); + protected final Lock _channelLock = new ReentrantLock(); protected final Condition _channelLockCondition = _channelLock.newCondition(); /** The connection this channel is associated with. */ diff --git a/src/main/java/com/rabbitmq/client/impl/AMQCommand.java b/src/main/java/com/rabbitmq/client/impl/AMQCommand.java index 8ee99c9701..aa4df765fb 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQCommand.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQCommand.java @@ -18,6 +18,7 @@ import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; +import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; import com.rabbitmq.client.AMQP; @@ -44,7 +45,7 @@ public class AMQCommand implements Command { /** The assembler for this command - synchronised on - contains all the state */ private final CommandAssembler assembler; - private final ReentrantLock assemblerLock = new ReentrantLock(); + private final Lock assemblerLock = new ReentrantLock(); AMQCommand(int maxBodyLength) { this(null, null, null, maxBodyLength); diff --git a/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java b/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java index 607f4c4112..3e4e0a7078 100644 --- a/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java +++ b/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java @@ -29,6 +29,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; /** @@ -49,11 +50,11 @@ public class SocketFrameHandler implements FrameHandler { /** Socket's inputstream - data from the broker - synchronized on */ private final DataInputStream _inputStream; - private final ReentrantLock _inputStreamLock = new ReentrantLock(); + private final Lock _inputStreamLock = new ReentrantLock(); /** Socket's outputstream - data to the broker - synchronized on */ private final DataOutputStream _outputStream; - private final ReentrantLock _outputStreamLock = new ReentrantLock(); + private final Lock _outputStreamLock = new ReentrantLock(); private final int maxInboundMessageBodySize; From 1cfc71b1e77f680e64be60e0efcc4aea2b53214d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 00:32:10 +0000 Subject: [PATCH 338/657] Bump io.dropwizard.metrics:metrics-core from 4.2.19 to 4.2.20 Bumps [io.dropwizard.metrics:metrics-core](https://github.com/dropwizard/metrics) from 4.2.19 to 4.2.20. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.19...v4.2.20) --- 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 b9d85779ef..9ca9d9f0f6 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ true 1.7.36 - 4.2.19 + 4.2.20 1.11.4 1.1.4 1.30.1 From 069818403d722561076a8412c1986a639b976d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 27 Sep 2023 14:28:50 +0200 Subject: [PATCH 339/657] Set release version to 5.19.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index ce1b2c590d..8ad9cc85b4 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.19.0.RC1" -DEVELOPMENT_VERSION="5.19.0-SNAPSHOT" +RELEASE_VERSION="5.19.0" +DEVELOPMENT_VERSION="5.20.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From 8860de8b19d1413ee19395e8b8c12afff2aa29fe Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Wed, 27 Sep 2023 14:34:18 +0000 Subject: [PATCH 340/657] [maven-release-plugin] prepare release v5.19.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 9ca9d9f0f6..97ac1a1746 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.19.0-SNAPSHOT + 5.19.0 jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git - HEAD + v5.19.0 From 6a142b6f8b1135321ca71ce30814920ace9b0f3f Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Wed, 27 Sep 2023 14:34:20 +0000 Subject: [PATCH 341/657] [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 97ac1a1746..5b6cd697ca 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.19.0 + 5.20.0-SNAPSHOT jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git - v5.19.0 + HEAD From e5953c6016c310ef2abe7d22b459bd228d5bce74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 27 Sep 2023 17:09:04 +0200 Subject: [PATCH 342/657] Set release version to 5.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 8ad9cc85b4..dcaf9c8735 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.19.0" +RELEASE_VERSION="5.20.0.RC1" DEVELOPMENT_VERSION="5.20.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From a3639be54249b6f67e9faed7a209b68d70732f41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Sep 2023 00:39:41 +0000 Subject: [PATCH 343/657] Bump com.diffplug.spotless:spotless-maven-plugin from 2.39.0 to 2.40.0 Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.39.0 to 2.40.0. - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/lib/2.39.0...lib/2.40.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 5b6cd697ca..857c0bddc9 100644 --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ 1.6.13 1.11 1.4 - 2.39.0 + 2.40.0 1.17.0 - // Copyright (c) $YEAR VMware, Inc. or its affiliates. All rights reserved. + // Copyright (c) $YEAR Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/Address.java b/src/main/java/com/rabbitmq/client/Address.java index d86c040ba5..643e3a3582 100644 --- a/src/main/java/com/rabbitmq/client/Address.java +++ b/src/main/java/com/rabbitmq/client/Address.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/AddressResolver.java b/src/main/java/com/rabbitmq/client/AddressResolver.java index 4a90a8e014..992b687dab 100644 --- a/src/main/java/com/rabbitmq/client/AddressResolver.java +++ b/src/main/java/com/rabbitmq/client/AddressResolver.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/AlreadyClosedException.java b/src/main/java/com/rabbitmq/client/AlreadyClosedException.java index 69a000847e..5cf3da56f8 100644 --- a/src/main/java/com/rabbitmq/client/AlreadyClosedException.java +++ b/src/main/java/com/rabbitmq/client/AlreadyClosedException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/AuthenticationFailureException.java b/src/main/java/com/rabbitmq/client/AuthenticationFailureException.java index 56f26561ca..2001e7d94e 100644 --- a/src/main/java/com/rabbitmq/client/AuthenticationFailureException.java +++ b/src/main/java/com/rabbitmq/client/AuthenticationFailureException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/BasicProperties.java b/src/main/java/com/rabbitmq/client/BasicProperties.java index 9a0b953698..8cfbf98b6d 100644 --- a/src/main/java/com/rabbitmq/client/BasicProperties.java +++ b/src/main/java/com/rabbitmq/client/BasicProperties.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/BlockedCallback.java b/src/main/java/com/rabbitmq/client/BlockedCallback.java index d9e22fbe88..bf0607b8e9 100644 --- a/src/main/java/com/rabbitmq/client/BlockedCallback.java +++ b/src/main/java/com/rabbitmq/client/BlockedCallback.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/BlockedListener.java b/src/main/java/com/rabbitmq/client/BlockedListener.java index 521f8d19cd..aa040a473c 100644 --- a/src/main/java/com/rabbitmq/client/BlockedListener.java +++ b/src/main/java/com/rabbitmq/client/BlockedListener.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/CancelCallback.java b/src/main/java/com/rabbitmq/client/CancelCallback.java index 419f34a4bd..1b3433032d 100644 --- a/src/main/java/com/rabbitmq/client/CancelCallback.java +++ b/src/main/java/com/rabbitmq/client/CancelCallback.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/Channel.java b/src/main/java/com/rabbitmq/client/Channel.java index 4c20cd4467..3716a7c3af 100644 --- a/src/main/java/com/rabbitmq/client/Channel.java +++ b/src/main/java/com/rabbitmq/client/Channel.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/Command.java b/src/main/java/com/rabbitmq/client/Command.java index dad5c6aa64..24c113dd0b 100644 --- a/src/main/java/com/rabbitmq/client/Command.java +++ b/src/main/java/com/rabbitmq/client/Command.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ConfirmCallback.java b/src/main/java/com/rabbitmq/client/ConfirmCallback.java index e02355f957..cd0e8fe597 100644 --- a/src/main/java/com/rabbitmq/client/ConfirmCallback.java +++ b/src/main/java/com/rabbitmq/client/ConfirmCallback.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ConfirmListener.java b/src/main/java/com/rabbitmq/client/ConfirmListener.java index 50f25ad2c3..489018bb32 100644 --- a/src/main/java/com/rabbitmq/client/ConfirmListener.java +++ b/src/main/java/com/rabbitmq/client/ConfirmListener.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/Connection.java b/src/main/java/com/rabbitmq/client/Connection.java index 5004ac9372..dbfb99f8e8 100644 --- a/src/main/java/com/rabbitmq/client/Connection.java +++ b/src/main/java/com/rabbitmq/client/Connection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ConnectionFactory.java b/src/main/java/com/rabbitmq/client/ConnectionFactory.java index 8caee0b942..b6a6ffbfa9 100644 --- a/src/main/java/com/rabbitmq/client/ConnectionFactory.java +++ b/src/main/java/com/rabbitmq/client/ConnectionFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ConnectionFactoryConfigurator.java b/src/main/java/com/rabbitmq/client/ConnectionFactoryConfigurator.java index 66f4a3742d..12ebcadbbc 100644 --- a/src/main/java/com/rabbitmq/client/ConnectionFactoryConfigurator.java +++ b/src/main/java/com/rabbitmq/client/ConnectionFactoryConfigurator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/Consumer.java b/src/main/java/com/rabbitmq/client/Consumer.java index cb57e9d956..7604ecb60f 100644 --- a/src/main/java/com/rabbitmq/client/Consumer.java +++ b/src/main/java/com/rabbitmq/client/Consumer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ConsumerCancelledException.java b/src/main/java/com/rabbitmq/client/ConsumerCancelledException.java index 44495fceb4..ce6c966292 100644 --- a/src/main/java/com/rabbitmq/client/ConsumerCancelledException.java +++ b/src/main/java/com/rabbitmq/client/ConsumerCancelledException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ConsumerShutdownSignalCallback.java b/src/main/java/com/rabbitmq/client/ConsumerShutdownSignalCallback.java index 0fe41694a4..c6a23a4bdb 100644 --- a/src/main/java/com/rabbitmq/client/ConsumerShutdownSignalCallback.java +++ b/src/main/java/com/rabbitmq/client/ConsumerShutdownSignalCallback.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ContentHeader.java b/src/main/java/com/rabbitmq/client/ContentHeader.java index ff3f0f0a1e..d6b89c18e0 100644 --- a/src/main/java/com/rabbitmq/client/ContentHeader.java +++ b/src/main/java/com/rabbitmq/client/ContentHeader.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/DefaultConsumer.java b/src/main/java/com/rabbitmq/client/DefaultConsumer.java index b2b4644b3c..18c180117c 100644 --- a/src/main/java/com/rabbitmq/client/DefaultConsumer.java +++ b/src/main/java/com/rabbitmq/client/DefaultConsumer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/DefaultSaslConfig.java b/src/main/java/com/rabbitmq/client/DefaultSaslConfig.java index 0e4de02da1..226605cd3c 100644 --- a/src/main/java/com/rabbitmq/client/DefaultSaslConfig.java +++ b/src/main/java/com/rabbitmq/client/DefaultSaslConfig.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/DefaultSocketChannelConfigurator.java b/src/main/java/com/rabbitmq/client/DefaultSocketChannelConfigurator.java index 470bd6f940..45d423b75f 100644 --- a/src/main/java/com/rabbitmq/client/DefaultSocketChannelConfigurator.java +++ b/src/main/java/com/rabbitmq/client/DefaultSocketChannelConfigurator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/DefaultSocketConfigurator.java b/src/main/java/com/rabbitmq/client/DefaultSocketConfigurator.java index 57732f45c3..4543dff3c3 100644 --- a/src/main/java/com/rabbitmq/client/DefaultSocketConfigurator.java +++ b/src/main/java/com/rabbitmq/client/DefaultSocketConfigurator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/DeliverCallback.java b/src/main/java/com/rabbitmq/client/DeliverCallback.java index 4760c7be1a..1d0ab0a3a3 100644 --- a/src/main/java/com/rabbitmq/client/DeliverCallback.java +++ b/src/main/java/com/rabbitmq/client/DeliverCallback.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/Delivery.java b/src/main/java/com/rabbitmq/client/Delivery.java index 91c36ffa3d..ecc53525c6 100644 --- a/src/main/java/com/rabbitmq/client/Delivery.java +++ b/src/main/java/com/rabbitmq/client/Delivery.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/DnsRecordIpAddressResolver.java b/src/main/java/com/rabbitmq/client/DnsRecordIpAddressResolver.java index 9c5d0dc69f..3e7f180fc8 100644 --- a/src/main/java/com/rabbitmq/client/DnsRecordIpAddressResolver.java +++ b/src/main/java/com/rabbitmq/client/DnsRecordIpAddressResolver.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/DnsSrvRecordAddressResolver.java b/src/main/java/com/rabbitmq/client/DnsSrvRecordAddressResolver.java index 5c340c3347..38a9a8d14c 100644 --- a/src/main/java/com/rabbitmq/client/DnsSrvRecordAddressResolver.java +++ b/src/main/java/com/rabbitmq/client/DnsSrvRecordAddressResolver.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/Envelope.java b/src/main/java/com/rabbitmq/client/Envelope.java index d8164f050d..7e798ea8bf 100644 --- a/src/main/java/com/rabbitmq/client/Envelope.java +++ b/src/main/java/com/rabbitmq/client/Envelope.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ExceptionHandler.java b/src/main/java/com/rabbitmq/client/ExceptionHandler.java index 90c982d11e..66f8cca08b 100644 --- a/src/main/java/com/rabbitmq/client/ExceptionHandler.java +++ b/src/main/java/com/rabbitmq/client/ExceptionHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/GetResponse.java b/src/main/java/com/rabbitmq/client/GetResponse.java index 83ea3bc991..0f91ff4125 100644 --- a/src/main/java/com/rabbitmq/client/GetResponse.java +++ b/src/main/java/com/rabbitmq/client/GetResponse.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/JDKSaslConfig.java b/src/main/java/com/rabbitmq/client/JDKSaslConfig.java index e39beb2eec..5d8fcd3cb5 100644 --- a/src/main/java/com/rabbitmq/client/JDKSaslConfig.java +++ b/src/main/java/com/rabbitmq/client/JDKSaslConfig.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ListAddressResolver.java b/src/main/java/com/rabbitmq/client/ListAddressResolver.java index e04eaa4431..9aedb472ec 100644 --- a/src/main/java/com/rabbitmq/client/ListAddressResolver.java +++ b/src/main/java/com/rabbitmq/client/ListAddressResolver.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/LongString.java b/src/main/java/com/rabbitmq/client/LongString.java index 3b091b98fc..6cfcfd7ab4 100644 --- a/src/main/java/com/rabbitmq/client/LongString.java +++ b/src/main/java/com/rabbitmq/client/LongString.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/MalformedFrameException.java b/src/main/java/com/rabbitmq/client/MalformedFrameException.java index a05dc95928..c8df470ebf 100644 --- a/src/main/java/com/rabbitmq/client/MalformedFrameException.java +++ b/src/main/java/com/rabbitmq/client/MalformedFrameException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/MapRpcServer.java b/src/main/java/com/rabbitmq/client/MapRpcServer.java index 5a65fe3126..4a90244589 100644 --- a/src/main/java/com/rabbitmq/client/MapRpcServer.java +++ b/src/main/java/com/rabbitmq/client/MapRpcServer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/MessageProperties.java b/src/main/java/com/rabbitmq/client/MessageProperties.java index bd7b6cd71c..ab2810ca21 100644 --- a/src/main/java/com/rabbitmq/client/MessageProperties.java +++ b/src/main/java/com/rabbitmq/client/MessageProperties.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/Method.java b/src/main/java/com/rabbitmq/client/Method.java index d6aa573ce0..06783c71af 100644 --- a/src/main/java/com/rabbitmq/client/Method.java +++ b/src/main/java/com/rabbitmq/client/Method.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/MetricsCollector.java b/src/main/java/com/rabbitmq/client/MetricsCollector.java index 1790b73b6d..a22d824f8f 100644 --- a/src/main/java/com/rabbitmq/client/MetricsCollector.java +++ b/src/main/java/com/rabbitmq/client/MetricsCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/MissedHeartbeatException.java b/src/main/java/com/rabbitmq/client/MissedHeartbeatException.java index ef3bf5335d..6da9407614 100644 --- a/src/main/java/com/rabbitmq/client/MissedHeartbeatException.java +++ b/src/main/java/com/rabbitmq/client/MissedHeartbeatException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/NoOpMetricsCollector.java b/src/main/java/com/rabbitmq/client/NoOpMetricsCollector.java index b2e9b703ef..7d3f5d8426 100644 --- a/src/main/java/com/rabbitmq/client/NoOpMetricsCollector.java +++ b/src/main/java/com/rabbitmq/client/NoOpMetricsCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/PossibleAuthenticationFailureException.java b/src/main/java/com/rabbitmq/client/PossibleAuthenticationFailureException.java index 9c8876d8e4..4281f57656 100644 --- a/src/main/java/com/rabbitmq/client/PossibleAuthenticationFailureException.java +++ b/src/main/java/com/rabbitmq/client/PossibleAuthenticationFailureException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ProtocolVersionMismatchException.java b/src/main/java/com/rabbitmq/client/ProtocolVersionMismatchException.java index e15e5873e3..8f91a992f7 100644 --- a/src/main/java/com/rabbitmq/client/ProtocolVersionMismatchException.java +++ b/src/main/java/com/rabbitmq/client/ProtocolVersionMismatchException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/Recoverable.java b/src/main/java/com/rabbitmq/client/Recoverable.java index 30d68992ba..9e651aa12c 100644 --- a/src/main/java/com/rabbitmq/client/Recoverable.java +++ b/src/main/java/com/rabbitmq/client/Recoverable.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/RecoveryDelayHandler.java b/src/main/java/com/rabbitmq/client/RecoveryDelayHandler.java index 84a2d577e7..d55153a52e 100644 --- a/src/main/java/com/rabbitmq/client/RecoveryDelayHandler.java +++ b/src/main/java/com/rabbitmq/client/RecoveryDelayHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/RecoveryListener.java b/src/main/java/com/rabbitmq/client/RecoveryListener.java index 4caf77e323..cfec1058a5 100644 --- a/src/main/java/com/rabbitmq/client/RecoveryListener.java +++ b/src/main/java/com/rabbitmq/client/RecoveryListener.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/Return.java b/src/main/java/com/rabbitmq/client/Return.java index d25532b773..0992a89ea2 100644 --- a/src/main/java/com/rabbitmq/client/Return.java +++ b/src/main/java/com/rabbitmq/client/Return.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ReturnCallback.java b/src/main/java/com/rabbitmq/client/ReturnCallback.java index efa3ad6065..89f8e4cbb1 100644 --- a/src/main/java/com/rabbitmq/client/ReturnCallback.java +++ b/src/main/java/com/rabbitmq/client/ReturnCallback.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ReturnListener.java b/src/main/java/com/rabbitmq/client/ReturnListener.java index 5f45f84ef4..d138b17450 100644 --- a/src/main/java/com/rabbitmq/client/ReturnListener.java +++ b/src/main/java/com/rabbitmq/client/ReturnListener.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/RpcClient.java b/src/main/java/com/rabbitmq/client/RpcClient.java index 793c8aa99c..723445e961 100644 --- a/src/main/java/com/rabbitmq/client/RpcClient.java +++ b/src/main/java/com/rabbitmq/client/RpcClient.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/RpcClientParams.java b/src/main/java/com/rabbitmq/client/RpcClientParams.java index 190792250f..ef5d346e77 100644 --- a/src/main/java/com/rabbitmq/client/RpcClientParams.java +++ b/src/main/java/com/rabbitmq/client/RpcClientParams.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/RpcServer.java b/src/main/java/com/rabbitmq/client/RpcServer.java index 426c8d749f..05b6294cd0 100644 --- a/src/main/java/com/rabbitmq/client/RpcServer.java +++ b/src/main/java/com/rabbitmq/client/RpcServer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/SaslConfig.java b/src/main/java/com/rabbitmq/client/SaslConfig.java index 5042f2c16f..119cfb6072 100644 --- a/src/main/java/com/rabbitmq/client/SaslConfig.java +++ b/src/main/java/com/rabbitmq/client/SaslConfig.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/SaslMechanism.java b/src/main/java/com/rabbitmq/client/SaslMechanism.java index 9a11b5a27f..eda4567ebf 100644 --- a/src/main/java/com/rabbitmq/client/SaslMechanism.java +++ b/src/main/java/com/rabbitmq/client/SaslMechanism.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ShutdownListener.java b/src/main/java/com/rabbitmq/client/ShutdownListener.java index 9775e454b0..ae7424fbcc 100644 --- a/src/main/java/com/rabbitmq/client/ShutdownListener.java +++ b/src/main/java/com/rabbitmq/client/ShutdownListener.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ShutdownNotifier.java b/src/main/java/com/rabbitmq/client/ShutdownNotifier.java index 9c1e3e8bfc..da8aaedfb3 100644 --- a/src/main/java/com/rabbitmq/client/ShutdownNotifier.java +++ b/src/main/java/com/rabbitmq/client/ShutdownNotifier.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/ShutdownSignalException.java b/src/main/java/com/rabbitmq/client/ShutdownSignalException.java index 24be455978..29c2f917bc 100644 --- a/src/main/java/com/rabbitmq/client/ShutdownSignalException.java +++ b/src/main/java/com/rabbitmq/client/ShutdownSignalException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/SocketChannelConfigurator.java b/src/main/java/com/rabbitmq/client/SocketChannelConfigurator.java index 4571e707f9..ffbb919c56 100644 --- a/src/main/java/com/rabbitmq/client/SocketChannelConfigurator.java +++ b/src/main/java/com/rabbitmq/client/SocketChannelConfigurator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/SocketChannelConfigurators.java b/src/main/java/com/rabbitmq/client/SocketChannelConfigurators.java index 711af1cf58..95d96c4fad 100644 --- a/src/main/java/com/rabbitmq/client/SocketChannelConfigurators.java +++ b/src/main/java/com/rabbitmq/client/SocketChannelConfigurators.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/SocketConfigurator.java b/src/main/java/com/rabbitmq/client/SocketConfigurator.java index 151f572461..17e63978ac 100644 --- a/src/main/java/com/rabbitmq/client/SocketConfigurator.java +++ b/src/main/java/com/rabbitmq/client/SocketConfigurator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/SocketConfigurators.java b/src/main/java/com/rabbitmq/client/SocketConfigurators.java index 23bc1b6a1b..5a46805316 100644 --- a/src/main/java/com/rabbitmq/client/SocketConfigurators.java +++ b/src/main/java/com/rabbitmq/client/SocketConfigurators.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/SslContextFactory.java b/src/main/java/com/rabbitmq/client/SslContextFactory.java index 0b285a9bf9..c012111970 100644 --- a/src/main/java/com/rabbitmq/client/SslContextFactory.java +++ b/src/main/java/com/rabbitmq/client/SslContextFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/SslEngineConfigurator.java b/src/main/java/com/rabbitmq/client/SslEngineConfigurator.java index 0ed04182f3..78b2b2eae9 100644 --- a/src/main/java/com/rabbitmq/client/SslEngineConfigurator.java +++ b/src/main/java/com/rabbitmq/client/SslEngineConfigurator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/SslEngineConfigurators.java b/src/main/java/com/rabbitmq/client/SslEngineConfigurators.java index 6e8ca36589..929fd507d4 100644 --- a/src/main/java/com/rabbitmq/client/SslEngineConfigurators.java +++ b/src/main/java/com/rabbitmq/client/SslEngineConfigurators.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/StringRpcServer.java b/src/main/java/com/rabbitmq/client/StringRpcServer.java index d437cb28b4..8cb00307b1 100644 --- a/src/main/java/com/rabbitmq/client/StringRpcServer.java +++ b/src/main/java/com/rabbitmq/client/StringRpcServer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/TopologyRecoveryException.java b/src/main/java/com/rabbitmq/client/TopologyRecoveryException.java index bb8163a096..9378167bb7 100644 --- a/src/main/java/com/rabbitmq/client/TopologyRecoveryException.java +++ b/src/main/java/com/rabbitmq/client/TopologyRecoveryException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/TrustEverythingTrustManager.java b/src/main/java/com/rabbitmq/client/TrustEverythingTrustManager.java index e7913d048e..cd558c705c 100644 --- a/src/main/java/com/rabbitmq/client/TrustEverythingTrustManager.java +++ b/src/main/java/com/rabbitmq/client/TrustEverythingTrustManager.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/UnblockedCallback.java b/src/main/java/com/rabbitmq/client/UnblockedCallback.java index 6d79423922..4421ba0d81 100644 --- a/src/main/java/com/rabbitmq/client/UnblockedCallback.java +++ b/src/main/java/com/rabbitmq/client/UnblockedCallback.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/UnexpectedFrameError.java b/src/main/java/com/rabbitmq/client/UnexpectedFrameError.java index e15e449e5b..dedf0fb8fd 100644 --- a/src/main/java/com/rabbitmq/client/UnexpectedFrameError.java +++ b/src/main/java/com/rabbitmq/client/UnexpectedFrameError.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/UnexpectedMethodError.java b/src/main/java/com/rabbitmq/client/UnexpectedMethodError.java index f5cde49379..94219d296b 100644 --- a/src/main/java/com/rabbitmq/client/UnexpectedMethodError.java +++ b/src/main/java/com/rabbitmq/client/UnexpectedMethodError.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/UnknownClassOrMethodId.java b/src/main/java/com/rabbitmq/client/UnknownClassOrMethodId.java index 3ad973a7b6..e4e8f39ec6 100644 --- a/src/main/java/com/rabbitmq/client/UnknownClassOrMethodId.java +++ b/src/main/java/com/rabbitmq/client/UnknownClassOrMethodId.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/UnroutableRpcRequestException.java b/src/main/java/com/rabbitmq/client/UnroutableRpcRequestException.java index 1a2877e14a..870e8847ae 100644 --- a/src/main/java/com/rabbitmq/client/UnroutableRpcRequestException.java +++ b/src/main/java/com/rabbitmq/client/UnroutableRpcRequestException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/AMQBasicProperties.java b/src/main/java/com/rabbitmq/client/impl/AMQBasicProperties.java index 54f312f06a..8e6a6ba3b5 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQBasicProperties.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQBasicProperties.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/AMQChannel.java b/src/main/java/com/rabbitmq/client/impl/AMQChannel.java index 238e162ee7..dad7becaef 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQChannel.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQChannel.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/AMQCommand.java b/src/main/java/com/rabbitmq/client/impl/AMQCommand.java index aa4df765fb..be48296143 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQCommand.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQCommand.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/AMQConnection.java b/src/main/java/com/rabbitmq/client/impl/AMQConnection.java index a4347f5971..5a7843cd8c 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQConnection.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -35,7 +35,7 @@ import java.util.concurrent.atomic.AtomicBoolean; final class Copyright { - final static String COPYRIGHT="Copyright (c) 2007-2021 VMware, Inc. or its affiliates."; + final static String COPYRIGHT="Copyright (c) 2007-2023 Broadcom Inc. or its subsidiaries.."; final static String LICENSE="Licensed under the MPL. See https://www.rabbitmq.com/"; } diff --git a/src/main/java/com/rabbitmq/client/impl/AMQContentHeader.java b/src/main/java/com/rabbitmq/client/impl/AMQContentHeader.java index e3bf4a479f..7a8311f4cf 100644 --- a/src/main/java/com/rabbitmq/client/impl/AMQContentHeader.java +++ b/src/main/java/com/rabbitmq/client/impl/AMQContentHeader.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/AbstractFrameHandlerFactory.java b/src/main/java/com/rabbitmq/client/impl/AbstractFrameHandlerFactory.java index 61f4c51325..576d4490cf 100644 --- a/src/main/java/com/rabbitmq/client/impl/AbstractFrameHandlerFactory.java +++ b/src/main/java/com/rabbitmq/client/impl/AbstractFrameHandlerFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2016-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/AbstractMetricsCollector.java b/src/main/java/com/rabbitmq/client/impl/AbstractMetricsCollector.java index 7ece72ad4c..74226c94a6 100644 --- a/src/main/java/com/rabbitmq/client/impl/AbstractMetricsCollector.java +++ b/src/main/java/com/rabbitmq/client/impl/AbstractMetricsCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/CRDemoMechanism.java b/src/main/java/com/rabbitmq/client/impl/CRDemoMechanism.java index 85f0d47cc4..c68fd2cdb1 100644 --- a/src/main/java/com/rabbitmq/client/impl/CRDemoMechanism.java +++ b/src/main/java/com/rabbitmq/client/impl/CRDemoMechanism.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelManager.java b/src/main/java/com/rabbitmq/client/impl/ChannelManager.java index 29c814ac41..15720db304 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelManager.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelManager.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ChannelN.java b/src/main/java/com/rabbitmq/client/impl/ChannelN.java index 9a3ee7cc83..ec083af96b 100644 --- a/src/main/java/com/rabbitmq/client/impl/ChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/ChannelN.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ClientVersion.java b/src/main/java/com/rabbitmq/client/impl/ClientVersion.java index 556bd6dc48..26e7a9c08c 100644 --- a/src/main/java/com/rabbitmq/client/impl/ClientVersion.java +++ b/src/main/java/com/rabbitmq/client/impl/ClientVersion.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/CommandAssembler.java b/src/main/java/com/rabbitmq/client/impl/CommandAssembler.java index 2ff9f10e3d..936cbe1684 100644 --- a/src/main/java/com/rabbitmq/client/impl/CommandAssembler.java +++ b/src/main/java/com/rabbitmq/client/impl/CommandAssembler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/CompletableFutureRpcWrapper.java b/src/main/java/com/rabbitmq/client/impl/CompletableFutureRpcWrapper.java index 2157e15d71..a91876e59d 100644 --- a/src/main/java/com/rabbitmq/client/impl/CompletableFutureRpcWrapper.java +++ b/src/main/java/com/rabbitmq/client/impl/CompletableFutureRpcWrapper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ConnectionParams.java b/src/main/java/com/rabbitmq/client/impl/ConnectionParams.java index 9fe6e8558d..25aaeb3773 100644 --- a/src/main/java/com/rabbitmq/client/impl/ConnectionParams.java +++ b/src/main/java/com/rabbitmq/client/impl/ConnectionParams.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ConsumerDispatcher.java b/src/main/java/com/rabbitmq/client/impl/ConsumerDispatcher.java index fec98710fe..0111902156 100644 --- a/src/main/java/com/rabbitmq/client/impl/ConsumerDispatcher.java +++ b/src/main/java/com/rabbitmq/client/impl/ConsumerDispatcher.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ConsumerWorkService.java b/src/main/java/com/rabbitmq/client/impl/ConsumerWorkService.java index 656f68cae7..9c63f2a773 100644 --- a/src/main/java/com/rabbitmq/client/impl/ConsumerWorkService.java +++ b/src/main/java/com/rabbitmq/client/impl/ConsumerWorkService.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ContentHeaderPropertyReader.java b/src/main/java/com/rabbitmq/client/impl/ContentHeaderPropertyReader.java index 115c3ef520..7279ad19fd 100644 --- a/src/main/java/com/rabbitmq/client/impl/ContentHeaderPropertyReader.java +++ b/src/main/java/com/rabbitmq/client/impl/ContentHeaderPropertyReader.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ContentHeaderPropertyWriter.java b/src/main/java/com/rabbitmq/client/impl/ContentHeaderPropertyWriter.java index 029329a13d..93653b0ee2 100644 --- a/src/main/java/com/rabbitmq/client/impl/ContentHeaderPropertyWriter.java +++ b/src/main/java/com/rabbitmq/client/impl/ContentHeaderPropertyWriter.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/CredentialsProvider.java b/src/main/java/com/rabbitmq/client/impl/CredentialsProvider.java index 19b159df78..e39ffc56f7 100644 --- a/src/main/java/com/rabbitmq/client/impl/CredentialsProvider.java +++ b/src/main/java/com/rabbitmq/client/impl/CredentialsProvider.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/CredentialsRefreshService.java b/src/main/java/com/rabbitmq/client/impl/CredentialsRefreshService.java index a490a61a5b..0cb94e22d7 100644 --- a/src/main/java/com/rabbitmq/client/impl/CredentialsRefreshService.java +++ b/src/main/java/com/rabbitmq/client/impl/CredentialsRefreshService.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/DefaultCredentialsProvider.java b/src/main/java/com/rabbitmq/client/impl/DefaultCredentialsProvider.java index eaf8a90c0c..7704f2ddac 100644 --- a/src/main/java/com/rabbitmq/client/impl/DefaultCredentialsProvider.java +++ b/src/main/java/com/rabbitmq/client/impl/DefaultCredentialsProvider.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/DefaultCredentialsRefreshService.java b/src/main/java/com/rabbitmq/client/impl/DefaultCredentialsRefreshService.java index 4f5968fcc9..7e4c4224fd 100644 --- a/src/main/java/com/rabbitmq/client/impl/DefaultCredentialsRefreshService.java +++ b/src/main/java/com/rabbitmq/client/impl/DefaultCredentialsRefreshService.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/DefaultExceptionHandler.java b/src/main/java/com/rabbitmq/client/impl/DefaultExceptionHandler.java index f521a37c14..4d091e4e93 100644 --- a/src/main/java/com/rabbitmq/client/impl/DefaultExceptionHandler.java +++ b/src/main/java/com/rabbitmq/client/impl/DefaultExceptionHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/Environment.java b/src/main/java/com/rabbitmq/client/impl/Environment.java index 2676311322..7ed33bb543 100644 --- a/src/main/java/com/rabbitmq/client/impl/Environment.java +++ b/src/main/java/com/rabbitmq/client/impl/Environment.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ErrorOnWriteListener.java b/src/main/java/com/rabbitmq/client/impl/ErrorOnWriteListener.java index dd9de0ce1c..0e9246f18a 100644 --- a/src/main/java/com/rabbitmq/client/impl/ErrorOnWriteListener.java +++ b/src/main/java/com/rabbitmq/client/impl/ErrorOnWriteListener.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ExternalMechanism.java b/src/main/java/com/rabbitmq/client/impl/ExternalMechanism.java index e50a0c17c7..961a510cd2 100644 --- a/src/main/java/com/rabbitmq/client/impl/ExternalMechanism.java +++ b/src/main/java/com/rabbitmq/client/impl/ExternalMechanism.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ForgivingExceptionHandler.java b/src/main/java/com/rabbitmq/client/impl/ForgivingExceptionHandler.java index 1c99f0a390..308acd26cb 100644 --- a/src/main/java/com/rabbitmq/client/impl/ForgivingExceptionHandler.java +++ b/src/main/java/com/rabbitmq/client/impl/ForgivingExceptionHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/Frame.java b/src/main/java/com/rabbitmq/client/impl/Frame.java index d1332b79d0..0395680bbb 100644 --- a/src/main/java/com/rabbitmq/client/impl/Frame.java +++ b/src/main/java/com/rabbitmq/client/impl/Frame.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/FrameHandler.java b/src/main/java/com/rabbitmq/client/impl/FrameHandler.java index 8d49352cb5..0e3cf71819 100644 --- a/src/main/java/com/rabbitmq/client/impl/FrameHandler.java +++ b/src/main/java/com/rabbitmq/client/impl/FrameHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/HeartbeatSender.java b/src/main/java/com/rabbitmq/client/impl/HeartbeatSender.java index d682317fe3..3d28d6ee21 100644 --- a/src/main/java/com/rabbitmq/client/impl/HeartbeatSender.java +++ b/src/main/java/com/rabbitmq/client/impl/HeartbeatSender.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/LongStringHelper.java b/src/main/java/com/rabbitmq/client/impl/LongStringHelper.java index 0a824db6de..6198d6c59d 100644 --- a/src/main/java/com/rabbitmq/client/impl/LongStringHelper.java +++ b/src/main/java/com/rabbitmq/client/impl/LongStringHelper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/Method.java b/src/main/java/com/rabbitmq/client/impl/Method.java index 73b0e5e0d5..b108e56aa9 100644 --- a/src/main/java/com/rabbitmq/client/impl/Method.java +++ b/src/main/java/com/rabbitmq/client/impl/Method.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/MethodArgumentReader.java b/src/main/java/com/rabbitmq/client/impl/MethodArgumentReader.java index e5c3f437ee..b4bfbff5eb 100644 --- a/src/main/java/com/rabbitmq/client/impl/MethodArgumentReader.java +++ b/src/main/java/com/rabbitmq/client/impl/MethodArgumentReader.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/MethodArgumentWriter.java b/src/main/java/com/rabbitmq/client/impl/MethodArgumentWriter.java index f452191413..b9c91d3876 100644 --- a/src/main/java/com/rabbitmq/client/impl/MethodArgumentWriter.java +++ b/src/main/java/com/rabbitmq/client/impl/MethodArgumentWriter.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/MicrometerMetricsCollector.java b/src/main/java/com/rabbitmq/client/impl/MicrometerMetricsCollector.java index 3713720c45..50ead1fb52 100644 --- a/src/main/java/com/rabbitmq/client/impl/MicrometerMetricsCollector.java +++ b/src/main/java/com/rabbitmq/client/impl/MicrometerMetricsCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/NetworkConnection.java b/src/main/java/com/rabbitmq/client/impl/NetworkConnection.java index 03ca1d2201..d955ae82cf 100644 --- a/src/main/java/com/rabbitmq/client/impl/NetworkConnection.java +++ b/src/main/java/com/rabbitmq/client/impl/NetworkConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProvider.java b/src/main/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProvider.java index 1dfccd07e9..5a4637a7f8 100644 --- a/src/main/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProvider.java +++ b/src/main/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProvider.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/OAuthTokenManagementException.java b/src/main/java/com/rabbitmq/client/impl/OAuthTokenManagementException.java index d3419189cb..595b74dd19 100644 --- a/src/main/java/com/rabbitmq/client/impl/OAuthTokenManagementException.java +++ b/src/main/java/com/rabbitmq/client/impl/OAuthTokenManagementException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/OpenTelemetryMetricsCollector.java b/src/main/java/com/rabbitmq/client/impl/OpenTelemetryMetricsCollector.java index 685865d5a6..d3cc4067da 100644 --- a/src/main/java/com/rabbitmq/client/impl/OpenTelemetryMetricsCollector.java +++ b/src/main/java/com/rabbitmq/client/impl/OpenTelemetryMetricsCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/PlainMechanism.java b/src/main/java/com/rabbitmq/client/impl/PlainMechanism.java index 75651d74b0..923e8cb722 100644 --- a/src/main/java/com/rabbitmq/client/impl/PlainMechanism.java +++ b/src/main/java/com/rabbitmq/client/impl/PlainMechanism.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/RefreshProtectedCredentialsProvider.java b/src/main/java/com/rabbitmq/client/impl/RefreshProtectedCredentialsProvider.java index cd8f855b01..dc091550d5 100644 --- a/src/main/java/com/rabbitmq/client/impl/RefreshProtectedCredentialsProvider.java +++ b/src/main/java/com/rabbitmq/client/impl/RefreshProtectedCredentialsProvider.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/RpcContinuationRpcWrapper.java b/src/main/java/com/rabbitmq/client/impl/RpcContinuationRpcWrapper.java index 71d60a4690..b5f202237c 100644 --- a/src/main/java/com/rabbitmq/client/impl/RpcContinuationRpcWrapper.java +++ b/src/main/java/com/rabbitmq/client/impl/RpcContinuationRpcWrapper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/RpcWrapper.java b/src/main/java/com/rabbitmq/client/impl/RpcWrapper.java index 8d81258ffc..009ac45fe7 100644 --- a/src/main/java/com/rabbitmq/client/impl/RpcWrapper.java +++ b/src/main/java/com/rabbitmq/client/impl/RpcWrapper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/SetQueue.java b/src/main/java/com/rabbitmq/client/impl/SetQueue.java index 6a5dc8db12..11bc1de95d 100644 --- a/src/main/java/com/rabbitmq/client/impl/SetQueue.java +++ b/src/main/java/com/rabbitmq/client/impl/SetQueue.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ShutdownNotifierComponent.java b/src/main/java/com/rabbitmq/client/impl/ShutdownNotifierComponent.java index e4ec15836b..ab7de52c40 100644 --- a/src/main/java/com/rabbitmq/client/impl/ShutdownNotifierComponent.java +++ b/src/main/java/com/rabbitmq/client/impl/ShutdownNotifierComponent.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java b/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java index 3e4e0a7078..7df8b7c3b7 100644 --- a/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java +++ b/src/main/java/com/rabbitmq/client/impl/SocketFrameHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/SocketFrameHandlerFactory.java b/src/main/java/com/rabbitmq/client/impl/SocketFrameHandlerFactory.java index 40818c46ba..b48374f9bc 100644 --- a/src/main/java/com/rabbitmq/client/impl/SocketFrameHandlerFactory.java +++ b/src/main/java/com/rabbitmq/client/impl/SocketFrameHandlerFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/StandardMetricsCollector.java b/src/main/java/com/rabbitmq/client/impl/StandardMetricsCollector.java index 07e7780817..a4ddfc24f4 100644 --- a/src/main/java/com/rabbitmq/client/impl/StandardMetricsCollector.java +++ b/src/main/java/com/rabbitmq/client/impl/StandardMetricsCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/StrictExceptionHandler.java b/src/main/java/com/rabbitmq/client/impl/StrictExceptionHandler.java index 62f37d72b4..7fc1f37821 100644 --- a/src/main/java/com/rabbitmq/client/impl/StrictExceptionHandler.java +++ b/src/main/java/com/rabbitmq/client/impl/StrictExceptionHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/TlsUtils.java b/src/main/java/com/rabbitmq/client/impl/TlsUtils.java index aa103607ec..45a5ecfde5 100644 --- a/src/main/java/com/rabbitmq/client/impl/TlsUtils.java +++ b/src/main/java/com/rabbitmq/client/impl/TlsUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/TruncatedInputStream.java b/src/main/java/com/rabbitmq/client/impl/TruncatedInputStream.java index dd35c3f2e6..ba3e756e0f 100644 --- a/src/main/java/com/rabbitmq/client/impl/TruncatedInputStream.java +++ b/src/main/java/com/rabbitmq/client/impl/TruncatedInputStream.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/UnknownChannelException.java b/src/main/java/com/rabbitmq/client/impl/UnknownChannelException.java index ff59b907cf..a7c2331b80 100644 --- a/src/main/java/com/rabbitmq/client/impl/UnknownChannelException.java +++ b/src/main/java/com/rabbitmq/client/impl/UnknownChannelException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/UpdateSecretExtension.java b/src/main/java/com/rabbitmq/client/impl/UpdateSecretExtension.java index 3028a886ab..ff5e7bfeed 100644 --- a/src/main/java/com/rabbitmq/client/impl/UpdateSecretExtension.java +++ b/src/main/java/com/rabbitmq/client/impl/UpdateSecretExtension.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/Utils.java b/src/main/java/com/rabbitmq/client/impl/Utils.java index d3e3412ee4..c306647e34 100644 --- a/src/main/java/com/rabbitmq/client/impl/Utils.java +++ b/src/main/java/com/rabbitmq/client/impl/Utils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ValueReader.java b/src/main/java/com/rabbitmq/client/impl/ValueReader.java index ed7f41284c..77329505b5 100644 --- a/src/main/java/com/rabbitmq/client/impl/ValueReader.java +++ b/src/main/java/com/rabbitmq/client/impl/ValueReader.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/ValueWriter.java b/src/main/java/com/rabbitmq/client/impl/ValueWriter.java index c167fc0475..f8e599ef32 100644 --- a/src/main/java/com/rabbitmq/client/impl/ValueWriter.java +++ b/src/main/java/com/rabbitmq/client/impl/ValueWriter.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/VariableLinkedBlockingQueue.java b/src/main/java/com/rabbitmq/client/impl/VariableLinkedBlockingQueue.java index 60dbe04bb4..a239239868 100644 --- a/src/main/java/com/rabbitmq/client/impl/VariableLinkedBlockingQueue.java +++ b/src/main/java/com/rabbitmq/client/impl/VariableLinkedBlockingQueue.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -14,8 +14,9 @@ // info@rabbitmq.com. /* - * Modifications Copyright 2015-2020 VMware, Inc. or its affiliates. and licenced as per - * the rest of the RabbitMQ Java client. + * Modifications Copyright 2015-2023 Broadcom. All Rights Reserved. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * Licenced as per the rest of the RabbitMQ Java client. */ /* diff --git a/src/main/java/com/rabbitmq/client/impl/Version.java b/src/main/java/com/rabbitmq/client/impl/Version.java index 3e64d51702..ea93eba885 100644 --- a/src/main/java/com/rabbitmq/client/impl/Version.java +++ b/src/main/java/com/rabbitmq/client/impl/Version.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/WorkPool.java b/src/main/java/com/rabbitmq/client/impl/WorkPool.java index e4d7dc8cfe..870df03b15 100644 --- a/src/main/java/com/rabbitmq/client/impl/WorkPool.java +++ b/src/main/java/com/rabbitmq/client/impl/WorkPool.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/WorkPoolFullException.java b/src/main/java/com/rabbitmq/client/impl/WorkPoolFullException.java index 68e7175f1a..8b753b747d 100644 --- a/src/main/java/com/rabbitmq/client/impl/WorkPoolFullException.java +++ b/src/main/java/com/rabbitmq/client/impl/WorkPoolFullException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/ByteBufferOutputStream.java b/src/main/java/com/rabbitmq/client/impl/nio/ByteBufferOutputStream.java index e8ed5ff841..62ce2b4671 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/ByteBufferOutputStream.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/ByteBufferOutputStream.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java b/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java index 3562e92a1b..cee07ab06a 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/FrameBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/FrameWriteRequest.java b/src/main/java/com/rabbitmq/client/impl/nio/FrameWriteRequest.java index d291a0d3f4..edd255a40b 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/FrameWriteRequest.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/FrameWriteRequest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/HeaderWriteRequest.java b/src/main/java/com/rabbitmq/client/impl/nio/HeaderWriteRequest.java index 558f35e025..68c9f6e894 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/HeaderWriteRequest.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/HeaderWriteRequest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/NioHelper.java b/src/main/java/com/rabbitmq/client/impl/nio/NioHelper.java index ab8a49b71b..8c09857493 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/NioHelper.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/NioHelper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/NioLoop.java b/src/main/java/com/rabbitmq/client/impl/nio/NioLoop.java index b143429ea7..ea9351e410 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/NioLoop.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/NioLoop.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/NioLoopContext.java b/src/main/java/com/rabbitmq/client/impl/nio/NioLoopContext.java index 55412e0908..3d9e76975a 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/NioLoopContext.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/NioLoopContext.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/NioParams.java b/src/main/java/com/rabbitmq/client/impl/nio/NioParams.java index 88eedf9145..d3cd8ceed1 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/NioParams.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/NioParams.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SelectorHolder.java b/src/main/java/com/rabbitmq/client/impl/nio/SelectorHolder.java index 97b64b2be1..9f1168efbf 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SelectorHolder.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SelectorHolder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandler.java b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandler.java index c17c5e9579..93eea9cd60 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandler.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java index ed0a4f20f8..3e7e55e94a 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java index b1a391fd65..f8566fb876 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelFrameHandlerState.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelRegistration.java b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelRegistration.java index 2c9d3f0d03..feff419fff 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelRegistration.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SocketChannelRegistration.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineByteBufferOutputStream.java b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineByteBufferOutputStream.java index c861ad6e77..24488578e1 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineByteBufferOutputStream.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineByteBufferOutputStream.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java index 48072988c2..bdf898dd3b 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineFrameBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java index b7a535da87..d9a5b17105 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2022 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/nio/WriteRequest.java b/src/main/java/com/rabbitmq/client/impl/nio/WriteRequest.java index c61731e18b..2af3c483ee 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/WriteRequest.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/WriteRequest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringChannel.java b/src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringChannel.java index cfba283dd2..84ceee72b9 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringChannel.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringChannel.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java b/src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java index 70004ae749..ca5131687f 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/AutorecoveringConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/BackoffPolicy.java b/src/main/java/com/rabbitmq/client/impl/recovery/BackoffPolicy.java index 08498683ab..036bf43b63 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/BackoffPolicy.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/BackoffPolicy.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/ConsumerRecoveryListener.java b/src/main/java/com/rabbitmq/client/impl/recovery/ConsumerRecoveryListener.java index 8c87d86090..696944f8df 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/ConsumerRecoveryListener.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/ConsumerRecoveryListener.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/DefaultRetryHandler.java b/src/main/java/com/rabbitmq/client/impl/recovery/DefaultRetryHandler.java index 2e2890c05b..2e834c075d 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/DefaultRetryHandler.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/DefaultRetryHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/QueueRecoveryListener.java b/src/main/java/com/rabbitmq/client/impl/recovery/QueueRecoveryListener.java index 66f7f9248f..b9ee8003ab 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/QueueRecoveryListener.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/QueueRecoveryListener.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedBinding.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedBinding.java index 0ddf4e3bcf..2d1f50fda3 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedBinding.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedBinding.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedConsumer.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedConsumer.java index 3b0d5009d5..16e4ba078c 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedConsumer.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedConsumer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedEntity.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedEntity.java index a56f58b88a..2f30a313dc 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedEntity.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedEntity.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedExchange.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedExchange.java index aaedcbbf58..9a493aebfd 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedExchange.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedExchange.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedExchangeBinding.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedExchangeBinding.java index d128b59bf0..6b967164d7 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedExchangeBinding.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedExchangeBinding.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedNamedEntity.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedNamedEntity.java index 7b5a86a8f9..3d69ac75f2 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedNamedEntity.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedNamedEntity.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueue.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueue.java index b41ecdc302..a4cd98eec9 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueue.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueue.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueueBinding.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueueBinding.java index 37bbb14fe5..1a1b506385 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueueBinding.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecordedQueueBinding.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnection.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnection.java index 7060407363..afba2483b5 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnection.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnectionFactory.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnectionFactory.java index 535330c24e..bfefdb3a28 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnectionFactory.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareAMQConnectionFactory.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelManager.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelManager.java index d4208d340b..a79b2dfdb5 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelManager.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelManager.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelN.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelN.java index f4ddd97330..d3caea9207 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelN.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryAwareChannelN.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryCanBeginListener.java b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryCanBeginListener.java index cb5eae86fb..004537956d 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryCanBeginListener.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RecoveryCanBeginListener.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RetryContext.java b/src/main/java/com/rabbitmq/client/impl/recovery/RetryContext.java index 6640a7e7c1..f9b10a840f 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RetryContext.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RetryContext.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RetryHandler.java b/src/main/java/com/rabbitmq/client/impl/recovery/RetryHandler.java index a5eac40fab..d840b88a04 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RetryHandler.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RetryHandler.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/RetryResult.java b/src/main/java/com/rabbitmq/client/impl/recovery/RetryResult.java index df1d6ae1df..9250c74f7f 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/RetryResult.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/RetryResult.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/TopologyRecoveryFilter.java b/src/main/java/com/rabbitmq/client/impl/recovery/TopologyRecoveryFilter.java index 602b5452f5..02364510a1 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/TopologyRecoveryFilter.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/TopologyRecoveryFilter.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/TopologyRecoveryRetryHandlerBuilder.java b/src/main/java/com/rabbitmq/client/impl/recovery/TopologyRecoveryRetryHandlerBuilder.java index b8dfdff7bc..170620547e 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/TopologyRecoveryRetryHandlerBuilder.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/TopologyRecoveryRetryHandlerBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/TopologyRecoveryRetryLogic.java b/src/main/java/com/rabbitmq/client/impl/recovery/TopologyRecoveryRetryLogic.java index 5781c54d36..8346e23d00 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/TopologyRecoveryRetryLogic.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/TopologyRecoveryRetryLogic.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/impl/recovery/Utils.java b/src/main/java/com/rabbitmq/client/impl/recovery/Utils.java index 569f9da73a..1e74020077 100644 --- a/src/main/java/com/rabbitmq/client/impl/recovery/Utils.java +++ b/src/main/java/com/rabbitmq/client/impl/recovery/Utils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java index 76ddd82a70..7b37cd32a0 100644 --- a/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java index e542d34387..04c452f8fe 100644 --- a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java index 1bfa512b86..d32f9be01c 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultProcessObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultProcessObservationConvention.java index b7233adfae..45201f9ea4 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultProcessObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultProcessObservationConvention.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java index 019e32367f..199b3df1e0 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultReceiveObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultReceiveObservationConvention.java index 7a4bd0317b..e1928b8ee5 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultReceiveObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultReceiveObservationConvention.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java index 2209d7897c..e838d302e5 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java index ba10eca747..d57f035fd5 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java index cd0b1ca500..74a2071dc7 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java index 1a15a7e762..9e775d108f 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java index 51b3e06be4..146e8ee058 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java index f6fce73ff2..8f8fc60e89 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java index 1b169d838f..d88d7033c6 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/tools/json/JSONReader.java b/src/main/java/com/rabbitmq/tools/json/JSONReader.java index c22ee8eb00..01d6c38fde 100644 --- a/src/main/java/com/rabbitmq/tools/json/JSONReader.java +++ b/src/main/java/com/rabbitmq/tools/json/JSONReader.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2 @@ -15,7 +15,7 @@ /* Copyright (c) 2006-2007 Frank Carver - Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All Rights Reserved + Copyright (c) 2007-2023 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"); you may not use this file except in compliance with the License. diff --git a/src/main/java/com/rabbitmq/tools/json/JSONSerializable.java b/src/main/java/com/rabbitmq/tools/json/JSONSerializable.java index e3fdcd1180..0e71785368 100644 --- a/src/main/java/com/rabbitmq/tools/json/JSONSerializable.java +++ b/src/main/java/com/rabbitmq/tools/json/JSONSerializable.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/tools/json/JSONUtil.java b/src/main/java/com/rabbitmq/tools/json/JSONUtil.java index 55c2b695ed..a00903a50f 100644 --- a/src/main/java/com/rabbitmq/tools/json/JSONUtil.java +++ b/src/main/java/com/rabbitmq/tools/json/JSONUtil.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/tools/json/JSONWriter.java b/src/main/java/com/rabbitmq/tools/json/JSONWriter.java index 187fb5402f..496eccf99b 100644 --- a/src/main/java/com/rabbitmq/tools/json/JSONWriter.java +++ b/src/main/java/com/rabbitmq/tools/json/JSONWriter.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2 @@ -15,7 +15,8 @@ /* Copyright (c) 2006-2007 Frank Carver - Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All Rights Reserved + Copyright (c) 2007-2023 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries., Inc. or its affiliates. All Rights Reserved. + Copyright (c) 2023 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"); you may not use this file except in compliance with the License. diff --git a/src/main/java/com/rabbitmq/tools/jsonrpc/DefaultJsonRpcMapper.java b/src/main/java/com/rabbitmq/tools/jsonrpc/DefaultJsonRpcMapper.java index 204e68007b..87a556c773 100644 --- a/src/main/java/com/rabbitmq/tools/jsonrpc/DefaultJsonRpcMapper.java +++ b/src/main/java/com/rabbitmq/tools/jsonrpc/DefaultJsonRpcMapper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/tools/jsonrpc/JacksonJsonRpcMapper.java b/src/main/java/com/rabbitmq/tools/jsonrpc/JacksonJsonRpcMapper.java index 81a1f26b5b..7eae103d7d 100644 --- a/src/main/java/com/rabbitmq/tools/jsonrpc/JacksonJsonRpcMapper.java +++ b/src/main/java/com/rabbitmq/tools/jsonrpc/JacksonJsonRpcMapper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcClient.java b/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcClient.java index da96560bd5..905945d4cb 100644 --- a/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcClient.java +++ b/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcClient.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcException.java b/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcException.java index d167d0318e..c2f7dfee2a 100644 --- a/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcException.java +++ b/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcMapper.java b/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcMapper.java index 980428612b..b8fc8061d4 100644 --- a/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcMapper.java +++ b/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcMapper.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcMappingException.java b/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcMappingException.java index fc998b1b02..6876e538f6 100644 --- a/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcMappingException.java +++ b/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcMappingException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcServer.java b/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcServer.java index 816ec9d879..9be2de3840 100644 --- a/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcServer.java +++ b/src/main/java/com/rabbitmq/tools/jsonrpc/JsonRpcServer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/tools/jsonrpc/ParameterDescription.java b/src/main/java/com/rabbitmq/tools/jsonrpc/ParameterDescription.java index cc58516b1c..61fbfbaf63 100644 --- a/src/main/java/com/rabbitmq/tools/jsonrpc/ParameterDescription.java +++ b/src/main/java/com/rabbitmq/tools/jsonrpc/ParameterDescription.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/tools/jsonrpc/ProcedureDescription.java b/src/main/java/com/rabbitmq/tools/jsonrpc/ProcedureDescription.java index 431d4e6e13..be465e2659 100644 --- a/src/main/java/com/rabbitmq/tools/jsonrpc/ProcedureDescription.java +++ b/src/main/java/com/rabbitmq/tools/jsonrpc/ProcedureDescription.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/tools/jsonrpc/ServiceDescription.java b/src/main/java/com/rabbitmq/tools/jsonrpc/ServiceDescription.java index 8986cc24e2..7711eb838b 100644 --- a/src/main/java/com/rabbitmq/tools/jsonrpc/ServiceDescription.java +++ b/src/main/java/com/rabbitmq/tools/jsonrpc/ServiceDescription.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/utility/BlockingCell.java b/src/main/java/com/rabbitmq/utility/BlockingCell.java index f9c588b7cf..0792ebde71 100644 --- a/src/main/java/com/rabbitmq/utility/BlockingCell.java +++ b/src/main/java/com/rabbitmq/utility/BlockingCell.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/utility/BlockingValueOrException.java b/src/main/java/com/rabbitmq/utility/BlockingValueOrException.java index 5946ccbb4d..41f93249dd 100644 --- a/src/main/java/com/rabbitmq/utility/BlockingValueOrException.java +++ b/src/main/java/com/rabbitmq/utility/BlockingValueOrException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/utility/IntAllocator.java b/src/main/java/com/rabbitmq/utility/IntAllocator.java index 88d9f3efb8..5fe44419dc 100644 --- a/src/main/java/com/rabbitmq/utility/IntAllocator.java +++ b/src/main/java/com/rabbitmq/utility/IntAllocator.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/utility/SensibleClone.java b/src/main/java/com/rabbitmq/utility/SensibleClone.java index 78e68cb6a5..cf02ac9c8a 100644 --- a/src/main/java/com/rabbitmq/utility/SensibleClone.java +++ b/src/main/java/com/rabbitmq/utility/SensibleClone.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/utility/Utility.java b/src/main/java/com/rabbitmq/utility/Utility.java index aacedc0f62..2fa6f7ec74 100644 --- a/src/main/java/com/rabbitmq/utility/Utility.java +++ b/src/main/java/com/rabbitmq/utility/Utility.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/utility/ValueOrException.java b/src/main/java/com/rabbitmq/utility/ValueOrException.java index 93cb1fe563..a8adbefff4 100644 --- a/src/main/java/com/rabbitmq/utility/ValueOrException.java +++ b/src/main/java/com/rabbitmq/utility/ValueOrException.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/AbstractJsonRpcTest.java b/src/test/java/com/rabbitmq/client/AbstractJsonRpcTest.java index ec9fbd2f39..6172a8f208 100644 --- a/src/test/java/com/rabbitmq/client/AbstractJsonRpcTest.java +++ b/src/test/java/com/rabbitmq/client/AbstractJsonRpcTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java b/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java index 07e27a6838..ee4456f536 100644 --- a/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java +++ b/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/DefaultJsonRpcTest.java b/src/test/java/com/rabbitmq/client/DefaultJsonRpcTest.java index 7f231d1bd3..a24d93f43f 100644 --- a/src/test/java/com/rabbitmq/client/DefaultJsonRpcTest.java +++ b/src/test/java/com/rabbitmq/client/DefaultJsonRpcTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/JacksonJsonRpcTest.java b/src/test/java/com/rabbitmq/client/JacksonJsonRpcTest.java index f926061f94..c8e8ebc829 100644 --- a/src/test/java/com/rabbitmq/client/JacksonJsonRpcTest.java +++ b/src/test/java/com/rabbitmq/client/JacksonJsonRpcTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/QueueingConsumer.java b/src/test/java/com/rabbitmq/client/QueueingConsumer.java index 9ecddaa67b..c018b1989b 100644 --- a/src/test/java/com/rabbitmq/client/QueueingConsumer.java +++ b/src/test/java/com/rabbitmq/client/QueueingConsumer.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/impl/AMQConnectionRefreshCredentialsTest.java b/src/test/java/com/rabbitmq/client/impl/AMQConnectionRefreshCredentialsTest.java index 96d40cc4cf..d99a8434d6 100644 --- a/src/test/java/com/rabbitmq/client/impl/AMQConnectionRefreshCredentialsTest.java +++ b/src/test/java/com/rabbitmq/client/impl/AMQConnectionRefreshCredentialsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/impl/DefaultCredentialsRefreshServiceTest.java b/src/test/java/com/rabbitmq/client/impl/DefaultCredentialsRefreshServiceTest.java index 2ad3681c52..e52a6d98c3 100644 --- a/src/test/java/com/rabbitmq/client/impl/DefaultCredentialsRefreshServiceTest.java +++ b/src/test/java/com/rabbitmq/client/impl/DefaultCredentialsRefreshServiceTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProviderTest.java b/src/test/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProviderTest.java index f717cbcf27..6d210f3a8f 100644 --- a/src/test/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProviderTest.java +++ b/src/test/java/com/rabbitmq/client/impl/OAuth2ClientCredentialsGrantCredentialsProviderTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/impl/RefreshProtectedCredentialsProviderTest.java b/src/test/java/com/rabbitmq/client/impl/RefreshProtectedCredentialsProviderTest.java index dfed27341d..8da70a0034 100644 --- a/src/test/java/com/rabbitmq/client/impl/RefreshProtectedCredentialsProviderTest.java +++ b/src/test/java/com/rabbitmq/client/impl/RefreshProtectedCredentialsProviderTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/impl/ValueWriterTest.java b/src/test/java/com/rabbitmq/client/impl/ValueWriterTest.java index 54a9acfe55..e402c1f868 100644 --- a/src/test/java/com/rabbitmq/client/impl/ValueWriterTest.java +++ b/src/test/java/com/rabbitmq/client/impl/ValueWriterTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/impl/WorkPoolTests.java b/src/test/java/com/rabbitmq/client/impl/WorkPoolTests.java index 54a49da485..19d874ced6 100644 --- a/src/test/java/com/rabbitmq/client/impl/WorkPoolTests.java +++ b/src/test/java/com/rabbitmq/client/impl/WorkPoolTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/AMQBuilderApiTest.java b/src/test/java/com/rabbitmq/client/test/AMQBuilderApiTest.java index a4b54c9fa7..c2a1d40149 100644 --- a/src/test/java/com/rabbitmq/client/test/AMQBuilderApiTest.java +++ b/src/test/java/com/rabbitmq/client/test/AMQBuilderApiTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/AMQChannelTest.java b/src/test/java/com/rabbitmq/client/test/AMQChannelTest.java index 091e1b14c2..91112cce64 100644 --- a/src/test/java/com/rabbitmq/client/test/AMQChannelTest.java +++ b/src/test/java/com/rabbitmq/client/test/AMQChannelTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/AMQConnectionTest.java b/src/test/java/com/rabbitmq/client/test/AMQConnectionTest.java index de50c74542..16f861086b 100644 --- a/src/test/java/com/rabbitmq/client/test/AMQConnectionTest.java +++ b/src/test/java/com/rabbitmq/client/test/AMQConnectionTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/AddressTest.java b/src/test/java/com/rabbitmq/client/test/AddressTest.java index bc9e860e8b..d8101c63c8 100644 --- a/src/test/java/com/rabbitmq/client/test/AddressTest.java +++ b/src/test/java/com/rabbitmq/client/test/AddressTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/AmqpUriTest.java b/src/test/java/com/rabbitmq/client/test/AmqpUriTest.java index f81ee0ea5c..e3a41b0ae4 100644 --- a/src/test/java/com/rabbitmq/client/test/AmqpUriTest.java +++ b/src/test/java/com/rabbitmq/client/test/AmqpUriTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/BlockedConnectionTest.java b/src/test/java/com/rabbitmq/client/test/BlockedConnectionTest.java index f8748ed27e..d3ceb146fc 100644 --- a/src/test/java/com/rabbitmq/client/test/BlockedConnectionTest.java +++ b/src/test/java/com/rabbitmq/client/test/BlockedConnectionTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/BlockingCellTest.java b/src/test/java/com/rabbitmq/client/test/BlockingCellTest.java index 03334570a6..a66ae1e0c0 100644 --- a/src/test/java/com/rabbitmq/client/test/BlockingCellTest.java +++ b/src/test/java/com/rabbitmq/client/test/BlockingCellTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/BrokenFramesTest.java b/src/test/java/com/rabbitmq/client/test/BrokenFramesTest.java index c0be492ae7..1bc9583c18 100644 --- a/src/test/java/com/rabbitmq/client/test/BrokenFramesTest.java +++ b/src/test/java/com/rabbitmq/client/test/BrokenFramesTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java b/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java index ed975b0e5f..d7d176a359 100644 --- a/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java +++ b/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/Bug20004Test.java b/src/test/java/com/rabbitmq/client/test/Bug20004Test.java index a62598165b..5807be06f3 100644 --- a/src/test/java/com/rabbitmq/client/test/Bug20004Test.java +++ b/src/test/java/com/rabbitmq/client/test/Bug20004Test.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ChannelAsyncCompletableFutureTest.java b/src/test/java/com/rabbitmq/client/test/ChannelAsyncCompletableFutureTest.java index b3e5592dd4..1e46bb2a89 100644 --- a/src/test/java/com/rabbitmq/client/test/ChannelAsyncCompletableFutureTest.java +++ b/src/test/java/com/rabbitmq/client/test/ChannelAsyncCompletableFutureTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ChannelNTest.java b/src/test/java/com/rabbitmq/client/test/ChannelNTest.java index 372acbc183..b7c34d15e3 100644 --- a/src/test/java/com/rabbitmq/client/test/ChannelNTest.java +++ b/src/test/java/com/rabbitmq/client/test/ChannelNTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ChannelNumberAllocationTests.java b/src/test/java/com/rabbitmq/client/test/ChannelNumberAllocationTests.java index 76ecd0abda..28c28552f5 100644 --- a/src/test/java/com/rabbitmq/client/test/ChannelNumberAllocationTests.java +++ b/src/test/java/com/rabbitmq/client/test/ChannelNumberAllocationTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ChannelRpcTimeoutIntegrationTest.java b/src/test/java/com/rabbitmq/client/test/ChannelRpcTimeoutIntegrationTest.java index d2f3aafcba..bc7c31b135 100644 --- a/src/test/java/com/rabbitmq/client/test/ChannelRpcTimeoutIntegrationTest.java +++ b/src/test/java/com/rabbitmq/client/test/ChannelRpcTimeoutIntegrationTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ClientTestSuite.java b/src/test/java/com/rabbitmq/client/test/ClientTestSuite.java index 121e292e40..245163d3bd 100644 --- a/src/test/java/com/rabbitmq/client/test/ClientTestSuite.java +++ b/src/test/java/com/rabbitmq/client/test/ClientTestSuite.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ClientVersionTest.java b/src/test/java/com/rabbitmq/client/test/ClientVersionTest.java index 3b66ec34fa..d782e050cf 100644 --- a/src/test/java/com/rabbitmq/client/test/ClientVersionTest.java +++ b/src/test/java/com/rabbitmq/client/test/ClientVersionTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ClonePropertiesTest.java b/src/test/java/com/rabbitmq/client/test/ClonePropertiesTest.java index 0ba413e9e8..af1702bc48 100644 --- a/src/test/java/com/rabbitmq/client/test/ClonePropertiesTest.java +++ b/src/test/java/com/rabbitmq/client/test/ClonePropertiesTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/CloseInMainLoop.java b/src/test/java/com/rabbitmq/client/test/CloseInMainLoop.java index b340f472c4..186df461a9 100644 --- a/src/test/java/com/rabbitmq/client/test/CloseInMainLoop.java +++ b/src/test/java/com/rabbitmq/client/test/CloseInMainLoop.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ConfirmBase.java b/src/test/java/com/rabbitmq/client/test/ConfirmBase.java index 425965b17a..1a82fd9c0a 100644 --- a/src/test/java/com/rabbitmq/client/test/ConfirmBase.java +++ b/src/test/java/com/rabbitmq/client/test/ConfirmBase.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ConnectionFactoryTest.java b/src/test/java/com/rabbitmq/client/test/ConnectionFactoryTest.java index 9d78143d22..d5cf7e2b39 100644 --- a/src/test/java/com/rabbitmq/client/test/ConnectionFactoryTest.java +++ b/src/test/java/com/rabbitmq/client/test/ConnectionFactoryTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ConnectionTest.java b/src/test/java/com/rabbitmq/client/test/ConnectionTest.java index e7233d6e86..19a0bceb49 100644 --- a/src/test/java/com/rabbitmq/client/test/ConnectionTest.java +++ b/src/test/java/com/rabbitmq/client/test/ConnectionTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/DefaultRetryHandlerTest.java b/src/test/java/com/rabbitmq/client/test/DefaultRetryHandlerTest.java index 363c7285c8..ca3f40a8b3 100644 --- a/src/test/java/com/rabbitmq/client/test/DefaultRetryHandlerTest.java +++ b/src/test/java/com/rabbitmq/client/test/DefaultRetryHandlerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/DnsSrvRecordAddressResolverTest.java b/src/test/java/com/rabbitmq/client/test/DnsSrvRecordAddressResolverTest.java index 839fb16fe4..ca9d67aec5 100644 --- a/src/test/java/com/rabbitmq/client/test/DnsSrvRecordAddressResolverTest.java +++ b/src/test/java/com/rabbitmq/client/test/DnsSrvRecordAddressResolverTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/FrameBuilderTest.java b/src/test/java/com/rabbitmq/client/test/FrameBuilderTest.java index 5c227ae1c6..1f2ebf59f0 100644 --- a/src/test/java/com/rabbitmq/client/test/FrameBuilderTest.java +++ b/src/test/java/com/rabbitmq/client/test/FrameBuilderTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/GeneratedClassesTest.java b/src/test/java/com/rabbitmq/client/test/GeneratedClassesTest.java index d8b139e7d7..c67ad3abae 100644 --- a/src/test/java/com/rabbitmq/client/test/GeneratedClassesTest.java +++ b/src/test/java/com/rabbitmq/client/test/GeneratedClassesTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/JSONReadWriteTest.java b/src/test/java/com/rabbitmq/client/test/JSONReadWriteTest.java index 8aed35fb80..698e61908d 100644 --- a/src/test/java/com/rabbitmq/client/test/JSONReadWriteTest.java +++ b/src/test/java/com/rabbitmq/client/test/JSONReadWriteTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2020 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 1.1 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/LambdaCallbackTest.java b/src/test/java/com/rabbitmq/client/test/LambdaCallbackTest.java index 68390b0631..1fb6c2e826 100644 --- a/src/test/java/com/rabbitmq/client/test/LambdaCallbackTest.java +++ b/src/test/java/com/rabbitmq/client/test/LambdaCallbackTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/LongStringTest.java b/src/test/java/com/rabbitmq/client/test/LongStringTest.java index 82c6053116..505544ce20 100644 --- a/src/test/java/com/rabbitmq/client/test/LongStringTest.java +++ b/src/test/java/com/rabbitmq/client/test/LongStringTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/MaxInboundMessageSizeTest.java b/src/test/java/com/rabbitmq/client/test/MaxInboundMessageSizeTest.java index da534d9c5f..a3577b957e 100644 --- a/src/test/java/com/rabbitmq/client/test/MaxInboundMessageSizeTest.java +++ b/src/test/java/com/rabbitmq/client/test/MaxInboundMessageSizeTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/MetricsCollectorTest.java b/src/test/java/com/rabbitmq/client/test/MetricsCollectorTest.java index 2286f6611a..de770fcb37 100644 --- a/src/test/java/com/rabbitmq/client/test/MetricsCollectorTest.java +++ b/src/test/java/com/rabbitmq/client/test/MetricsCollectorTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/MicrometerMetricsCollectorTest.java b/src/test/java/com/rabbitmq/client/test/MicrometerMetricsCollectorTest.java index 16c7fc12df..b55aff2486 100644 --- a/src/test/java/com/rabbitmq/client/test/MicrometerMetricsCollectorTest.java +++ b/src/test/java/com/rabbitmq/client/test/MicrometerMetricsCollectorTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/MultiThreadedChannel.java b/src/test/java/com/rabbitmq/client/test/MultiThreadedChannel.java index 7893ab056b..f7d185e44b 100644 --- a/src/test/java/com/rabbitmq/client/test/MultiThreadedChannel.java +++ b/src/test/java/com/rabbitmq/client/test/MultiThreadedChannel.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/NioDeadlockOnConnectionClosing.java b/src/test/java/com/rabbitmq/client/test/NioDeadlockOnConnectionClosing.java index 9ca7dd156a..1e97ac746e 100644 --- a/src/test/java/com/rabbitmq/client/test/NioDeadlockOnConnectionClosing.java +++ b/src/test/java/com/rabbitmq/client/test/NioDeadlockOnConnectionClosing.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/NoAutoRecoveryWhenTcpWindowIsFullTest.java b/src/test/java/com/rabbitmq/client/test/NoAutoRecoveryWhenTcpWindowIsFullTest.java index ea0bf72c74..2b0c934cf1 100644 --- a/src/test/java/com/rabbitmq/client/test/NoAutoRecoveryWhenTcpWindowIsFullTest.java +++ b/src/test/java/com/rabbitmq/client/test/NoAutoRecoveryWhenTcpWindowIsFullTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/PropertyFileInitialisationTest.java b/src/test/java/com/rabbitmq/client/test/PropertyFileInitialisationTest.java index 24d3f808d8..8279f1d24b 100644 --- a/src/test/java/com/rabbitmq/client/test/PropertyFileInitialisationTest.java +++ b/src/test/java/com/rabbitmq/client/test/PropertyFileInitialisationTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/QueueingConsumerTests.java b/src/test/java/com/rabbitmq/client/test/QueueingConsumerTests.java index 4a4793952f..d5fa0bbf89 100644 --- a/src/test/java/com/rabbitmq/client/test/QueueingConsumerTests.java +++ b/src/test/java/com/rabbitmq/client/test/QueueingConsumerTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/RecoveryAwareAMQConnectionFactoryTest.java b/src/test/java/com/rabbitmq/client/test/RecoveryAwareAMQConnectionFactoryTest.java index 2b40553778..2355ea2310 100644 --- a/src/test/java/com/rabbitmq/client/test/RecoveryAwareAMQConnectionFactoryTest.java +++ b/src/test/java/com/rabbitmq/client/test/RecoveryAwareAMQConnectionFactoryTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/RecoveryDelayHandlerTest.java b/src/test/java/com/rabbitmq/client/test/RecoveryDelayHandlerTest.java index 035b96191d..5d060effff 100644 --- a/src/test/java/com/rabbitmq/client/test/RecoveryDelayHandlerTest.java +++ b/src/test/java/com/rabbitmq/client/test/RecoveryDelayHandlerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/RefreshCredentialsTest.java b/src/test/java/com/rabbitmq/client/test/RefreshCredentialsTest.java index 8e32dbc6c3..a9901702ba 100644 --- a/src/test/java/com/rabbitmq/client/test/RefreshCredentialsTest.java +++ b/src/test/java/com/rabbitmq/client/test/RefreshCredentialsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/RpcTest.java b/src/test/java/com/rabbitmq/client/test/RpcTest.java index 5d95d0d448..f600709d19 100644 --- a/src/test/java/com/rabbitmq/client/test/RpcTest.java +++ b/src/test/java/com/rabbitmq/client/test/RpcTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/RpcTopologyRecordingTest.java b/src/test/java/com/rabbitmq/client/test/RpcTopologyRecordingTest.java index 249eeb3f1b..6b8828c807 100644 --- a/src/test/java/com/rabbitmq/client/test/RpcTopologyRecordingTest.java +++ b/src/test/java/com/rabbitmq/client/test/RpcTopologyRecordingTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/SharedThreadPoolTest.java b/src/test/java/com/rabbitmq/client/test/SharedThreadPoolTest.java index 0e8317b987..1e7a2526ec 100644 --- a/src/test/java/com/rabbitmq/client/test/SharedThreadPoolTest.java +++ b/src/test/java/com/rabbitmq/client/test/SharedThreadPoolTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/SslContextFactoryTest.java b/src/test/java/com/rabbitmq/client/test/SslContextFactoryTest.java index 69a3eee1e8..c207901502 100644 --- a/src/test/java/com/rabbitmq/client/test/SslContextFactoryTest.java +++ b/src/test/java/com/rabbitmq/client/test/SslContextFactoryTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/StrictExceptionHandlerTest.java b/src/test/java/com/rabbitmq/client/test/StrictExceptionHandlerTest.java index c2a3f28aa9..e51c1d42a0 100644 --- a/src/test/java/com/rabbitmq/client/test/StrictExceptionHandlerTest.java +++ b/src/test/java/com/rabbitmq/client/test/StrictExceptionHandlerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/TableTest.java b/src/test/java/com/rabbitmq/client/test/TableTest.java index be808fa262..8e7652960f 100644 --- a/src/test/java/com/rabbitmq/client/test/TableTest.java +++ b/src/test/java/com/rabbitmq/client/test/TableTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/TestUtils.java b/src/test/java/com/rabbitmq/client/test/TestUtils.java index ef63abc1b5..f6ab6282c3 100644 --- a/src/test/java/com/rabbitmq/client/test/TestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/TestUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/TestUtilsTest.java b/src/test/java/com/rabbitmq/client/test/TestUtilsTest.java index 897296938d..296930ad1c 100644 --- a/src/test/java/com/rabbitmq/client/test/TestUtilsTest.java +++ b/src/test/java/com/rabbitmq/client/test/TestUtilsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2017-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2017-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/TlsUtilsTest.java b/src/test/java/com/rabbitmq/client/test/TlsUtilsTest.java index 51a1b691e1..6fccaffd1f 100644 --- a/src/test/java/com/rabbitmq/client/test/TlsUtilsTest.java +++ b/src/test/java/com/rabbitmq/client/test/TlsUtilsTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/TrafficListenerTest.java b/src/test/java/com/rabbitmq/client/test/TrafficListenerTest.java index db8d021194..77225c3403 100644 --- a/src/test/java/com/rabbitmq/client/test/TrafficListenerTest.java +++ b/src/test/java/com/rabbitmq/client/test/TrafficListenerTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/TruncatedInputStreamTest.java b/src/test/java/com/rabbitmq/client/test/TruncatedInputStreamTest.java index 5d4a9d1273..4362ffa406 100644 --- a/src/test/java/com/rabbitmq/client/test/TruncatedInputStreamTest.java +++ b/src/test/java/com/rabbitmq/client/test/TruncatedInputStreamTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ValueOrExceptionTest.java b/src/test/java/com/rabbitmq/client/test/ValueOrExceptionTest.java index ac9a38b767..4536c1759f 100644 --- a/src/test/java/com/rabbitmq/client/test/ValueOrExceptionTest.java +++ b/src/test/java/com/rabbitmq/client/test/ValueOrExceptionTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/AbstractRejectTest.java b/src/test/java/com/rabbitmq/client/test/functional/AbstractRejectTest.java index 82b8b78035..2e4ae9b5b6 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/AbstractRejectTest.java +++ b/src/test/java/com/rabbitmq/client/test/functional/AbstractRejectTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/AlternateExchange.java b/src/test/java/com/rabbitmq/client/test/functional/AlternateExchange.java index 816d9f70f5..5ed6561757 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/AlternateExchange.java +++ b/src/test/java/com/rabbitmq/client/test/functional/AlternateExchange.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/BasicGet.java b/src/test/java/com/rabbitmq/client/test/functional/BasicGet.java index 0956e8cc35..e8929be413 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/BasicGet.java +++ b/src/test/java/com/rabbitmq/client/test/functional/BasicGet.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycle.java b/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycle.java index a478748a7d..6e23ce0233 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycle.java +++ b/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycle.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycleBase.java b/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycleBase.java index c3b7995c27..9314c3566a 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycleBase.java +++ b/src/test/java/com/rabbitmq/client/test/functional/BindingLifecycleBase.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/CcRoutes.java b/src/test/java/com/rabbitmq/client/test/functional/CcRoutes.java index b65d2ad740..e11e63514d 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/CcRoutes.java +++ b/src/test/java/com/rabbitmq/client/test/functional/CcRoutes.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ClusteredTestBase.java b/src/test/java/com/rabbitmq/client/test/functional/ClusteredTestBase.java index 2580ed0daf..c55e64a8ca 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ClusteredTestBase.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ClusteredTestBase.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Confirm.java b/src/test/java/com/rabbitmq/client/test/functional/Confirm.java index 0dbf5950c8..7a374623db 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Confirm.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Confirm.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ConnectionOpen.java b/src/test/java/com/rabbitmq/client/test/functional/ConnectionOpen.java index 646f9e054d..44e4dba063 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ConnectionOpen.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ConnectionOpen.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ConnectionRecovery.java b/src/test/java/com/rabbitmq/client/test/functional/ConnectionRecovery.java index 0f9ff4a055..8dfb268ae5 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ConnectionRecovery.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ConnectionRecovery.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ConsumerCancelNotification.java b/src/test/java/com/rabbitmq/client/test/functional/ConsumerCancelNotification.java index 7d8631a100..e7f32dedbe 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ConsumerCancelNotification.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ConsumerCancelNotification.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ConsumerCount.java b/src/test/java/com/rabbitmq/client/test/functional/ConsumerCount.java index eca4b57c48..f6f89fbfeb 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ConsumerCount.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ConsumerCount.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ConsumerPriorities.java b/src/test/java/com/rabbitmq/client/test/functional/ConsumerPriorities.java index db0ebc1212..af52b6101c 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ConsumerPriorities.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ConsumerPriorities.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java b/src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java index d0e8bee231..86ddf898e1 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java +++ b/src/test/java/com/rabbitmq/client/test/functional/DeadLetterExchange.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/DefaultExchange.java b/src/test/java/com/rabbitmq/client/test/functional/DefaultExchange.java index 72c2793f9b..42de69e827 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/DefaultExchange.java +++ b/src/test/java/com/rabbitmq/client/test/functional/DefaultExchange.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/DirectReplyTo.java b/src/test/java/com/rabbitmq/client/test/functional/DirectReplyTo.java index 84911f447c..34e1d39043 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/DirectReplyTo.java +++ b/src/test/java/com/rabbitmq/client/test/functional/DirectReplyTo.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/DoubleDeletion.java b/src/test/java/com/rabbitmq/client/test/functional/DoubleDeletion.java index c28bab794c..cb7a66f3ee 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/DoubleDeletion.java +++ b/src/test/java/com/rabbitmq/client/test/functional/DoubleDeletion.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/DurableOnTransient.java b/src/test/java/com/rabbitmq/client/test/functional/DurableOnTransient.java index 3732ff55ac..06c788da12 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/DurableOnTransient.java +++ b/src/test/java/com/rabbitmq/client/test/functional/DurableOnTransient.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExceptionHandling.java b/src/test/java/com/rabbitmq/client/test/functional/ExceptionHandling.java index 700a6dda52..2ac07f2341 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExceptionHandling.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExceptionHandling.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExceptionMessages.java b/src/test/java/com/rabbitmq/client/test/functional/ExceptionMessages.java index 672db4dfa8..a7957afbc9 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExceptionMessages.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExceptionMessages.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeclare.java b/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeclare.java index b6976ee873..12900c448e 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeclare.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeclare.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeleteIfUnused.java b/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeleteIfUnused.java index 299d95567f..dfe6fac6d8 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeleteIfUnused.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeleteIfUnused.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeletePredeclared.java b/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeletePredeclared.java index 4229c888ed..86234cf02e 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeletePredeclared.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExchangeDeletePredeclared.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExchangeEquivalenceBase.java b/src/test/java/com/rabbitmq/client/test/functional/ExchangeEquivalenceBase.java index cfeed037d4..7966cf2d3f 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExchangeEquivalenceBase.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExchangeEquivalenceBase.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindings.java b/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindings.java index 3416b334d6..ff55b0024a 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindings.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindings.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindingsAutoDelete.java b/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindingsAutoDelete.java index a6f01e20c4..6a3b191cf7 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindingsAutoDelete.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ExchangeExchangeBindingsAutoDelete.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/FrameMax.java b/src/test/java/com/rabbitmq/client/test/functional/FrameMax.java index bafceed32d..4ca81aebc6 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/FrameMax.java +++ b/src/test/java/com/rabbitmq/client/test/functional/FrameMax.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java b/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java index ec06db3553..650e9f2333 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java +++ b/src/test/java/com/rabbitmq/client/test/functional/FunctionalTestSuite.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java b/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java index 49b0779c8c..c0c1fc0007 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java +++ b/src/test/java/com/rabbitmq/client/test/functional/HeadersExchangeValidation.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Heartbeat.java b/src/test/java/com/rabbitmq/client/test/functional/Heartbeat.java index 002c60b487..9a327e2ff8 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Heartbeat.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Heartbeat.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/InternalExchange.java b/src/test/java/com/rabbitmq/client/test/functional/InternalExchange.java index 12bfc7c76d..b9eb3554c9 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/InternalExchange.java +++ b/src/test/java/com/rabbitmq/client/test/functional/InternalExchange.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/InvalidAcks.java b/src/test/java/com/rabbitmq/client/test/functional/InvalidAcks.java index 08dc083f6f..3041412e9f 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/InvalidAcks.java +++ b/src/test/java/com/rabbitmq/client/test/functional/InvalidAcks.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksBase.java b/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksBase.java index f24e848c63..1c8b6aad21 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksBase.java +++ b/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksBase.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksTx.java b/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksTx.java index 2df62e23ed..e02e8baca3 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksTx.java +++ b/src/test/java/com/rabbitmq/client/test/functional/InvalidAcksTx.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/MessageCount.java b/src/test/java/com/rabbitmq/client/test/functional/MessageCount.java index 8ccef02846..8b0c062d29 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MessageCount.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MessageCount.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Metrics.java b/src/test/java/com/rabbitmq/client/test/functional/Metrics.java index 0c745ebdff..1fa094b583 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Metrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Metrics.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index 36de057b90..c1cd52a2f4 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Nack.java b/src/test/java/com/rabbitmq/client/test/functional/Nack.java index 6bd47e6067..1ec01c2e91 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Nack.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Nack.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/NoRequeueOnCancel.java b/src/test/java/com/rabbitmq/client/test/functional/NoRequeueOnCancel.java index f93f8f591b..7c02a13010 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/NoRequeueOnCancel.java +++ b/src/test/java/com/rabbitmq/client/test/functional/NoRequeueOnCancel.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Nowait.java b/src/test/java/com/rabbitmq/client/test/functional/Nowait.java index b795f02482..ef460f228b 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Nowait.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Nowait.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/PerConsumerPrefetch.java b/src/test/java/com/rabbitmq/client/test/functional/PerConsumerPrefetch.java index 51149c613f..83e0191538 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/PerConsumerPrefetch.java +++ b/src/test/java/com/rabbitmq/client/test/functional/PerConsumerPrefetch.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/PerMessageTTL.java b/src/test/java/com/rabbitmq/client/test/functional/PerMessageTTL.java index 2b6bb3ed99..0f029a3e72 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/PerMessageTTL.java +++ b/src/test/java/com/rabbitmq/client/test/functional/PerMessageTTL.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/PerQueueTTL.java b/src/test/java/com/rabbitmq/client/test/functional/PerQueueTTL.java index 177a67cd58..a7c273d63f 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/PerQueueTTL.java +++ b/src/test/java/com/rabbitmq/client/test/functional/PerQueueTTL.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/PerQueueVsPerMessageTTL.java b/src/test/java/com/rabbitmq/client/test/functional/PerQueueVsPerMessageTTL.java index e835b42c0f..a2aae0a866 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/PerQueueVsPerMessageTTL.java +++ b/src/test/java/com/rabbitmq/client/test/functional/PerQueueVsPerMessageTTL.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Policies.java b/src/test/java/com/rabbitmq/client/test/functional/Policies.java index 602e2b57c4..016bc35320 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Policies.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Policies.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/QosTests.java b/src/test/java/com/rabbitmq/client/test/functional/QosTests.java index b14d5526c3..88a0438ab2 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/QosTests.java +++ b/src/test/java/com/rabbitmq/client/test/functional/QosTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/QueueExclusivity.java b/src/test/java/com/rabbitmq/client/test/functional/QueueExclusivity.java index 83df293a10..bf0c0a02c4 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/QueueExclusivity.java +++ b/src/test/java/com/rabbitmq/client/test/functional/QueueExclusivity.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/QueueLease.java b/src/test/java/com/rabbitmq/client/test/functional/QueueLease.java index 46a31f8b3e..0a17992fdf 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/QueueLease.java +++ b/src/test/java/com/rabbitmq/client/test/functional/QueueLease.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/QueueLifecycle.java b/src/test/java/com/rabbitmq/client/test/functional/QueueLifecycle.java index ceedb520ad..95646fc1e4 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/QueueLifecycle.java +++ b/src/test/java/com/rabbitmq/client/test/functional/QueueLifecycle.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/QueueSizeLimit.java b/src/test/java/com/rabbitmq/client/test/functional/QueueSizeLimit.java index c0c9350173..247b441aaf 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/QueueSizeLimit.java +++ b/src/test/java/com/rabbitmq/client/test/functional/QueueSizeLimit.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Recover.java b/src/test/java/com/rabbitmq/client/test/functional/Recover.java index a83c75c9ca..ec606c28e5 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Recover.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Recover.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Reject.java b/src/test/java/com/rabbitmq/client/test/functional/Reject.java index b8abaf0779..b680e92583 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Reject.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Reject.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/RequeueOnChannelClose.java b/src/test/java/com/rabbitmq/client/test/functional/RequeueOnChannelClose.java index 250b74acf0..58f01861d5 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/RequeueOnChannelClose.java +++ b/src/test/java/com/rabbitmq/client/test/functional/RequeueOnChannelClose.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/RequeueOnClose.java b/src/test/java/com/rabbitmq/client/test/functional/RequeueOnClose.java index 7fee64f715..76696a0a1c 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/RequeueOnClose.java +++ b/src/test/java/com/rabbitmq/client/test/functional/RequeueOnClose.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/RequeueOnConnectionClose.java b/src/test/java/com/rabbitmq/client/test/functional/RequeueOnConnectionClose.java index 126c1bd71a..9cc984e59c 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/RequeueOnConnectionClose.java +++ b/src/test/java/com/rabbitmq/client/test/functional/RequeueOnConnectionClose.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Routing.java b/src/test/java/com/rabbitmq/client/test/functional/Routing.java index eb04306b8c..de201bc739 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Routing.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Routing.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/SaslMechanisms.java b/src/test/java/com/rabbitmq/client/test/functional/SaslMechanisms.java index c40718f732..193a53a8cb 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/SaslMechanisms.java +++ b/src/test/java/com/rabbitmq/client/test/functional/SaslMechanisms.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/TTLHandling.java b/src/test/java/com/rabbitmq/client/test/functional/TTLHandling.java index 8d50b7e059..8f08c0bbd8 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/TTLHandling.java +++ b/src/test/java/com/rabbitmq/client/test/functional/TTLHandling.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Tables.java b/src/test/java/com/rabbitmq/client/test/functional/Tables.java index a1e405c7f8..0360b68690 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Tables.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Tables.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryFiltering.java b/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryFiltering.java index 1af68242b4..8edd432a67 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryFiltering.java +++ b/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryFiltering.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryRetry.java b/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryRetry.java index 91a777ad1b..f27cc03872 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryRetry.java +++ b/src/test/java/com/rabbitmq/client/test/functional/TopologyRecoveryRetry.java @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2018-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/Transactions.java b/src/test/java/com/rabbitmq/client/test/functional/Transactions.java index 1de0cc56ce..8c2c382439 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Transactions.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Transactions.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/UnbindAutoDeleteExchange.java b/src/test/java/com/rabbitmq/client/test/functional/UnbindAutoDeleteExchange.java index 08e0b8fbac..08510bc856 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/UnbindAutoDeleteExchange.java +++ b/src/test/java/com/rabbitmq/client/test/functional/UnbindAutoDeleteExchange.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/UnexpectedFrames.java b/src/test/java/com/rabbitmq/client/test/functional/UnexpectedFrames.java index fd36d11026..28e4c92365 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/UnexpectedFrames.java +++ b/src/test/java/com/rabbitmq/client/test/functional/UnexpectedFrames.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/UserIDHeader.java b/src/test/java/com/rabbitmq/client/test/functional/UserIDHeader.java index 1f0383fbde..35a1a391af 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/UserIDHeader.java +++ b/src/test/java/com/rabbitmq/client/test/functional/UserIDHeader.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java b/src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java index e304a71db6..d0296d8552 100644 --- a/src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java +++ b/src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/AlternateExchangeEquivalence.java b/src/test/java/com/rabbitmq/client/test/server/AlternateExchangeEquivalence.java index a978d06a48..e7b8f775a0 100644 --- a/src/test/java/com/rabbitmq/client/test/server/AlternateExchangeEquivalence.java +++ b/src/test/java/com/rabbitmq/client/test/server/AlternateExchangeEquivalence.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/BlockedConnection.java b/src/test/java/com/rabbitmq/client/test/server/BlockedConnection.java index a80b12387d..cc8be03e08 100644 --- a/src/test/java/com/rabbitmq/client/test/server/BlockedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/server/BlockedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/Bug19219Test.java b/src/test/java/com/rabbitmq/client/test/server/Bug19219Test.java index 2506ef075a..3bdb8113d2 100644 --- a/src/test/java/com/rabbitmq/client/test/server/Bug19219Test.java +++ b/src/test/java/com/rabbitmq/client/test/server/Bug19219Test.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/ChannelLimitNegotiation.java b/src/test/java/com/rabbitmq/client/test/server/ChannelLimitNegotiation.java index a008c5b44d..41dff0f2d4 100644 --- a/src/test/java/com/rabbitmq/client/test/server/ChannelLimitNegotiation.java +++ b/src/test/java/com/rabbitmq/client/test/server/ChannelLimitNegotiation.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java b/src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java index f280408fa8..3b754c88e2 100644 --- a/src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java +++ b/src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/DurableBindingLifecycle.java b/src/test/java/com/rabbitmq/client/test/server/DurableBindingLifecycle.java index 0b5d19d529..7627b50c2f 100644 --- a/src/test/java/com/rabbitmq/client/test/server/DurableBindingLifecycle.java +++ b/src/test/java/com/rabbitmq/client/test/server/DurableBindingLifecycle.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java b/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java index db5d63ef7a..31e2b898ec 100644 --- a/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java +++ b/src/test/java/com/rabbitmq/client/test/server/EffectVisibilityCrossNodeTest.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/ExclusiveQueueDurability.java b/src/test/java/com/rabbitmq/client/test/server/ExclusiveQueueDurability.java index 6671be803c..6d0dba8886 100644 --- a/src/test/java/com/rabbitmq/client/test/server/ExclusiveQueueDurability.java +++ b/src/test/java/com/rabbitmq/client/test/server/ExclusiveQueueDurability.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/Firehose.java b/src/test/java/com/rabbitmq/client/test/server/Firehose.java index 63389b5384..062f66b2c7 100644 --- a/src/test/java/com/rabbitmq/client/test/server/Firehose.java +++ b/src/test/java/com/rabbitmq/client/test/server/Firehose.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/HaTestSuite.java b/src/test/java/com/rabbitmq/client/test/server/HaTestSuite.java index 12f88c6612..edd51680ae 100644 --- a/src/test/java/com/rabbitmq/client/test/server/HaTestSuite.java +++ b/src/test/java/com/rabbitmq/client/test/server/HaTestSuite.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/LastHaTestSuite.java b/src/test/java/com/rabbitmq/client/test/server/LastHaTestSuite.java index 12aa495ae0..b42262feb6 100644 --- a/src/test/java/com/rabbitmq/client/test/server/LastHaTestSuite.java +++ b/src/test/java/com/rabbitmq/client/test/server/LastHaTestSuite.java @@ -1,4 +1,4 @@ -// Copyright (c) 2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/LoopbackUsers.java b/src/test/java/com/rabbitmq/client/test/server/LoopbackUsers.java index e758b65c9e..813e4d23f5 100644 --- a/src/test/java/com/rabbitmq/client/test/server/LoopbackUsers.java +++ b/src/test/java/com/rabbitmq/client/test/server/LoopbackUsers.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/MemoryAlarms.java b/src/test/java/com/rabbitmq/client/test/server/MemoryAlarms.java index d6be4534de..db87bbfb99 100644 --- a/src/test/java/com/rabbitmq/client/test/server/MemoryAlarms.java +++ b/src/test/java/com/rabbitmq/client/test/server/MemoryAlarms.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java b/src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java index c17ef018c9..791e7e0082 100644 --- a/src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java +++ b/src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/Permissions.java b/src/test/java/com/rabbitmq/client/test/server/Permissions.java index 2204f9c9ce..bf3edccaf0 100644 --- a/src/test/java/com/rabbitmq/client/test/server/Permissions.java +++ b/src/test/java/com/rabbitmq/client/test/server/Permissions.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/PersistenceGuarantees.java b/src/test/java/com/rabbitmq/client/test/server/PersistenceGuarantees.java index e0547ca786..126130f54d 100644 --- a/src/test/java/com/rabbitmq/client/test/server/PersistenceGuarantees.java +++ b/src/test/java/com/rabbitmq/client/test/server/PersistenceGuarantees.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/PriorityQueues.java b/src/test/java/com/rabbitmq/client/test/server/PriorityQueues.java index 1fba1684d7..ff6ce04e3a 100644 --- a/src/test/java/com/rabbitmq/client/test/server/PriorityQueues.java +++ b/src/test/java/com/rabbitmq/client/test/server/PriorityQueues.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/ServerTestSuite.java b/src/test/java/com/rabbitmq/client/test/server/ServerTestSuite.java index c850a31faf..64a1499eb0 100644 --- a/src/test/java/com/rabbitmq/client/test/server/ServerTestSuite.java +++ b/src/test/java/com/rabbitmq/client/test/server/ServerTestSuite.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/Shutdown.java b/src/test/java/com/rabbitmq/client/test/server/Shutdown.java index 9e861bdc9e..9d731853a0 100644 --- a/src/test/java/com/rabbitmq/client/test/server/Shutdown.java +++ b/src/test/java/com/rabbitmq/client/test/server/Shutdown.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/TopicPermissions.java b/src/test/java/com/rabbitmq/client/test/server/TopicPermissions.java index d48f6ea952..0af9ae9aca 100644 --- a/src/test/java/com/rabbitmq/client/test/server/TopicPermissions.java +++ b/src/test/java/com/rabbitmq/client/test/server/TopicPermissions.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/server/XDeathHeaderGrowth.java b/src/test/java/com/rabbitmq/client/test/server/XDeathHeaderGrowth.java index d0898f0210..9d23040fe9 100644 --- a/src/test/java/com/rabbitmq/client/test/server/XDeathHeaderGrowth.java +++ b/src/test/java/com/rabbitmq/client/test/server/XDeathHeaderGrowth.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ssl/BadVerifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/BadVerifiedConnection.java index 748bb9f883..ca71ea4c0f 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/BadVerifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/BadVerifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ssl/ConnectionFactoryDefaultTlsVersion.java b/src/test/java/com/rabbitmq/client/test/ssl/ConnectionFactoryDefaultTlsVersion.java index 1a03a02420..a09f1debdd 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/ConnectionFactoryDefaultTlsVersion.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/ConnectionFactoryDefaultTlsVersion.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java b/src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java index f8febe4614..efdfcb57d6 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/HostnameVerification.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java index 884ca4db9a..63e4d77be5 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/NioTlsUnverifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ssl/SslTestSuite.java b/src/test/java/com/rabbitmq/client/test/ssl/SslTestSuite.java index 05160db0f9..868b1e26bb 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/SslTestSuite.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/SslTestSuite.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ssl/TlsConnectionLogging.java b/src/test/java/com/rabbitmq/client/test/ssl/TlsConnectionLogging.java index 81360a3815..8b388b9492 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/TlsConnectionLogging.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/TlsConnectionLogging.java @@ -1,4 +1,4 @@ -// Copyright (c) 2019-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2019-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java b/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java index 51702c4a6e..65815d4222 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java @@ -1,4 +1,4 @@ -// Copyright (c) 2021 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ssl/UnverifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/UnverifiedConnection.java index 5a0af90463..3cf2a15b79 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/UnverifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/UnverifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java b/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java index e53a83b2f0..179f2d18b6 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/VerifiedConnection.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/tools/Host.java b/src/test/java/com/rabbitmq/tools/Host.java index 8e950cb27e..96cf6b0dac 100644 --- a/src/test/java/com/rabbitmq/tools/Host.java +++ b/src/test/java/com/rabbitmq/tools/Host.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/utility/IntAllocatorTests.java b/src/test/java/com/rabbitmq/utility/IntAllocatorTests.java index 5e468a60e3..fb8800ecd3 100644 --- a/src/test/java/com/rabbitmq/utility/IntAllocatorTests.java +++ b/src/test/java/com/rabbitmq/utility/IntAllocatorTests.java @@ -1,4 +1,4 @@ -// Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved. +// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 From 498bc5231361bad8cca84f9a2b7c70c74df6f070 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Sat, 25 Nov 2023 09:05:16 -0500 Subject: [PATCH 370/657] Merge branch 'JHahnHRO-main' (cherry picked from commit 4b1f07c151de5b77db4ef449f56237e86d264f7e) --- src/main/java/com/rabbitmq/client/RpcClient.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/client/RpcClient.java b/src/main/java/com/rabbitmq/client/RpcClient.java index 723445e961..db234aa0f1 100644 --- a/src/main/java/com/rabbitmq/client/RpcClient.java +++ b/src/main/java/com/rabbitmq/client/RpcClient.java @@ -93,6 +93,7 @@ public class RpcClient implements AutoCloseable { * @since 5.9.0 */ private final Supplier _correlationIdSupplier; + private final ReturnListener _returnListener; private String lastCorrelationId = "0"; @@ -123,7 +124,7 @@ public RpcClient(RpcClientParams params) throws _consumer = setupConsumer(); if (_useMandatory) { - this._channel.addReturnListener(returnMessage -> { + this._returnListener = this._channel.addReturnListener(returnMessage -> { synchronized (_continuationMap) { String replyId = returnMessage.getProperties().getCorrelationId(); BlockingCell blocker = _continuationMap.remove(replyId); @@ -136,6 +137,8 @@ public RpcClient(RpcClientParams params) throws } } }); + } else { + this._returnListener = null; } } @@ -242,6 +245,9 @@ private void checkNotClosed() throws IOException { public void close() throws IOException { if (this.closed.compareAndSet(false, true)) { _channel.basicCancel(_consumer.getConsumerTag()); + if (this._returnListener != null) { + _channel.removeReturnListener(this._returnListener); + } } } From 3556a8b40e74a140225c8ae885f52e75c3b8552e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 00:54:05 +0000 Subject: [PATCH 371/657] Bump org.codehaus.mojo:build-helper-maven-plugin from 3.4.0 to 3.5.0 Bumps [org.codehaus.mojo:build-helper-maven-plugin](https://github.com/mojohaus/build-helper-maven-plugin) from 3.4.0 to 3.5.0. - [Release notes](https://github.com/mojohaus/build-helper-maven-plugin/releases) - [Commits](https://github.com/mojohaus/build-helper-maven-plugin/compare/3.4.0...3.5.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:build-helper-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 fa91f90019..b28dd72db9 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ 2.1.1 2.4.21 1.7 - 3.4.0 + 3.5.0 3.11.0 3.2.2 3.2.2 From cb3a2c0514432f993dcb6ba6195a75cd9de0ff82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Nov 2023 00:54:56 +0000 Subject: [PATCH 372/657] Bump com.diffplug.spotless:spotless-maven-plugin from 2.40.0 to 2.41.0 Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 2.40.0 to 2.41.0. - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](https://github.com/diffplug/spotless/compare/lib/2.40.0...lib/2.41.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 b28dd72db9..e93aec7ee3 100644 --- a/pom.xml +++ b/pom.xml @@ -91,7 +91,7 @@ 1.6.13 1.11 1.4 - 2.40.0 + 2.41.0 1.17.0 - // 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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java index 7b37cd32a0..ae1cd7a4e0 100644 --- a/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/NoOpObservationCollector.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java index 04c452f8fe..700d685064 100644 --- a/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/ObservationCollector.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java index d32f9be01c..4ff4f62774 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultDeliverObservationConvention.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultProcessObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultProcessObservationConvention.java index 45201f9ea4..66aa613832 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultProcessObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultProcessObservationConvention.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java index 199b3df1e0..8bb7e9b580 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultPublishObservationConvention.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultReceiveObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultReceiveObservationConvention.java index e1928b8ee5..751f3c6e02 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultReceiveObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DefaultReceiveObservationConvention.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java index e838d302e5..6e43eb6ebb 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverContext.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java index d57f035fd5..422dafe546 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/DeliverObservationConvention.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java index 74a2071dc7..44e2fc4522 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollector.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java index 9e775d108f..1cc26ceb53 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/MicrometerObservationCollectorBuilder.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java index 146e8ee058..01362f7310 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishContext.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java index 8f8fc60e89..ee81671c6c 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/PublishObservationConvention.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java index d88d7033c6..9612a41d62 100644 --- a/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java +++ b/src/main/java/com/rabbitmq/client/observation/micrometer/RabbitMqObservationDocumentation.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 diff --git a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java index c1cd52a2f4..5a6020b779 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java +++ b/src/test/java/com/rabbitmq/client/test/functional/MicrometerObservationCollectorMetrics.java @@ -1,4 +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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 From 8f980bd9f0321a15d0a3742e44685d862dc0ca4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 00:55:17 +0000 Subject: [PATCH 406/657] 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 6521935ffc..2811749682 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ true 1.7.36 - 4.2.24 + 4.2.25 1.12.2 1.1.4 1.34.1 From e2c72faa652d3ea113db8f92abd5cf2da5befde2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 00:55:30 +0000 Subject: [PATCH 407/657] 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 6521935ffc..b7ea988b1f 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 2.16.1 1.2.13 5.10.1 - 5.9.0 + 5.10.0 3.25.1 1.2.2 1.0.2 From 1aba80296be18688513e3165a9b4c855ba5626f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 01:44:18 +0000 Subject: [PATCH 408/657] 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 e1db89f28c..ddedd4bb05 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 1.2.13 5.10.1 5.10.0 - 3.25.1 + 3.25.2 1.2.2 1.0.2 9.4.53.v20231009 From 864d0e17b9529657ce50ea4f7682ee50610ac98b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 00:40:53 +0000 Subject: [PATCH 409/657] 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 ddedd4bb05..334a499f4a 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 1.2.13 5.10.1 5.10.0 - 3.25.2 + 3.25.3 1.2.2 1.0.2 9.4.53.v20231009 From 2107c7555496aff5ba5826753474b60be8a473b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 00:41:10 +0000 Subject: [PATCH 410/657] 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 ddedd4bb05..a665227902 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 1.34.1 2.16.1 1.2.13 - 5.10.1 + 5.10.2 5.10.0 3.25.2 1.2.2 From 380e7d8f079af3b86a3b41077c4df373868472c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 5 Feb 2024 14:18:21 +0100 Subject: [PATCH 411/657] Bump Bouncy Castle (test) (cherry picked from commit b029fcdaf10f17546a15351881719b71f0dcdeed) --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e5a64d0590..0e70e0cb62 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 1.2.2 1.0.2 9.4.53.v20231009 - 1.70 + 1.77 0.10 2.10.1 @@ -778,7 +778,7 @@ org.bouncycastle - bcpkix-jdk15on + bcpkix-jdk18on ${bouncycastle.version} test From d4bea49ca2ac4eaa4c2d61d4a23943e5de4578d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 00:53:58 +0000 Subject: [PATCH 412/657] Bump opentelemetry.version from 1.34.1 to 1.35.0 Bumps `opentelemetry.version` from 1.34.1 to 1.35.0. Updates `io.opentelemetry:opentelemetry-api` from 1.34.1 to 1.35.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.34.1...v1.35.0) Updates `io.opentelemetry:opentelemetry-sdk-testing` from 1.34.1 to 1.35.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.34.1...v1.35.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 0e70e0cb62..5b47cd17f2 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 4.2.25 1.12.2 1.1.4 - 1.34.1 + 1.35.0 2.16.1 1.2.13 5.10.2 From 958bf7e3d03a5c40492316c69ac0422bef44b086 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 00:41:10 +0000 Subject: [PATCH 413/657] 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 5b47cd17f2..8df4e435c4 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 5.10.2 5.10.0 3.25.3 - 1.2.2 + 1.2.3 1.0.2 9.4.53.v20231009 1.77 From 8427fddc7dc4ae3aae53f391ae6116f56c2b4495 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 00:41:21 +0000 Subject: [PATCH 414/657] 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 5b47cd17f2..ba8bb82a68 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ true 1.7.36 4.2.25 - 1.12.2 + 1.12.3 1.1.4 1.35.0 2.16.1 From ef49a2b38d90ef5cf8c333313791b45f5eb99fbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Feb 2024 00:44:49 +0000 Subject: [PATCH 415/657] Bump org.eclipse.jetty:jetty-servlet Bumps org.eclipse.jetty:jetty-servlet from 9.4.53.v20231009 to 9.4.54.v20240208. --- updated-dependencies: - dependency-name: org.eclipse.jetty:jetty-servlet 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 57de309495..6a04b1f11c 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,7 @@ 3.25.3 1.2.3 1.0.2 - 9.4.53.v20231009 + 9.4.54.v20240208 1.77 0.10 2.10.1 From df381e4a673e1ca7621bf2f1607fd670a494f403 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 26 Feb 2024 10:16:23 +0100 Subject: [PATCH 416/657] Use RabbitMQ 3.13 in test suite (cherry picked from commit ba8479f985cf7d36e18043ca15f0de5c4ebc7513) --- .github/workflows/test-rabbitmq-alphas.yml | 2 +- ci/start-broker.sh | 2 +- ci/start-cluster.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index 18faeab78f..ebe00eb546 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -16,7 +16,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 f3060b49c9..746bcc56c9 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"; diff --git a/ci/start-cluster.sh b/ci/start-cluster.sh index c50b70ef64..5209a1da67 100755 --- a/ci/start-cluster.sh +++ b/ci/start-cluster.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 b40c783e4720b8713e7a3632247df924a9e9060b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 26 Feb 2024 10:22:58 +0100 Subject: [PATCH 417/657] Fix workflow name (cherry picked from commit e8b84c710c9284bb685af62ed577c707c2741856) --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ea32d1d299..0812619a84 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: pull_request: From bb7bc4cdfc690543d441c9d0f2ff4802c0e02534 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 01:16:41 +0000 Subject: [PATCH 418/657] 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 6a04b1f11c..27ab348ff9 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 2.16.1 1.2.13 5.10.2 - 5.10.0 + 5.11.0 3.25.3 1.2.3 1.0.2 From 0621ecd97ef240c2fe36a96c15afae2e168b0380 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 00:33:33 +0000 Subject: [PATCH 419/657] Bump opentelemetry.version from 1.35.0 to 1.36.0 Bumps `opentelemetry.version` from 1.35.0 to 1.36.0. Updates `io.opentelemetry:opentelemetry-api` from 1.35.0 to 1.36.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.35.0...v1.36.0) Updates `io.opentelemetry:opentelemetry-sdk-testing` from 1.35.0 to 1.36.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.35.0...v1.36.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 27ab348ff9..aacb4c7f52 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 4.2.25 1.12.3 1.1.4 - 1.35.0 + 1.36.0 2.16.1 1.2.13 5.10.2 From aec914e92437abf7c1b1e8a42a8908854506c51f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Mar 2024 07:44:31 +0000 Subject: [PATCH 420/657] Bump com.fasterxml.jackson.core:jackson-databind from 2.16.1 to 2.16.2 Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) from 2.16.1 to 2.16.2. - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind 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 aacb4c7f52..c0d416f1dd 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.12.3 1.1.4 1.36.0 - 2.16.1 + 2.16.2 1.2.13 5.10.2 5.11.0 From 221aed2f7e93af808a1afdb0aad15925211dad09 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 00:40:03 +0000 Subject: [PATCH 421/657] 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 c0d416f1dd..4180dd1550 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ true 1.7.36 4.2.25 - 1.12.3 + 1.12.4 1.1.4 1.36.0 2.16.2 From 288c848e9affde9fc60eed4f77603ec8b4d2429e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 00:40:13 +0000 Subject: [PATCH 422/657] 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 c0d416f1dd..e924c26a39 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.12.1 3.2.5 3.2.5 - 3.1.0 + 3.2.0 3.3.0 5.1.9 0.0.6 From c4358a00b53db82614877a24b8c333d78bc7e577 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 00:03:55 +0000 Subject: [PATCH 423/657] Bump com.fasterxml.jackson.core:jackson-databind from 2.16.2 to 2.17.0 Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) from 2.16.2 to 2.17.0. - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind 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 b9598b76c5..5c6333eb83 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.12.4 1.1.4 1.36.0 - 2.16.2 + 2.17.0 1.2.13 5.10.2 5.11.0 From 667259bbeb4fbe57e199875c654c153ea2cd42bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 00:04:02 +0000 Subject: [PATCH 424/657] 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 b9598b76c5..bd8cc6de1d 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 5.10.2 5.11.0 3.25.3 - 1.2.3 + 1.2.4 1.0.2 9.4.54.v20240208 1.77 From 7f166f4329ee3b2ac9f7cb601360775e7916eacc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 00:31:13 +0000 Subject: [PATCH 425/657] Bump org.sonarsource.scanner.maven:sonar-maven-plugin Bumps [org.sonarsource.scanner.maven:sonar-maven-plugin](https://github.com/SonarSource/sonar-scanner-maven) from 3.10.0.2594 to 3.11.0.3922. - [Release notes](https://github.com/SonarSource/sonar-scanner-maven/releases) - [Commits](https://github.com/SonarSource/sonar-scanner-maven/compare/3.10.0.2594...3.11.0.3922) --- updated-dependencies: - dependency-name: org.sonarsource.scanner.maven:sonar-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 b2d17c75b8..a7b3d2f268 100644 --- a/pom.xml +++ b/pom.xml @@ -835,7 +835,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.10.0.2594 + 3.11.0.3922 From 3d4a0d76a951f682c594fbf6fee63de3a6db6d93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 00:24:17 +0000 Subject: [PATCH 426/657] 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 a7b3d2f268..c74dfc85bf 100644 --- a/pom.xml +++ b/pom.xml @@ -81,7 +81,7 @@ 2.4.21 1.7 3.5.0 - 3.12.1 + 3.13.0 3.2.5 3.2.5 3.2.0 From 325caee75e21ab4838b257637ff4ca230805b754 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 00:24:21 +0000 Subject: [PATCH 427/657] 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 a7b3d2f268..2dc6f073a8 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.12.1 3.2.5 3.2.5 - 3.2.0 + 3.2.1 3.3.0 5.1.9 0.0.6 From 02f7c57a54c2ecf72386f18be6a636cf0cffb432 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 00:34:44 +0000 Subject: [PATCH 428/657] 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 3088c34d1f..96e8a5bba2 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.13.0 3.2.5 3.2.5 - 3.2.1 + 3.2.2 3.3.0 5.1.9 0.0.6 From 4b55c44dc7fe0abc32a840152685f23670a09814 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 00:57:52 +0000 Subject: [PATCH 429/657] 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 96e8a5bba2..57cff63b91 100644 --- a/pom.xml +++ b/pom.xml @@ -76,7 +76,7 @@ 3.0.1 2.16.2 3.3.1 - 3.3.0 + 3.3.1 2.1.1 2.4.21 1.7 From 3caf7735cf3c93fb1048f9ffe9f54d1cc66fb7b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 5 Apr 2024 10:38:54 +0200 Subject: [PATCH 430/657] Update tag name for broker alphas No more OTP variant. (cherry picked from commit 07d9bfd6abe1925170ef210411917a7ba2fb2f5f) --- .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 ebe00eb546..3303ecdb04 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -16,7 +16,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 d816bcfb07365ee5ddeeab9b7e29656dbd0aef0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 01:11:11 +0000 Subject: [PATCH 431/657] Bump org.bouncycastle:bcpkix-jdk18on from 1.77 to 1.78 Bumps [org.bouncycastle:bcpkix-jdk18on](https://github.com/bcgit/bc-java) from 1.77 to 1.78. - [Changelog](https://github.com/bcgit/bc-java/blob/main/docs/releasenotes.html) - [Commits](https://github.com/bcgit/bc-java/commits) --- updated-dependencies: - dependency-name: org.bouncycastle:bcpkix-jdk18on 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 57cff63b91..e9a968215f 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 1.2.4 1.0.2 9.4.54.v20240208 - 1.77 + 1.78 0.10 2.10.1 From 53736a68e2eafecf20243b7f4ab160e8cdf1d731 Mon Sep 17 00:00:00 2001 From: Bruno Leite Date: Wed, 3 Apr 2024 19:09:20 +0100 Subject: [PATCH 432/657] Fix unwrapping loop in case bytebuffer has exactly 1 handshake message In the scenario where the reading ByteBuffer only has enough bytes to unwrap one handshake message, the flow may enter a loop due to the call to ByteBuffer.clear(). That method does not actually erase any data, instead it sets the position back to 0, the limit to the capacity, and the mark is discarded. Since we are doing another unwrap attempt using the same reading ByteBuffer, the same handshake message will be read. Updating the reading ByteBuffer position instead of trying to clear it will result in a BUFFER_UNDERFLOW, which will then trigger another read from the channel (as expected). (cherry picked from commit 7382a33b1eb115a730e10485e7c294a531bbe78c) --- .../com/rabbitmq/client/impl/nio/SslEngineHelper.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java index d9a5b17105..442359c78b 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/SslEngineHelper.java @@ -110,6 +110,7 @@ private static SSLEngineResult.HandshakeStatus unwrap(ByteBuffer cipherIn, ByteB SSLEngineResult unwrapResult; do { int positionBeforeUnwrapping = cipherIn.position(); + LOGGER.debug("Before unwrapping cipherIn is {}, with {} remaining byte(s)", cipherIn, cipherIn.remaining()); unwrapResult = sslEngine.unwrap(cipherIn, plainIn); LOGGER.debug("SSL engine result is {} after unwrapping", unwrapResult); status = unwrapResult.getStatus(); @@ -118,14 +119,7 @@ private static SSLEngineResult.HandshakeStatus unwrap(ByteBuffer cipherIn, ByteB plainIn.clear(); if (unwrapResult.getHandshakeStatus() == NEED_TASK) { handshakeStatus = runDelegatedTasks(sslEngine); - int newPosition = positionBeforeUnwrapping + unwrapResult.bytesConsumed(); - if (newPosition == cipherIn.limit()) { - LOGGER.debug("Clearing cipherIn because all bytes have been read and unwrapped"); - cipherIn.clear(); - } else { - LOGGER.debug("Setting cipherIn position to {} (limit is {})", newPosition, cipherIn.limit()); - cipherIn.position(positionBeforeUnwrapping + unwrapResult.bytesConsumed()); - } + cipherIn.position(positionBeforeUnwrapping + unwrapResult.bytesConsumed()); } else { handshakeStatus = unwrapResult.getHandshakeStatus(); } From 8e0e4f0755d2d6f4e92f100849b16b9d7de0a511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 8 Apr 2024 10:38:17 +0200 Subject: [PATCH 433/657] Set release version to 5.21.0 --- release-versions.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release-versions.txt b/release-versions.txt index aaed90d712..387eb1ae41 100644 --- a/release-versions.txt +++ b/release-versions.txt @@ -1,3 +1,3 @@ -RELEASE_VERSION="5.21.0.RC1" -DEVELOPMENT_VERSION="5.21.0-SNAPSHOT" +RELEASE_VERSION="5.21.0" +DEVELOPMENT_VERSION="5.22.0-SNAPSHOT" RELEASE_BRANCH="5.x.x-stable" From f0cc24f5a2ae0fdd635cc71dd16afdb1e60608a6 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 8 Apr 2024 08:39:34 +0000 Subject: [PATCH 434/657] [maven-release-plugin] prepare release v5.21.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e9a968215f..f0fafe9bb2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.21.0-SNAPSHOT + 5.21.0 jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git - HEAD + v5.21.0 From b750c96e7a85a3bea4f714810c328b1421514611 Mon Sep 17 00:00:00 2001 From: rabbitmq-ci Date: Mon, 8 Apr 2024 08:39:36 +0000 Subject: [PATCH 435/657] [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 f0fafe9bb2..0d02e9caf4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ com.rabbitmq amqp-client - 5.21.0 + 5.22.0-SNAPSHOT jar RabbitMQ Java Client @@ -42,7 +42,7 @@ https://github.com/rabbitmq/rabbitmq-java-client scm:git:git://github.com/rabbitmq/rabbitmq-java-client.git scm:git:https://github.com/rabbitmq/rabbitmq-java-client.git - v5.21.0 + HEAD From 27bc43d579114da5c0105454414c41183dea4b61 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 00:25:09 +0000 Subject: [PATCH 436/657] Bump opentelemetry.version from 1.36.0 to 1.37.0 Bumps `opentelemetry.version` from 1.36.0 to 1.37.0. Updates `io.opentelemetry:opentelemetry-api` from 1.36.0 to 1.37.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.36.0...v1.37.0) Updates `io.opentelemetry:opentelemetry-sdk-testing` from 1.36.0 to 1.37.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.36.0...v1.37.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 0d02e9caf4..f82a511e84 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 4.2.25 1.12.4 1.1.4 - 1.36.0 + 1.37.0 2.17.0 1.2.13 5.10.2 From 22b73d052d02de8be1fd4dc1041b17a2e4678988 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 00:25:13 +0000 Subject: [PATCH 437/657] 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 0d02e9caf4..e28c3da29e 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 5.10.2 5.11.0 3.25.3 - 1.2.4 + 1.2.5 1.0.2 9.4.54.v20240208 1.78 From e716de4dde1d1379c71db8bcfc8bc60bb16eb53f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 00:25:29 +0000 Subject: [PATCH 438/657] 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 0d02e9caf4..cdaacf8dc0 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ true 1.7.36 4.2.25 - 1.12.4 + 1.12.5 1.1.4 1.36.0 2.17.0 From fe5767111e0e1367fca82e9b8a785b095a1f1c90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 Apr 2024 00:46:43 +0000 Subject: [PATCH 439/657] 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 bd0da4e9c4..204fac1cc0 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.13.0 3.2.5 3.2.5 - 3.2.2 + 3.2.3 3.3.0 5.1.9 0.0.6 From 7eac3a151e22c78b22945536106c773aa4aa88c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 00:12:56 +0000 Subject: [PATCH 440/657] 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 204fac1cc0..69a058aadc 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ 3.2.5 3.2.5 3.2.3 - 3.3.0 + 3.4.0 5.1.9 0.0.6 1.6.13 From dba082d7e517484e99c0f39f58acee9640ae9b54 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 00:47:52 +0000 Subject: [PATCH 441/657] Bump org.bouncycastle:bcpkix-jdk18on from 1.78 to 1.78.1 Bumps [org.bouncycastle:bcpkix-jdk18on](https://github.com/bcgit/bc-java) from 1.78 to 1.78.1. - [Changelog](https://github.com/bcgit/bc-java/blob/main/docs/releasenotes.html) - [Commits](https://github.com/bcgit/bc-java/commits) --- updated-dependencies: - dependency-name: org.bouncycastle:bcpkix-jdk18on 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 69a058aadc..e10ca47162 100644 --- a/pom.xml +++ b/pom.xml @@ -68,7 +68,7 @@ 1.2.5 1.0.2 9.4.54.v20240208 - 1.78 + 1.78.1 0.10 2.10.1 From e0e0008572d7dbbb2038171a386fd966bfb31822 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 00:42:34 +0000 Subject: [PATCH 442/657] 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 e10ca47162..457f58572d 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 3.13.0 3.2.5 3.2.5 - 3.2.3 + 3.2.4 3.4.0 5.1.9 0.0.6 From e4bce606194459dc74791fe2815cc00f5961fd98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 06:59:41 +0000 Subject: [PATCH 443/657] 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 457f58572d..7191dc4395 100644 --- a/pom.xml +++ b/pom.xml @@ -85,7 +85,7 @@ 3.2.5 3.2.5 3.2.4 - 3.4.0 + 3.4.1 5.1.9 0.0.6 1.6.13 From 4d0fd67211455a2de09ea5af9dd4acdcadca53c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 May 2024 01:08:06 +0000 Subject: [PATCH 444/657] Bump com.fasterxml.jackson.core:jackson-databind from 2.17.0 to 2.17.1 Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) from 2.17.0 to 2.17.1. - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind 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 7191dc4395..6c9f2f9aac 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.12.5 1.1.4 1.37.0 - 2.17.0 + 2.17.1 1.2.13 5.10.2 5.11.0 From aed5a5bb9b2ed488c7961f786f40c83577e08d74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 00:05:26 +0000 Subject: [PATCH 445/657] Bump opentelemetry.version from 1.37.0 to 1.38.0 Bumps `opentelemetry.version` from 1.37.0 to 1.38.0. Updates `io.opentelemetry:opentelemetry-api` from 1.37.0 to 1.38.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.37.0...v1.38.0) Updates `io.opentelemetry:opentelemetry-sdk-testing` from 1.37.0 to 1.38.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.37.0...v1.38.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 6c9f2f9aac..98ca2edf3e 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 4.2.25 1.12.5 1.1.4 - 1.37.0 + 1.38.0 2.17.1 1.2.13 5.10.2 From 980582f7db725e32987529413378dc14fff836f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 00:05:34 +0000 Subject: [PATCH 446/657] 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 6c9f2f9aac..5551f51c32 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 2.17.1 1.2.13 5.10.2 - 5.11.0 + 5.12.0 3.25.3 1.2.5 1.0.2 From 731ce10052a0805a61cc07bba548c7698aecfebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 13 May 2024 08:53:15 +0200 Subject: [PATCH 447/657] Check write byte buffer size Fixes #1309 (cherry picked from commit 73f0ab81c615e40088cae4db082f121202a16804) --- src/main/java/com/rabbitmq/client/impl/nio/NioParams.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/client/impl/nio/NioParams.java b/src/main/java/com/rabbitmq/client/impl/nio/NioParams.java index d3cd8ceed1..7073b6178d 100644 --- a/src/main/java/com/rabbitmq/client/impl/nio/NioParams.java +++ b/src/main/java/com/rabbitmq/client/impl/nio/NioParams.java @@ -180,7 +180,7 @@ public int getWriteByteBufferSize() { * @return this {@link NioParams} instance */ public NioParams setWriteByteBufferSize(int writeByteBufferSize) { - if (readByteBufferSize <= 0) { + if (writeByteBufferSize <= 0) { throw new IllegalArgumentException("Buffer size must be greater than 0"); } this.writeByteBufferSize = writeByteBufferSize; From 550ee73cd53dd4eda5a1fa9ee1cca0f6a455154a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 00:31:30 +0000 Subject: [PATCH 448/657] Bump io.micrometer:micrometer-core from 1.12.5 to 1.13.0 Bumps [io.micrometer:micrometer-core](https://github.com/micrometer-metrics/micrometer) from 1.12.5 to 1.13.0. - [Release notes](https://github.com/micrometer-metrics/micrometer/releases) - [Commits](https://github.com/micrometer-metrics/micrometer/compare/v1.12.5...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 3db917238e..08b0e6165e 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ true 1.7.36 4.2.25 - 1.12.5 + 1.13.0 1.1.4 1.38.0 2.17.1 From 253aa4c99c43f2a247bec39a3ccb36c6447a552d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 00:31:34 +0000 Subject: [PATCH 449/657] 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.3.0. - [Release notes](https://github.com/micrometer-metrics/tracing/releases) - [Commits](https://github.com/micrometer-metrics/tracing/compare/v1.2.5...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 3db917238e..a6b4f4c090 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ 5.10.2 5.12.0 3.25.3 - 1.2.5 + 1.3.0 1.0.2 9.4.54.v20240208 1.78.1 From 7a9edaa822f52f276b9e9cbbc426ca777b3fc3ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 00:51:46 +0000 Subject: [PATCH 450/657] 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 7ac4a86d29..95814fcc3c 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 9.4.54.v20240208 1.78.1 0.10 - 2.10.1 + 2.11.0 3.6.3 3.0.1 From f9dab2a9a47636a5d9a7320e4848612eb365dfe0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 00:51:51 +0000 Subject: [PATCH 451/657] Bump org.codehaus.mojo:build-helper-maven-plugin from 3.5.0 to 3.6.0 Bumps [org.codehaus.mojo:build-helper-maven-plugin](https://github.com/mojohaus/build-helper-maven-plugin) from 3.5.0 to 3.6.0. - [Release notes](https://github.com/mojohaus/build-helper-maven-plugin/releases) - [Commits](https://github.com/mojohaus/build-helper-maven-plugin/compare/3.5.0...3.6.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:build-helper-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 7ac4a86d29..66a6502d72 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ 2.1.1 2.4.21 1.7 - 3.5.0 + 3.6.0 3.13.0 3.2.5 3.2.5 From b0569d74fce7eeff57c623250d11928e0884c993 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 00:28:54 +0000 Subject: [PATCH 452/657] 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 c169663323..93628d4f4f 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 1.2.13 5.10.2 5.12.0 - 3.25.3 + 3.26.0 1.3.0 1.0.2 9.4.54.v20240208 From 125de1b6f818c5635a0b51f9d81b87cb3518fd7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 00:10:16 +0000 Subject: [PATCH 453/657] 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 93628d4f4f..92bd3868c9 100644 --- a/pom.xml +++ b/pom.xml @@ -88,7 +88,7 @@ 3.4.1 5.1.9 0.0.6 - 1.6.13 + 1.7.0 1.11 1.4 2.43.0 From 08466959feb9b6c151b7e75694af0b2012ddb6fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 00:04:42 +0000 Subject: [PATCH 454/657] 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 92bd3868c9..a40c8ee181 100644 --- a/pom.xml +++ b/pom.xml @@ -72,7 +72,7 @@ 0.10 2.11.0 - 3.6.3 + 3.7.0 3.0.1 2.16.2 3.3.1 From e446c06af178d9a8802c7aa87c7e94a4d993fd00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 00:04:44 +0000 Subject: [PATCH 455/657] Bump org.sonarsource.scanner.maven:sonar-maven-plugin Bumps [org.sonarsource.scanner.maven:sonar-maven-plugin](https://github.com/SonarSource/sonar-scanner-maven) from 3.11.0.3922 to 4.0.0.4121. - [Release notes](https://github.com/SonarSource/sonar-scanner-maven/releases) - [Commits](https://github.com/SonarSource/sonar-scanner-maven/compare/3.11.0.3922...4.0.0.4121) --- updated-dependencies: - dependency-name: org.sonarsource.scanner.maven:sonar-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 92bd3868c9..5acbcc85b9 100644 --- a/pom.xml +++ b/pom.xml @@ -835,7 +835,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.11.0.3922 + 4.0.0.4121 From b46d3127ae8f532d9ea7682bc96ca7c15ca18474 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 00:40:58 +0000 Subject: [PATCH 456/657] Bump opentelemetry.version from 1.38.0 to 1.39.0 Bumps `opentelemetry.version` from 1.38.0 to 1.39.0. Updates `io.opentelemetry:opentelemetry-api` from 1.38.0 to 1.39.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.38.0...v1.39.0) Updates `io.opentelemetry:opentelemetry-sdk-testing` from 1.38.0 to 1.39.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.38.0...v1.39.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 a42b2640e5..d70788648e 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 4.2.25 1.13.0 1.1.4 - 1.38.0 + 1.39.0 2.17.1 1.2.13 5.10.2 From 7b2a3730925ba5ba24d8c834f60641aec1250bcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 00:41:19 +0000 Subject: [PATCH 457/657] 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 a42b2640e5..fe7bcd9092 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ true 1.7.36 - 4.2.25 + 4.2.26 1.13.0 1.1.4 1.38.0 From 1f303a9db50aef4b4195dcdcc2a4acb99e379051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 10 Jun 2024 10:01:49 +0200 Subject: [PATCH 458/657] Remove use of ha-mode policy Classic mirrored queues are deprecated in RabbitMQ 3.13 and gone in RabbitMQ 4.0, so we do not test them anymore. (cherry picked from commit fe2585a5b1b89d91a5afb7eed723ba8529aa980a) --- .../rabbitmq/client/test/BrokerTestCase.java | 5 - .../client/test/functional/Policies.java | 6 - .../client/test/server/AbsentQueue.java | 108 ------------------ .../server/DeadLetterExchangeDurable.java | 3 - .../client/test/server/MessageRecovery.java | 21 +--- 5 files changed, 1 insertion(+), 142 deletions(-) delete mode 100644 src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java diff --git a/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java b/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java index 7f7d2ed4bb..22b2042f71 100644 --- a/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java +++ b/src/test/java/com/rabbitmq/client/test/BrokerTestCase.java @@ -35,7 +35,6 @@ public class BrokerTestCase { private String brokerVersion; - private boolean ha = false; protected volatile TestInfo testInfo; @@ -343,10 +342,6 @@ private static String name(String prefix, Class testClass, String testMethodN prefix, testClass.getSimpleName(), testMethodName, uuid.substring(uuid.length() / 2)); } - protected boolean ha() { - return this.ha; - } - protected boolean beforeMessageContainers() { return versionCompare(this.brokerVersion, "3.13.0") < 0; } diff --git a/src/test/java/com/rabbitmq/client/test/functional/Policies.java b/src/test/java/com/rabbitmq/client/test/functional/Policies.java index 016bc35320..7a0f856882 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/Policies.java +++ b/src/test/java/com/rabbitmq/client/test/functional/Policies.java @@ -180,12 +180,6 @@ public class Policies extends BrokerTestCase { private final Set policies = new HashSet(); private void setPolicy(String name, String pattern, String definition) throws IOException { - // We need to override the HA policy that we use in HATests, so - // priority 1. But we still want a valid test of HA, so add the - // ha-mode definition. - if (ha()) { - definition += ",\"ha-mode\":\"all\""; - } Host.rabbitmqctl("set_policy --priority 1 " + name + " " + pattern + " {" + escapeDefinition(definition) + "}"); policies.add(name); diff --git a/src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java b/src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java deleted file mode 100644 index d0296d8552..0000000000 --- a/src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) 2007-2023 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. -// -// This software, the RabbitMQ Java client library, is triple-licensed under the -// Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 -// ("GPL") and the Apache License version 2 ("ASL"). For the MPL, please see -// LICENSE-MPL-RabbitMQ. For the GPL, please see LICENSE-GPL2. 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.client.test.server; - -import com.rabbitmq.client.AMQP; -import com.rabbitmq.client.Channel; -import com.rabbitmq.client.test.functional.ClusteredTestBase; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; - -import java.io.IOException; -import java.util.concurrent.Callable; -import java.util.concurrent.TimeoutException; -import org.junit.jupiter.api.TestInfo; - -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.fail; - -/** - * This tests whether 'absent' queues - durable queues whose home node - * is down - are handled properly. - */ -public class AbsentQueue extends ClusteredTestBase { - - private static final String Q = "absent-queue"; - - @BeforeEach - @Override public void setUp(TestInfo info) throws IOException, TimeoutException { - super.setUp(info); - if (clusteredConnection != null) - stopSecondary(); - } - - @AfterEach - @Override public void tearDown(TestInfo info) throws IOException, TimeoutException { - if (clusteredConnection != null) - startSecondary(); - super.tearDown(info); - } - - @Override protected void createResources() throws IOException { - alternateChannel.queueDeclare(Q, true, false, false, null); - } - - @Override protected void releaseResources() throws IOException { - alternateChannel.queueDelete(Q); - } - - @Test public void notFound() throws Exception { - if (!ha()) { - // we don't care about this test in normal mode - return; - } - waitPropagationInHa(); - assertNotFound(() -> channel.queueDeclare(Q, true, false, false, null)); - assertNotFound(() -> channel.queueDeclarePassive(Q)); - assertNotFound(() -> channel.queuePurge(Q)); - assertNotFound(() -> channel.basicGet(Q, true)); - assertNotFound(() -> channel.queueBind(Q, "amq.fanout", "", null)); - } - - protected void assertNotFound(Callable t) throws Exception { - if (clusteredChannel == null) return; - try { - t.call(); - if (!ha()) fail("expected not_found"); - } catch (IOException ioe) { - assertFalse(ha()); - checkShutdownSignal(AMQP.NOT_FOUND, ioe); - channel = connection.createChannel(); - } - - } - - private void waitPropagationInHa() throws IOException, InterruptedException { - // can be necessary to wait a bit in HA mode - if (ha()) { - long waited = 0; - while(waited < 5000) { - Channel tempChannel = connection.createChannel(); - try { - tempChannel.queueDeclarePassive(Q); - break; - } catch (IOException e) { - - } - Thread.sleep(10); - waited += 10; - } - } - } - -} diff --git a/src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java b/src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java index 3b754c88e2..589fdcb1b6 100644 --- a/src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java +++ b/src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java @@ -50,9 +50,6 @@ protected void releaseResources() throws IOException { } @Test public void deadLetterQueueTTLExpiredWhileDown() throws Exception { - // This test is nonsensical (and often breaks) in HA mode. - if (ha()) return; - for(int x = 0; x < DeadLetterExchange.MSG_COUNT; x++) { channel.basicPublish("amq.direct", "test", MessageProperties.MINIMAL_PERSISTENT_BASIC, "test message".getBytes()); } diff --git a/src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java b/src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java index 791e7e0082..b568784533 100644 --- a/src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java +++ b/src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java @@ -46,26 +46,7 @@ public class MessageRecovery extends ConfirmBase restart(); - // When testing in HA mode the message will be collected from - // a promoted slave and will have its redelivered flag - // set. But that only happens if there actually *is* a - // slave. We test that by passively declaring, and - // subsequently deleting, the secondary, non-durable queue, - // which only succeeds if the queue survived the restart, - // which in turn implies that it must have been a HA queue - // with slave(s). - // NB: this wont work when running against a single node broker - // and running the test individually outside of the HA suite - boolean expectDelivered = ha(); - try { - channel.queueDeclarePassive(Q2); - channel.queueDelete(Q2); - expectDelivered = true; - } catch (IOException e) { - checkShutdownSignal(AMQP.NOT_FOUND, e); - openChannel(); - } - assertDelivered(Q, 1, expectDelivered); + assertDelivered(Q, 1, false); channel.queueDelete(Q); channel.queueDelete(Q2); } From 76b8bbefb289349240f694239e479244ce86d4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 10 Jun 2024 10:11:46 +0200 Subject: [PATCH 459/657] Remove deleted test from test suite (cherry picked from commit c8bd355f0531cded86f74366ad3c256c6de9e5df) --- .../java/com/rabbitmq/client/test/server/ServerTestSuite.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/java/com/rabbitmq/client/test/server/ServerTestSuite.java b/src/test/java/com/rabbitmq/client/test/server/ServerTestSuite.java index 64a1499eb0..463fec3c8e 100644 --- a/src/test/java/com/rabbitmq/client/test/server/ServerTestSuite.java +++ b/src/test/java/com/rabbitmq/client/test/server/ServerTestSuite.java @@ -26,7 +26,6 @@ DeadLetterExchangeDurable.class, EffectVisibilityCrossNodeTest.class, ExclusiveQueueDurability.class, - AbsentQueue.class, AlternateExchangeEquivalence.class, MemoryAlarms.class, MessageRecovery.class, From 87bfeb05a5011059ee0f5dc2e2d2b102ca0bf82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 10 Jun 2024 10:39:14 +0200 Subject: [PATCH 460/657] Remove HA policy in JUnit extension (cherry picked from commit 87c99b9112465802cb4f62423e20e227552e210f) --- .../client/AmqpClientTestExtension.java | 76 ++----------------- 1 file changed, 5 insertions(+), 71 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java b/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java index ee4456f536..bd41d2a2cd 100644 --- a/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java +++ b/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.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) 2023-2024 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -21,12 +21,10 @@ import com.rabbitmq.client.test.TestUtils; import com.rabbitmq.client.test.functional.FunctionalTestSuite; import com.rabbitmq.client.test.server.HaTestSuite; -import com.rabbitmq.client.test.server.LastHaTestSuite; import com.rabbitmq.client.test.server.ServerTestSuite; import com.rabbitmq.client.test.ssl.SslTestSuite; import com.rabbitmq.tools.Host; import java.io.File; -import java.lang.reflect.Field; import java.net.Socket; import java.util.Properties; import org.junit.jupiter.api.extension.AfterEachCallback; @@ -35,8 +33,6 @@ import org.junit.jupiter.api.extension.ConditionEvaluationResult; import org.junit.jupiter.api.extension.ExecutionCondition; import org.junit.jupiter.api.extension.ExtensionContext; -import org.junit.jupiter.api.extension.ExtensionContext.Namespace; -import org.junit.jupiter.api.extension.ExtensionContext.Store; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -45,7 +41,6 @@ public class AmqpClientTestExtension implements ExecutionCondition, BeforeAllCal AfterEachCallback { private static final Logger LOGGER = LoggerFactory.getLogger(AmqpClientTestExtension.class); - private static final Namespace NAMESPACE = Namespace.create(AmqpClientTestExtension.class); static { Properties TESTS_PROPS = new Properties(System.getProperties()); @@ -66,31 +61,6 @@ public class AmqpClientTestExtension implements ExecutionCondition, BeforeAllCal } } - private static void maybeSetHaFieldValue(ExtensionContext context, boolean value) { - if (context.getTestClass().isPresent() && context.getTestInstance().isPresent()) { - try { - Field haField = findField(context.getTestClass().get(), "ha"); - if (haField != null) { - haField.setAccessible(true); - haField.set(context.getTestInstance().get(), value); - } - } catch (Exception e) { - // OK - } - } - } - - private static Field findField(Class clazz, String fieldName) { - try { - return clazz.getDeclaredField(fieldName); - } catch (NoSuchFieldException e) { - if (clazz.getSuperclass() != null) { - return findField(clazz.getSuperclass(), fieldName); - } - } - return null; - } - private static boolean isFunctionalSuite(ExtensionContext context) { return isTestSuite(context, FunctionalTestSuite.class); } @@ -107,10 +77,6 @@ private static boolean isHaSuite(ExtensionContext context) { return isTestSuite(context, HaTestSuite.class); } - private static boolean isLastHaSuite(ExtensionContext context) { - return isTestSuite(context, LastHaTestSuite.class); - } - private static boolean isTestSuite(ExtensionContext context, Class clazz) { return context.getUniqueId().contains(clazz.getName()); } @@ -162,22 +128,6 @@ private static boolean checkServerListening(String host, int port) { } } - private static Store store(ExtensionContext context) { - return context.getRoot().getStore(NAMESPACE); - } - - private static boolean hasHaSuiteStarted(ExtensionContext context) { - return "true".equals(store(context).get("ha")); - } - - private static void markHaSuiteStarted(ExtensionContext context) { - store(context).put("ha", "true"); - } - - private static void markHaSuiteFinished(ExtensionContext context) { - store(context).remove("ha"); - } - @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { // HA test suite must be checked first because it contains other test suites @@ -199,39 +149,23 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con } @Override - public void beforeAll(ExtensionContext context) throws Exception { - if (isHaSuite(context) && !hasHaSuiteStarted(context)) { - LOGGER.info("Starting HA test suite"); - Host.rabbitmqctl("set_policy HA '.*' '{\"ha-mode\":\"all\"}'"); - markHaSuiteStarted(context); - } - if (isLastHaSuite(context)) { - LOGGER.info("HA suite done, clearing HA state"); - Host.rabbitmqctl("clear_policy HA"); - markHaSuiteFinished(context); - } + public void beforeAll(ExtensionContext context) { + } @Override public void beforeEach(ExtensionContext context) { LOGGER.info( - "Starting test: {}.{} (nio? {}, HA? {})", + "Starting test: {}.{} (nio? {})", context.getTestClass().get().getSimpleName(), context.getTestMethod().get().getName(), - TestUtils.USE_NIO, - hasHaSuiteStarted(context) + TestUtils.USE_NIO ); - if (isHaSuite(context)) { - maybeSetHaFieldValue(context, true); - } } @Override public void afterEach(ExtensionContext context) { LOGGER.info("Test finished: {}.{}", context.getTestClass().get().getSimpleName(), context.getTestMethod().get().getName()); - if (isHaSuite(context)) { - maybeSetHaFieldValue(context, false); - } } } From 2e786439587610911e35725591e2ede7a6d3a881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 10 Jun 2024 11:46:29 +0200 Subject: [PATCH 461/657] Remove cluster startup script Not used anymore. (cherry picked from commit 092272204c0d8be6bdaaf6a63fa45e7eeb6ace12) --- .github/workflows/test-rabbitmq-alphas.yml | 4 +- .../test-supported-java-versions-5.x.yml | 4 +- .../test-supported-java-versions-main.yml | 4 +- .github/workflows/test.yml | 4 +- pom.xml | 166 ------------------ src/main/scripts/manage_test_broker.groovy | 65 ------- 6 files changed, 8 insertions(+), 239 deletions(-) delete mode 100644 src/main/scripts/manage_test_broker.groovy diff --git a/.github/workflows/test-rabbitmq-alphas.yml b/.github/workflows/test-rabbitmq-alphas.yml index 3303ecdb04..5338a50545 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -43,14 +43,14 @@ jobs: run: make deps - name: Test with NIO run: | - ./mvnw verify -P '!setup-test-cluster,use-nio' -Drabbitmqctl.bin=DOCKER:rabbitmq \ + ./mvnw verify -P use-nio -Drabbitmqctl.bin=DOCKER:rabbitmq \ -Dtest-broker.A.nodename=rabbit@$(hostname) -Dtest-broker.B.nodename=hare@$(hostname) \ -Dmaven.javadoc.skip=true \ -Dtest-client-cert.password= -Dtest-tls-certs.dir=rabbitmq-configuration/tls \ --no-transfer-progress - name: Test with blocking IO run: | - ./mvnw verify -P '!setup-test-cluster' -Drabbitmqctl.bin=DOCKER:rabbitmq \ + ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ -Dtest-broker.A.nodename=rabbit@$(hostname) -Dtest-broker.B.nodename=hare@$(hostname) \ -Dmaven.javadoc.skip=true \ -Dtest-client-cert.password= -Dtest-tls-certs.dir=rabbitmq-configuration/tls \ diff --git a/.github/workflows/test-supported-java-versions-5.x.yml b/.github/workflows/test-supported-java-versions-5.x.yml index e8263d5c00..8961524be7 100644 --- a/.github/workflows/test-supported-java-versions-5.x.yml +++ b/.github/workflows/test-supported-java-versions-5.x.yml @@ -43,14 +43,14 @@ jobs: run: ./mvnw --version - name: Test with NIO run: | - ./mvnw verify -P '!setup-test-cluster,use-nio' -Drabbitmqctl.bin=DOCKER:rabbitmq \ + ./mvnw verify -P use-nio -Drabbitmqctl.bin=DOCKER:rabbitmq \ -Dtest-broker.A.nodename=rabbit@$(hostname) -Dmaven.javadoc.skip=true \ -Dtest-client-cert.password= -Dtest-tls-certs.dir=rabbitmq-configuration/tls \ -Dit.test=ClientTestSuite,FunctionalTestSuite,ServerTestSuite,SslTestSuite \ --no-transfer-progress - name: Test with blocking IO run: | - ./mvnw verify -P '!setup-test-cluster' -Drabbitmqctl.bin=DOCKER:rabbitmq \ + ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ -Dtest-broker.A.nodename=rabbit@$(hostname) -Dmaven.javadoc.skip=true \ -Dtest-client-cert.password= -Dtest-tls-certs.dir=rabbitmq-configuration/tls \ -Dit.test=ClientTestSuite,FunctionalTestSuite,ServerTestSuite,SslTestSuite \ diff --git a/.github/workflows/test-supported-java-versions-main.yml b/.github/workflows/test-supported-java-versions-main.yml index 8c293ab0e3..aa62fd2f29 100644 --- a/.github/workflows/test-supported-java-versions-main.yml +++ b/.github/workflows/test-supported-java-versions-main.yml @@ -41,14 +41,14 @@ jobs: run: ./mvnw --version - name: Test with NIO run: | - ./mvnw verify -P '!setup-test-cluster,use-nio' -Drabbitmqctl.bin=DOCKER:rabbitmq \ + ./mvnw verify -P use-nio -Drabbitmqctl.bin=DOCKER:rabbitmq \ -Dtest-broker.A.nodename=rabbit@$(hostname) -Dmaven.javadoc.skip=true \ -Dtest-client-cert.password= -Dtest-tls-certs.dir=rabbitmq-configuration/tls \ -Dit.test=ClientTestSuite,FunctionalTestSuite,ServerTestSuite,SslTestSuite \ --no-transfer-progress - name: Test with blocking IO run: | - ./mvnw verify -P '!setup-test-cluster' -Drabbitmqctl.bin=DOCKER:rabbitmq \ + ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ -Dtest-broker.A.nodename=rabbit@$(hostname) -Dmaven.javadoc.skip=true \ -Dtest-client-cert.password= -Dtest-tls-certs.dir=rabbitmq-configuration/tls \ -Dit.test=ClientTestSuite,FunctionalTestSuite,ServerTestSuite,SslTestSuite \ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0812619a84..f8b966b71e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,14 +41,14 @@ jobs: run: make deps - name: Test with NIO run: | - ./mvnw verify -P '!setup-test-cluster,use-nio' -Drabbitmqctl.bin=DOCKER:rabbitmq \ + ./mvnw verify -P use-nio -Drabbitmqctl.bin=DOCKER:rabbitmq \ -Dtest-broker.A.nodename=rabbit@$(hostname) -Dtest-broker.B.nodename=hare@$(hostname) \ -Dmaven.javadoc.skip=true \ -Dtest-client-cert.password= -Dtest-tls-certs.dir=rabbitmq-configuration/tls \ --no-transfer-progress - name: Test with blocking IO run: | - ./mvnw verify -P '!setup-test-cluster' -Drabbitmqctl.bin=DOCKER:rabbitmq \ + ./mvnw verify -Drabbitmqctl.bin=DOCKER:rabbitmq \ -Dtest-broker.A.nodename=rabbit@$(hostname) -Dtest-broker.B.nodename=hare@$(hostname) \ -Dmaven.javadoc.skip=true \ -Dtest-client-cert.password= -Dtest-tls-certs.dir=rabbitmq-configuration/tls \ diff --git a/pom.xml b/pom.xml index 7d368e5b58..b42f823900 100644 --- a/pom.xml +++ b/pom.xml @@ -107,9 +107,6 @@ "rabbitmq_codegen" is used to generate required Java source files. Its path can be specified with the ${codegen.dir} property instead. - - "rabbit" is used to automatically setup a RabbitMQ cluster for the - testsuite. --> ${basedir}/deps ${deps.dir}/rabbitmq_codegen @@ -198,169 +195,6 @@ - - - setup-test-cluster - - - !skipTests - - - - - - org.codehaus.gmaven - groovy-maven-plugin - ${groovy.maven.plugin.version} - - - org.codehaus.groovy - groovy-all - ${groovy.all.version} - - - - - - generate-test-resources - query-test-tls-certs-dir - - execute - - - - ${groovy-scripts.dir}/query_test_tls_certs_dir.groovy - - - - - - - pre-integration-test - start-test-broker-A - - execute - - - - ${test-broker.A.nodename} - ${test-broker.A.node_port} - - - ${groovy-scripts.dir}/manage_test_broker.groovy - - - - - pre-integration-test - start-test-broker-B - - execute - - - - ${test-broker.B.nodename} - ${test-broker.B.node_port} - - - ${groovy-scripts.dir}/manage_test_broker.groovy - - - - - pre-integration-test - create-test-cluster - - execute - - - - ${test-broker.B.nodename} - ${test-broker.A.nodename} - - - ${groovy-scripts.dir}/manage_test_broker.groovy - - - - - - - post-integration-test - stop-test-broker-B - - execute - - - - ${test-broker.B.nodename} - - - ${groovy-scripts.dir}/manage_test_broker.groovy - - - - - post-integration-test - stop-test-broker-A - - execute - - - - ${test-broker.A.nodename} - - - ${groovy-scripts.dir}/manage_test_broker.groovy - - - - - - - - - org.codehaus.mojo - keytool-maven-plugin - ${keytool.maven.plugin.version} - - false - - - - - - 6026DFCA @@ -185,35 +178,6 @@ - - - use-provided-test-keystores - - - ${test-tls-certs.dir}/testca/cacert.pem - - - - - - org.codehaus.mojo - keytool-maven-plugin - ${keytool.maven.plugin.version} - - false - - - - - - - - generate-test-resources - remove-old-test-keystores - - execute - - - - ${groovy-scripts.dir}/remove_old_test_keystores.groovy - - - @@ -840,47 +778,6 @@ - - - org.codehaus.mojo - keytool-maven-plugin - ${keytool.maven.plugin.version} - - true - - - - generate-test-ca-keystore - generate-test-resources - - importCertificate - - - ${test-tls-certs.dir}/testca/cacert.pem - ${test-keystore.ca} - ${test-keystore.password} - true - server1 - - - - generate-test-empty-keystore - generate-test-resources - - importCertificate - deleteAlias - - - ${test-tls-certs.dir}/testca/cacert.pem - ${test-keystore.empty} - ${test-keystore.password} - true - server1 - - - - - org.apache.maven.plugins maven-jar-plugin diff --git a/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java b/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java index bd41d2a2cd..dcffa744b2 100644 --- a/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java +++ b/src/test/java/com/rabbitmq/client/AmqpClientTestExtension.java @@ -1,4 +1,5 @@ -// Copyright (c) 2023-2024 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// Copyright (c) 2023-2025 Broadcom. All Rights Reserved. The term "Broadcom" refers to Broadcom +// Inc. and/or its subsidiaries. // // This software, the RabbitMQ Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -24,9 +25,7 @@ import com.rabbitmq.client.test.server.ServerTestSuite; import com.rabbitmq.client.test.ssl.SslTestSuite; import com.rabbitmq.tools.Host; -import java.io.File; import java.net.Socket; -import java.util.Properties; import org.junit.jupiter.api.extension.AfterEachCallback; import org.junit.jupiter.api.extension.BeforeAllCallback; import org.junit.jupiter.api.extension.BeforeEachCallback; @@ -36,31 +35,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class AmqpClientTestExtension implements ExecutionCondition, BeforeAllCallback, - BeforeEachCallback, - AfterEachCallback { +public class AmqpClientTestExtension + implements ExecutionCondition, BeforeAllCallback, BeforeEachCallback, AfterEachCallback { private static final Logger LOGGER = LoggerFactory.getLogger(AmqpClientTestExtension.class); - static { - Properties TESTS_PROPS = new Properties(System.getProperties()); - String make = System.getenv("MAKE"); - if (make != null) { - TESTS_PROPS.setProperty("make.bin", make); - } - try { - TESTS_PROPS.load(Host.class.getClassLoader().getResourceAsStream("config.properties")); - } catch (Exception e) { - System.out.println( - "\"build.properties\" or \"config.properties\" not found" + - " in classpath. Please copy \"build.properties\" and" + - " \"config.properties\" into src/test/resources. Ignore" + - " this message if running with ant."); - } finally { - System.setProperties(TESTS_PROPS); - } - } - private static boolean isFunctionalSuite(ExtensionContext context) { return isTestSuite(context, FunctionalTestSuite.class); } @@ -86,8 +65,7 @@ public static boolean requiredProperties() { String rabbitmqctl = Host.rabbitmqctlCommand(); if (rabbitmqctl == null) { System.err.println( - "rabbitmqctl required; please set \"rabbitmqctl.bin\" system" + - " property"); + "rabbitmqctl required; please set \"rabbitmqctl.bin\" system" + " property"); return false; } @@ -95,20 +73,7 @@ public static boolean requiredProperties() { } public static boolean isSSLAvailable() { - String sslClientCertsDir = System.getProperty("test-client-cert.path"); - String hostname = System.getProperty("broker.hostname"); - String port = System.getProperty("broker.sslport"); - if (sslClientCertsDir == null || hostname == null || port == null) { - return false; - } - - // If certificate is present and some server is listening on port 5671 - if (new File(sslClientCertsDir).exists() && - checkServerListening(hostname, Integer.parseInt(port))) { - return true; - } else { - return false; - } + return checkServerListening("localhost", 5671); } private static boolean checkServerListening(String host, int port) { @@ -132,40 +97,42 @@ private static boolean checkServerListening(String host, int port) { public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { // HA test suite must be checked first because it contains other test suites if (isHaSuite(context)) { - return requiredProperties() ? enabled("Required properties available") + return requiredProperties() + ? enabled("Required properties available") : disabled("Required properties not available"); } else if (isServerSuite(context)) { - return requiredProperties() ? enabled("Required properties available") + return requiredProperties() + ? enabled("Required properties available") : disabled("Required properties not available"); } else if (isFunctionalSuite(context)) { - return requiredProperties() ? enabled("Required properties available") + return requiredProperties() + ? enabled("Required properties available") : disabled("Required properties not available"); } else if (isSslSuite(context)) { - return requiredProperties() && isSSLAvailable() ? enabled( - "Required properties and TLS available") + return requiredProperties() && isSSLAvailable() + ? enabled("Required properties and TLS available") : disabled("Required properties or TLS not available"); } return enabled("ok"); } @Override - public void beforeAll(ExtensionContext context) { - - } + public void beforeAll(ExtensionContext context) {} @Override public void beforeEach(ExtensionContext context) { LOGGER.info( "Starting test: {}.{} (nio? {})", - context.getTestClass().get().getSimpleName(), context.getTestMethod().get().getName(), - TestUtils.USE_NIO - ); + context.getTestClass().get().getSimpleName(), + context.getTestMethod().get().getName(), + TestUtils.USE_NIO); } @Override public void afterEach(ExtensionContext context) { - LOGGER.info("Test finished: {}.{}", - context.getTestClass().get().getSimpleName(), context.getTestMethod().get().getName()); + LOGGER.info( + "Test finished: {}.{}", + context.getTestClass().get().getSimpleName(), + context.getTestMethod().get().getName()); } - } diff --git a/src/test/java/com/rabbitmq/client/test/functional/DurableOnTransient.java b/src/test/java/com/rabbitmq/client/test/functional/DurableOnTransient.java index f807d1a5e5..767e32df02 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/DurableOnTransient.java +++ b/src/test/java/com/rabbitmq/client/test/functional/DurableOnTransient.java @@ -20,7 +20,6 @@ import java.io.IOException; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import com.rabbitmq.client.GetResponse; @@ -68,7 +67,6 @@ protected void releaseResources() throws IOException { assertNotNull(basicGet()); } - @Disabled("Does not apply with Khepri (update datastore while second node is down)") @Test public void semiDurableBindingRemoval() throws IOException { if (clusteredConnection != null) { deleteExchange("x"); @@ -78,18 +76,25 @@ protected void releaseResources() throws IOException { channel.queueBind("q", "x", "k"); stopSecondary(); + boolean restarted = false; + try { + deleteExchange("x"); - deleteExchange("x"); - - startSecondary(); + startSecondary(); + restarted = true; - declareTransientTopicExchange("x"); + declareTransientTopicExchange("x"); - basicPublishVolatile("x", "k"); - assertDelivered("q", 0); + basicPublishVolatile("x", "k"); + assertDelivered("q", 0); - deleteQueue("q"); - deleteExchange("x"); + deleteQueue("q"); + deleteExchange("x"); + } finally { + if (!restarted) { + startSecondary(); + } + } } } } diff --git a/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java b/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java index 65815d4222..f85829c119 100644 --- a/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java +++ b/src/test/java/com/rabbitmq/client/test/ssl/TlsTestUtils.java @@ -1,4 +1,5 @@ -// 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 Java client library, is triple-licensed under the // Mozilla Public License 2.0 ("MPL"), the GNU General Public License version 2 @@ -15,82 +16,38 @@ package com.rabbitmq.client.test.ssl; -import static org.junit.jupiter.api.Assertions.assertNotNull; - +import com.rabbitmq.tools.Host; import java.io.FileInputStream; +import java.net.InetAddress; +import java.net.UnknownHostException; import java.security.KeyStore; import java.security.NoSuchAlgorithmException; +import java.security.cert.Certificate; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; import java.util.Arrays; import java.util.Collection; import java.util.stream.Collectors; -import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; class TlsTestUtils { + static final String[] PROTOCOLS = new String[] {"TLSv1.3", "TLSv1.2"}; + private TlsTestUtils() {} static SSLContext badVerifiedSslContext() throws Exception { - return verifiedSslContext(() -> getSSLContext(), emptyKeystoreCa()); + return sslContext(trustManagerFactory(clientCertificate())); } static SSLContext verifiedSslContext() throws Exception { - return verifiedSslContext(() -> getSSLContext(), keystoreCa()); - } - - static SSLContext verifiedSslContext(CallableSupplier sslContextSupplier) throws Exception { - return verifiedSslContext(sslContextSupplier, keystoreCa()); - } - - static SSLContext verifiedSslContext(CallableSupplier sslContextSupplier, String keystorePath) throws Exception { - // for local testing, run ./mvnw test-compile -Dtest-tls-certs.dir=/tmp/tls-gen/basic - // (generates the Java keystores) - assertNotNull(keystorePath); - String keystorePasswd = keystorePassword(); - assertNotNull(keystorePasswd); - char [] keystorePassword = keystorePasswd.toCharArray(); - - KeyStore tks = KeyStore.getInstance("JKS"); - tks.load(new FileInputStream(keystorePath), keystorePassword); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(tks); - - String p12Path = clientCertPath(); - assertNotNull(p12Path); - String p12Passwd = clientCertPassword(); - assertNotNull(p12Passwd); - KeyStore ks = KeyStore.getInstance("PKCS12"); - char [] p12Password = p12Passwd.toCharArray(); - ks.load(new FileInputStream(p12Path), p12Password); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, p12Password); - - SSLContext c = sslContextSupplier.get(); - c.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - return c; + return sslContext(trustManagerFactory(caCertificate())); } - static String keystoreCa() { - return System.getProperty("test-keystore.ca", "./target/ca.keystore"); - } - - static String emptyKeystoreCa() { - return System.getProperty("test-keystore.empty", "./target/empty.keystore"); - } - - static String keystorePassword() { - return System.getProperty("test-keystore.password", "bunnies"); - } - - static String clientCertPath() { - return System.getProperty("test-client-cert.path", "/tmp/tls-gen/basic/client/keycert.p12"); - } - - static String clientCertPassword() { - return System.getProperty("test-client-cert.password", ""); + static SSLContext verifiedSslContext(CallableSupplier sslContextSupplier) + throws Exception { + return sslContext(sslContextSupplier, trustManagerFactory(caCertificate())); } public static SSLContext getSSLContext() throws NoSuchAlgorithmException { @@ -112,15 +69,78 @@ public static SSLContext getSSLContext() throws NoSuchAlgorithmException { static Collection availableTlsProtocols() { try { String[] protocols = SSLContext.getDefault().getSupportedSSLParameters().getProtocols(); - return Arrays.stream(protocols).filter(p -> p.toLowerCase().startsWith("tls")).collect( - Collectors.toList()); + return Arrays.stream(protocols) + .filter(p -> p.toLowerCase().startsWith("tls")) + .collect(Collectors.toList()); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } } + static SSLContext sslContext(TrustManagerFactory trustManagerFactory) throws Exception { + return sslContext(() -> SSLContext.getInstance(PROTOCOLS[0]), trustManagerFactory); + } + + static SSLContext sslContext( + CallableSupplier sslContextSupplier, TrustManagerFactory trustManagerFactory) + throws Exception { + SSLContext sslContext = sslContextSupplier.get(); + sslContext.init( + null, trustManagerFactory == null ? null : trustManagerFactory.getTrustManagers(), null); + return sslContext; + } + + static TrustManagerFactory trustManagerFactory(Certificate certificate) throws Exception { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, null); + keyStore.setCertificateEntry("some-certificate", certificate); + TrustManagerFactory trustManagerFactory = + TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + trustManagerFactory.init(keyStore); + return trustManagerFactory; + } + + static X509Certificate caCertificate() throws Exception { + return loadCertificate(caCertificateFile()); + } + + static String caCertificateFile() { + return tlsArtefactPath( + System.getProperty("ca.certificate", "./rabbitmq-configuration/tls/ca_certificate.pem")); + } + + static X509Certificate clientCertificate() throws Exception { + return loadCertificate(clientCertificateFile()); + } + + static String clientCertificateFile() { + return tlsArtefactPath( + System.getProperty( + "client.certificate", + "./rabbitmq-configuration/tls/client_" + hostname() + "_certificate.pem")); + } + + static X509Certificate loadCertificate(String file) throws Exception { + try (FileInputStream inputStream = new FileInputStream(file)) { + CertificateFactory fact = CertificateFactory.getInstance("X.509"); + return (X509Certificate) fact.generateCertificate(inputStream); + } + } + + private static String tlsArtefactPath(String in) { + return in.replace("$(hostname)", hostname()).replace("$(hostname -s)", hostname()); + } + + private static String hostname() { + try { + return InetAddress.getLocalHost().getHostName(); + } catch (UnknownHostException e) { + return Host.hostname(); + } + } + @FunctionalInterface - interface CallableSupplier { + interface CallableSupplier { T get() throws Exception; } diff --git a/src/test/java/com/rabbitmq/tools/Host.java b/src/test/java/com/rabbitmq/tools/Host.java index 96cf6b0dac..5304e120c1 100644 --- a/src/test/java/com/rabbitmq/tools/Host.java +++ b/src/test/java/com/rabbitmq/tools/Host.java @@ -42,6 +42,14 @@ public class Host { private static final String DOCKER_PREFIX = "DOCKER:"; private static final Pattern CONNECTION_NAME_PATTERN = Pattern.compile("\"connection_name\",\"(?[a-zA-Z0-9\\-]+)?\""); + public static String hostname() { + try { + return executeCommand("hostname").output(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + public static String capture(InputStream is) throws IOException { @@ -189,17 +197,6 @@ public static void clearResourceAlarm(String source) throws IOException { rabbitmqctl("eval 'rabbit_alarm:clear_alarm({resource_limit, " + source + ", node()}).'"); } - public static ProcessState invokeMakeTarget(String command) throws IOException { - File rabbitmqctl = new File(rabbitmqctlCommand()); - return executeCommand(makeCommand() + - " -C \'" + rabbitmqDir() + "\'" + - " RABBITMQCTL=\'" + rabbitmqctl.getAbsolutePath() + "\'" + - " RABBITMQ_NODENAME=\'" + nodenameA() + "\'" + - " RABBITMQ_NODE_PORT=" + node_portA() + - " RABBITMQ_CONFIG_FILE=\'" + config_fileA() + "\'" + - " " + command); - } - public static void startRabbitOnNode() throws IOException { rabbitmqctl("start_app"); tryConnectFor(10_000); @@ -210,7 +207,7 @@ public static void stopRabbitOnNode() throws IOException { } public static void tryConnectFor(int timeoutInMs) throws IOException { - tryConnectFor(timeoutInMs, node_portA() == null ? 5672 : Integer.valueOf(node_portA())); + tryConnectFor(timeoutInMs, 5672); } public static void tryConnectFor(int timeoutInMs, int port) throws IOException { @@ -245,15 +242,6 @@ public static String nodenameA() return System.getProperty("test-broker.A.nodename"); } - public static String node_portA() - { - return System.getProperty("test-broker.A.node_port"); - } - - public static String config_fileA() - { - return System.getProperty("test-broker.A.config_file"); - } public static String nodenameB() { @@ -265,11 +253,6 @@ public static String node_portB() return System.getProperty("test-broker.B.node_port"); } - public static String config_fileB() - { - return System.getProperty("test-broker.B.config_file"); - } - public static String rabbitmqctlCommand() { String rabbitmqCtl = System.getProperty("rabbitmqctl.bin"); if (rabbitmqCtl == null) { @@ -291,11 +274,6 @@ public static boolean isOnDocker() { return rabbitmqCtl.startsWith(DOCKER_PREFIX); } - public static String rabbitmqDir() - { - return System.getProperty("rabbitmq.dir"); - } - public static void closeConnection(String pid) throws IOException { rabbitmqctl("close_connection '" + pid + "' 'Closed via rabbitmqctl'"); } diff --git a/src/test/resources/config.properties b/src/test/resources/config.properties deleted file mode 100644 index 6562e2f80e..0000000000 --- a/src/test/resources/config.properties +++ /dev/null @@ -1,3 +0,0 @@ -broker.hostname=localhost -broker.port=5672 -broker.sslport=5671 diff --git a/src/test/resources/hare@localhost.config b/src/test/resources/hare@localhost.config deleted file mode 100644 index 41667a9c70..0000000000 --- a/src/test/resources/hare@localhost.config +++ /dev/null @@ -1,15 +0,0 @@ -% vim:ft=erlang: - -[ - {rabbit, [ - {ssl_listeners, [5670]}, - {ssl_options, [ - {cacertfile, "${test-tls-certs.dir}/testca/cacert.pem"}, - {certfile, "${test-tls-certs.dir}/server/cert.pem"}, - {keyfile, "${test-tls-certs.dir}/server/key.pem"}, - {verify, verify_peer}, - {fail_if_no_peer_cert, false}, - {honor_cipher_order, true}]}, - {auth_mechanisms, ['PLAIN', 'ANONYMOUS', 'AMQPLAIN', 'EXTERNAL', 'RABBIT-CR-DEMO']} - ]} -]. diff --git a/src/test/resources/log4j2-test.properties b/src/test/resources/log4j2-test.properties deleted file mode 100644 index b7e0a68699..0000000000 --- a/src/test/resources/log4j2-test.properties +++ /dev/null @@ -1,12 +0,0 @@ -status = error -dest = err -name = PropertiesConfig - -appender.console.type = Console -appender.console.name = STDOUT -appender.console.layout.type = PatternLayout -appender.console.layout.pattern = %m%n - -logger.com.rabbitmq.level = info -rootLogger.level = error -rootLogger.appenderRef.stdout.ref = STDOUT \ No newline at end of file diff --git a/src/test/resources/rabbit@localhost.config b/src/test/resources/rabbit@localhost.config deleted file mode 100644 index 9e3b77c94d..0000000000 --- a/src/test/resources/rabbit@localhost.config +++ /dev/null @@ -1,15 +0,0 @@ -% vim:ft=erlang: - -[ - {rabbit, [ - {ssl_listeners, [5671]}, - {ssl_options, [ - {cacertfile, "${test-tls-certs.dir}/testca/cacert.pem"}, - {certfile, "${test-tls-certs.dir}/server/cert.pem"}, - {keyfile, "${test-tls-certs.dir}/server/key.pem"}, - {verify, verify_peer}, - {fail_if_no_peer_cert, false}, - {honor_cipher_order, true}]}, - {auth_mechanisms, ['PLAIN', 'ANONYMOUS', 'AMQPLAIN', 'EXTERNAL', 'RABBIT-CR-DEMO']} - ]} -]. From 0b0cc0adfb5f10b87fcbd3390ad867d00d602c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Wed, 19 Feb 2025 14:35:16 +0100 Subject: [PATCH 607/657] Delete TLS-related groovy scripts (cherry picked from commit 5da298c3f89759040dc4465e467af4d97dcb8704) --- .../scripts/query_test_tls_certs_dir.groovy | 25 ------------------- .../scripts/remove_old_test_keystores.groovy | 8 ------ 2 files changed, 33 deletions(-) delete mode 100644 src/main/scripts/query_test_tls_certs_dir.groovy delete mode 100644 src/main/scripts/remove_old_test_keystores.groovy diff --git a/src/main/scripts/query_test_tls_certs_dir.groovy b/src/main/scripts/query_test_tls_certs_dir.groovy deleted file mode 100644 index 2c86bb8c10..0000000000 --- a/src/main/scripts/query_test_tls_certs_dir.groovy +++ /dev/null @@ -1,25 +0,0 @@ -String[] command = [ - properties['make.bin'], - '-C', properties['rabbitmq.dir'], - '--no-print-directory', - 'show-test-tls-certs-dir', - "DEPS_DIR=${properties['deps.dir']}", -] - -def pb = new ProcessBuilder(command) -pb.redirectErrorStream(true) - -def process = pb.start() - -// We are only interested in the last line of output. Previous lines, if -// any, are related to the generation of the test certificates. -def whole_output = "" -process.inputStream.eachLine { - whole_output += it - project.properties['test-tls-certs.dir'] = it.trim() -} -process.waitFor() -if (process.exitValue() != 0) { - println(whole_output.trim()) - fail("Failed to query test TLS certs directory with command: ${command.join(' ')}") -} diff --git a/src/main/scripts/remove_old_test_keystores.groovy b/src/main/scripts/remove_old_test_keystores.groovy deleted file mode 100644 index e08775e4e0..0000000000 --- a/src/main/scripts/remove_old_test_keystores.groovy +++ /dev/null @@ -1,8 +0,0 @@ -def dir = new File(project.build.directory) - -// This pattern starts with `.*`. This is normally useless and even -// inefficient but the matching doesn't work without it... -def pattern = ~/.*\.keystore$/ -dir.eachFileMatch(pattern) { file -> - file.delete() -} From 847fcda2879f9f9ba6dd507a927c06582bdfd469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Fri, 21 Feb 2025 16:53:18 +0100 Subject: [PATCH 608/657] Set loopback users back to initial value after test (cherry picked from commit 46b245f3601df40444687d08c630b958d57191ee) --- .../test/functional/ConnectionRecovery.java | 2 -- .../client/test/server/LoopbackUsers.java | 22 ++++++++++++++----- src/test/java/com/rabbitmq/tools/Host.java | 4 ++-- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/test/functional/ConnectionRecovery.java b/src/test/java/com/rabbitmq/client/test/functional/ConnectionRecovery.java index 9e871e72a8..8dfb268ae5 100644 --- a/src/test/java/com/rabbitmq/client/test/functional/ConnectionRecovery.java +++ b/src/test/java/com/rabbitmq/client/test/functional/ConnectionRecovery.java @@ -23,7 +23,6 @@ import com.rabbitmq.client.test.BrokerTestCase; import com.rabbitmq.client.test.TestUtils; import com.rabbitmq.tools.Host; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -368,7 +367,6 @@ private void testClientNamedQueueRecoveryWith(String q, boolean noWait) throws I } // bug 26552 - @Disabled @Test public void clientNamedTransientAutoDeleteQueueAndBindingRecovery() throws IOException, InterruptedException, TimeoutException { String q = UUID.randomUUID().toString(); String x = "tmp-fanout"; diff --git a/src/test/java/com/rabbitmq/client/test/server/LoopbackUsers.java b/src/test/java/com/rabbitmq/client/test/server/LoopbackUsers.java index 813e4d23f5..e3bd70a7b6 100644 --- a/src/test/java/com/rabbitmq/client/test/server/LoopbackUsers.java +++ b/src/test/java/com/rabbitmq/client/test/server/LoopbackUsers.java @@ -48,14 +48,26 @@ public class LoopbackUsers { @Test public void loopback() throws IOException, TimeoutException { if (!Host.isOnDocker()) { String addr = findRealIPAddress().getHostAddress(); - assertGuestFail(addr); - Host.rabbitmqctl("eval 'application:set_env(rabbit, loopback_users, []).'"); - assertGuestSucceed(addr); - Host.rabbitmqctl("eval 'application:set_env(rabbit, loopback_users, [<<\"guest\">>]).'"); - assertGuestFail(addr); + String initialValue = getLoopbackUsers(); + try { + setLoopbackUsers("[]"); + assertGuestSucceed(addr); + setLoopbackUsers("[<<\"guest\">>]"); + assertGuestFail(addr); + } finally { + setLoopbackUsers(initialValue); + } } } + private static String getLoopbackUsers() throws IOException { + return Host.rabbitmqctl("eval '{ok, V} = application:get_env(rabbit, loopback_users), V.'").output(); + } + + private static void setLoopbackUsers(String value) throws IOException { + Host.rabbitmqctl(String.format("eval 'application:set_env(rabbit, loopback_users, %s).'", value)); + } + private void assertGuestSucceed(String addr) throws IOException, TimeoutException { succeedConnect("guest", addr); succeedConnect("guest", "localhost"); diff --git a/src/test/java/com/rabbitmq/tools/Host.java b/src/test/java/com/rabbitmq/tools/Host.java index 5304e120c1..ad8799c116 100644 --- a/src/test/java/com/rabbitmq/tools/Host.java +++ b/src/test/java/com/rabbitmq/tools/Host.java @@ -80,7 +80,7 @@ public static ProcessState executeCommand(String command) throws IOException return new ProcessState(pr, inputState, errorState); } - static class ProcessState { + public static class ProcessState { private final Process process; private final InputStreamPumpState inputState; @@ -93,7 +93,7 @@ static class ProcessState { this.errorState = errorState; } - private String output() { + public String output() { return inputState.buffer.toString(); } From 94b9d3b0501dd8f7cc13fb13b5dbdc2ac14f1f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Wed, 5 Mar 2025 11:41:04 +0100 Subject: [PATCH 609/657] Remove unnecessary throws (cherry picked from commit 44c9dc2c86206b725aecad138e2e1a51ef18954d) --- .../com/rabbitmq/client/impl/WorkPoolTests.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/test/java/com/rabbitmq/client/impl/WorkPoolTests.java b/src/test/java/com/rabbitmq/client/impl/WorkPoolTests.java index 19d874ced6..8306c10556 100644 --- a/src/test/java/com/rabbitmq/client/impl/WorkPoolTests.java +++ b/src/test/java/com/rabbitmq/client/impl/WorkPoolTests.java @@ -41,9 +41,8 @@ public class WorkPoolTests { /** * Test add work and remove work - * @throws Exception untested */ - @Test public void basicInOut() throws Exception { + @Test public void basicInOut() { Object one = new Object(); Object two = new Object(); @@ -70,9 +69,8 @@ public class WorkPoolTests { /** * Test add work when work in progress. - * @throws Exception untested */ - @Test public void workInWhileInProgress() throws Exception { + @Test public void workInWhileInProgress() { Object one = new Object(); Object two = new Object(); @@ -98,9 +96,8 @@ public class WorkPoolTests { /** * Test multiple work keys. - * @throws Exception untested */ - @Test public void interleavingKeys() throws Exception { + @Test public void interleavingKeys() { Object one = new Object(); Object two = new Object(); Object three = new Object(); @@ -129,9 +126,8 @@ public class WorkPoolTests { /** * Test removal of key (with work) - * @throws Exception untested */ - @Test public void unregisterKey() throws Exception { + @Test public void unregisterKey() { Object one = new Object(); Object two = new Object(); Object three = new Object(); @@ -154,9 +150,8 @@ public class WorkPoolTests { /** * Test removal of all keys (with work). - * @throws Exception untested */ - @Test public void unregisterAllKeys() throws Exception { + @Test public void unregisterAllKeys() { Object one = new Object(); Object two = new Object(); Object three = new Object(); From 22b1e1bc1da839988310ec6dd5661313c0c9a0d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 00:13:20 +0000 Subject: [PATCH 610/657] Bump opentelemetry.version from 1.47.0 to 1.48.0 Bumps `opentelemetry.version` from 1.47.0 to 1.48.0. Updates `io.opentelemetry:opentelemetry-api` from 1.47.0 to 1.48.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.47.0...v1.48.0) Updates `io.opentelemetry:opentelemetry-sdk-testing` from 1.47.0 to 1.48.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.47.0...v1.48.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing 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 07841d3e39..266011ec59 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ 1.7.36 4.2.30 1.14.4 - 1.47.0 + 1.48.0 2.18.3 1.2.13 5.12.0 From f43ea58b8415f8c500d5ce69836589a87ec1d603 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 00:17:01 +0000 Subject: [PATCH 611/657] 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 266011ec59..d8e32c0a1a 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ true 1.7.36 4.2.30 - 1.14.4 + 1.14.5 1.48.0 2.18.3 1.2.13 From 4c8125a5ee4c40b4a9ca7e6e9ba621ce863ec480 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 00:17:08 +0000 Subject: [PATCH 612/657] 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 266011ec59..e522655812 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 5.12.0 5.16.0 3.27.3 - 1.4.3 + 1.4.4 1.0.4 9.4.57.v20241219 1.80 From 88aced025ad88993a3b516200487414141227d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Thu, 13 Mar 2025 08:37:51 +0100 Subject: [PATCH 613/657] Test against RabbitMQ 4.1 alpha (cherry picked from commit 1765236e36da063775621835db7d565daa81fbec) --- .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 934ccbbdd2..10db388a95 100644 --- a/.github/workflows/test-rabbitmq-alphas.yml +++ b/.github/workflows/test-rabbitmq-alphas.yml @@ -16,7 +16,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 db98b7a15770e9754681b3c3d46c1b006a10b2db Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 00:17:33 +0000 Subject: [PATCH 614/657] 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 81d997417d..98c753f933 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.48.0 2.18.3 1.2.13 - 5.12.0 + 5.12.1 5.16.0 3.27.3 1.4.4 From 80cae5bdd70b58621db3791e1779265db552a8eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 03:09:18 +0000 Subject: [PATCH 615/657] 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 98c753f933..cbffdea1ba 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 2.18.3 1.2.13 5.12.1 - 5.16.0 + 5.16.1 3.27.3 1.4.4 1.0.4 From e00945384ecce559a9ee6b8a78c742361f9d5db4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Mon, 17 Mar 2025 10:33:30 +0100 Subject: [PATCH 616/657] Use -R flag in cp command Compatible MacOS/Linux. (cherry picked from commit 7f105b24f7af6d22a851f320c408c9172bb39f9a) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d9041b2657..f320fd349f 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ $(DEPS_DIR)/rabbitmq_codegen: git clone -n --depth=1 --filter=tree:0 https://github.com/rabbitmq/rabbitmq-server.git $(DEPS_DIR)/rabbitmq-server git -C $(DEPS_DIR)/rabbitmq-server sparse-checkout set --no-cone deps/rabbitmq_codegen git -C $(DEPS_DIR)/rabbitmq-server checkout - cp -r $(DEPS_DIR)/rabbitmq-server/deps/rabbitmq_codegen "$@" + cp -R $(DEPS_DIR)/rabbitmq-server/deps/rabbitmq_codegen "$@" rm -rf $(DEPS_DIR)/rabbitmq-server tests: deps From dff74a4521a16aaae79e4ae41d617a324283248e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 00:10:38 +0000 Subject: [PATCH 617/657] Bump org.sonarsource.scanner.maven:sonar-maven-plugin Bumps [org.sonarsource.scanner.maven:sonar-maven-plugin](https://github.com/SonarSource/sonar-scanner-maven) from 5.0.0.4389 to 5.1.0.4751. - [Release notes](https://github.com/SonarSource/sonar-scanner-maven/releases) - [Commits](https://github.com/SonarSource/sonar-scanner-maven/compare/5.0.0.4389...5.1.0.4751) --- updated-dependencies: - dependency-name: org.sonarsource.scanner.maven:sonar-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 cbffdea1ba..1ab88883ec 100644 --- a/pom.xml +++ b/pom.xml @@ -639,7 +639,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 5.0.0.4389 + 5.1.0.4751 From 367e3486039b425f28b597d86d55bf153ea4e817 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 01:26:53 +0000 Subject: [PATCH 618/657] 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 1ab88883ec..0839d59afb 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ 2.4.21 3.6.0 3.14.0 - 3.5.2 + 3.5.3 3.8.1 3.5.2 3.2.7 From 590fcbd997e2b1e82a37c2d29e6f9ef340876d38 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Mar 2025 01:27:00 +0000 Subject: [PATCH 619/657] Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.5.2 to 3.5.3 Bumps [org.apache.maven.plugins:maven-failsafe-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-failsafe-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 1ab88883ec..ac3f7ce5e7 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ 3.14.0 3.5.2 3.8.1 - 3.5.2 + 3.5.3 3.2.7 3.4.2 5.1.9 From 1ab1f318891abcfd69f0b036487f1eabf37e35b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 00:15:45 +0000 Subject: [PATCH 620/657] Bump opentelemetry.version from 1.48.0 to 1.49.0 Bumps `opentelemetry.version` from 1.48.0 to 1.49.0. Updates `io.opentelemetry:opentelemetry-api` from 1.48.0 to 1.49.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.48.0...v1.49.0) Updates `io.opentelemetry:opentelemetry-sdk-testing` from 1.48.0 to 1.49.0 - [Release notes](https://github.com/open-telemetry/opentelemetry-java/releases) - [Changelog](https://github.com/open-telemetry/opentelemetry-java/blob/main/CHANGELOG.md) - [Commits](https://github.com/open-telemetry/opentelemetry-java/compare/v1.48.0...v1.49.0) --- updated-dependencies: - dependency-name: io.opentelemetry:opentelemetry-api dependency-version: 1.49.0 dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: io.opentelemetry:opentelemetry-sdk-testing dependency-version: 1.49.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 0b039b404f..9bc6dbca12 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ 1.7.36 4.2.30 1.14.5 - 1.48.0 + 1.49.0 2.18.3 1.2.13 5.12.1 From cd49fc00eab5895ca5f36fbe8282e691c5fb0d98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 00:15:54 +0000 Subject: [PATCH 621/657] 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 0b039b404f..d88b9a8f54 100644 --- a/pom.xml +++ b/pom.xml @@ -62,7 +62,7 @@ 2.18.3 1.2.13 5.12.1 - 5.16.1 + 5.17.0 3.27.3 1.4.4 1.0.4 From a9b08cdae2470cdd6417c4161c950804adae7f18 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Apr 2025 01:37:08 +0000 Subject: [PATCH 622/657] 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 eba8d3d704..e872557fbf 100644 --- a/pom.xml +++ b/pom.xml @@ -90,7 +90,7 @@ 1.7.0 1.11 1.4 - 2.44.3 + 2.44.4 1.19.2 - - milestone - - - - org.apache.maven.plugins - maven-javadoc-plugin - ${maven.javadoc.plugin.version} - - ${javadoc.opts} - ${javadoc.joption} - true - 8 - - - - - jar - - - - - - - net.nicoulaj.maven.plugins - checksum-maven-plugin - ${checksum.maven.plugin.version} - - - sign-artifacts - package - - files - - - - - ${project.build.directory} - - *.jar - *.pom - - - - - MD5 - SHA-1 - - - - - - - - org.apache.maven.plugins - maven-gpg-plugin - ${maven.gpg.plugin.version} - - - sign-artifacts - package - - sign - - - ${gpg.keyname} - - - - - - - - - packagecloud-rabbitmq-maven-milestones - packagecloud+https://packagecloud.io/rabbitmq/maven-milestones - - - mockito-4-on-java-8 @@ -907,14 +798,18 @@ + + org.sonatype.central + central-publishing-maven-plugin + ${central-publishing-maven-plugin.version} + true + + central + true + + + - - - io.packagecloud.maven.wagon - maven-packagecloud-wagon - ${maven.packagecloud.wagon.version} - - From 6ac5e5ec1fc9402a2c761f4a4824136cea197304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= <514737+acogoluegnes@users.noreply.github.com> Date: Fri, 13 Jun 2025 09:36:24 +0200 Subject: [PATCH 653/657] Disable auto-publish --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 22f8b8e665..489d39126e 100644 --- a/pom.xml +++ b/pom.xml @@ -805,7 +805,7 @@ true central - true + false From e08e5f71ebe59d66d32fa6ee6c589eba6dedf9a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jun 2025 00:37:41 +0000 Subject: [PATCH 654/657] Bump com.fasterxml.jackson.core:jackson-databind from 2.19.0 to 2.19.1 Bumps [com.fasterxml.jackson.core:jackson-databind](https://github.com/FasterXML/jackson) from 2.19.0 to 2.19.1. - [Commits](https://github.com/FasterXML/jackson/commits) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-version: 2.19.1 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 489d39126e..34a7ddf8b0 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 4.2.32 1.15.1 1.51.0 - 2.19.0 + 2.19.1 1.2.13 5.13.1 5.18.0 From 8762c06551a53b247b1e5ea704bfba44c2de614a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Jun 2025 00:45:42 +0000 Subject: [PATCH 655/657] Bump org.sonatype.central:central-publishing-maven-plugin Bumps [org.sonatype.central:central-publishing-maven-plugin](https://github.com/sonatype/central-publishing-maven-plugin) from 0.7.0 to 0.8.0. - [Commits](https://github.com/sonatype/central-publishing-maven-plugin/commits) --- updated-dependencies: - dependency-name: org.sonatype.central:central-publishing-maven-plugin dependency-version: 0.8.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 34a7ddf8b0..c20763a131 100644 --- a/pom.xml +++ b/pom.xml @@ -87,7 +87,7 @@ 3.4.2 5.1.9 1.11 - 0.7.0 + 0.8.0 1.4 2.44.5 1.19.2 From 34429fec24ba4058b80d17b3ed515480dcdf792b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jun 2025 01:01:03 +0000 Subject: [PATCH 656/657] Bump io.dropwizard.metrics:metrics-core from 4.2.32 to 4.2.33 Bumps [io.dropwizard.metrics:metrics-core](https://github.com/dropwizard/metrics) from 4.2.32 to 4.2.33. - [Release notes](https://github.com/dropwizard/metrics/releases) - [Commits](https://github.com/dropwizard/metrics/compare/v4.2.32...v4.2.33) --- updated-dependencies: - dependency-name: io.dropwizard.metrics:metrics-core dependency-version: 4.2.33 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 c20763a131..724c57984b 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ true 1.7.36 - 4.2.32 + 4.2.33 1.15.1 1.51.0 2.19.1 From 479c39d625d178cb2d2151445ab268a4d45bfda5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 00:08:49 +0000 Subject: [PATCH 657/657] Bump org.junit:junit-bom from 5.13.1 to 5.13.2 Bumps [org.junit:junit-bom](https://github.com/junit-team/junit-framework) from 5.13.1 to 5.13.2. - [Release notes](https://github.com/junit-team/junit-framework/releases) - [Commits](https://github.com/junit-team/junit-framework/compare/r5.13.1...r5.13.2) --- updated-dependencies: - dependency-name: org.junit:junit-bom dependency-version: 5.13.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 724c57984b..f3066cf6e9 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 1.51.0 2.19.1 1.2.13 - 5.13.1 + 5.13.2 5.18.0 3.27.3 1.5.1 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy