Skip to content

Commit

Permalink
Add --no-dev-mode flag
Browse files Browse the repository at this point in the history
To force the usage of the default address resolver and avoid problems
with local clusters.
  • Loading branch information
acogoluegnes committed Nov 4, 2024
1 parent 0bb2502 commit e3dca13
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/java/com/rabbitmq/stream/perf/StreamPerfTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,12 @@ public class StreamPerfTest implements Callable<Integer> {
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(
Expand Down Expand Up @@ -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<Address> addresses =
Expand Down

0 comments on commit e3dca13

Please sign in to comment.