From e3dca131622401b62085b20ea5646e1dd39aa92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Cogolu=C3=A8gnes?= Date: Mon, 4 Nov 2024 15:52:41 +0100 Subject: [PATCH] Add --no-dev-mode flag To force the usage of the default address resolver and avoid problems with local clusters. --- .../com/rabbitmq/stream/perf/StreamPerfTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rabbitmq/stream/perf/StreamPerfTest.java b/src/main/java/com/rabbitmq/stream/perf/StreamPerfTest.java index 658a037..00f8208 100644 --- a/src/main/java/com/rabbitmq/stream/perf/StreamPerfTest.java +++ b/src/main/java/com/rabbitmq/stream/perf/StreamPerfTest.java @@ -452,6 +452,12 @@ public class StreamPerfTest implements Callable { defaultValue = "false") private boolean forceReplicaForConsumers; + @CommandLine.Option( + names = {"--no-dev-mode", "-ndm"}, + description = "do not use development mode (useful for local cluster)", + defaultValue = "false") + private boolean noDevMode; + static class InstanceSyncOptions { @CommandLine.Option( @@ -757,8 +763,14 @@ public Integer call() throws Exception { shutdownService.wrap( closeStep("Closing environment executor", () -> envExecutor.shutdownNow())); - boolean tls = isTls(this.uris); AddressResolver addrResolver = null; + if (this.noDevMode) { + // we override the default address resolver with an instance that does the same thing + // the client library will not activate the development mode because of this + addrResolver = a -> a; + } + + boolean tls = isTls(this.uris); if (loadBalancer) { int defaultPort = tls ? Client.DEFAULT_TLS_PORT : Client.DEFAULT_PORT; List
addresses =