Skip to content

Commit e3dca13

Browse files
committed
Add --no-dev-mode flag
To force the usage of the default address resolver and avoid problems with local clusters.
1 parent 0bb2502 commit e3dca13

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/main/java/com/rabbitmq/stream/perf/StreamPerfTest.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,12 @@ public class StreamPerfTest implements Callable<Integer> {
452452
defaultValue = "false")
453453
private boolean forceReplicaForConsumers;
454454

455+
@CommandLine.Option(
456+
names = {"--no-dev-mode", "-ndm"},
457+
description = "do not use development mode (useful for local cluster)",
458+
defaultValue = "false")
459+
private boolean noDevMode;
460+
455461
static class InstanceSyncOptions {
456462

457463
@CommandLine.Option(
@@ -757,8 +763,14 @@ public Integer call() throws Exception {
757763
shutdownService.wrap(
758764
closeStep("Closing environment executor", () -> envExecutor.shutdownNow()));
759765

760-
boolean tls = isTls(this.uris);
761766
AddressResolver addrResolver = null;
767+
if (this.noDevMode) {
768+
// we override the default address resolver with an instance that does the same thing
769+
// the client library will not activate the development mode because of this
770+
addrResolver = a -> a;
771+
}
772+
773+
boolean tls = isTls(this.uris);
762774
if (loadBalancer) {
763775
int defaultPort = tls ? Client.DEFAULT_TLS_PORT : Client.DEFAULT_PORT;
764776
List<Address> addresses =

0 commit comments

Comments
 (0)