Skip to content

Commit 6a5559f

Browse files
authored
Deployment options set via sys props are ignored (#28)
Follows-up on eclipse-vertx/vert.x#5575 Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
1 parent 6fee7f7 commit 6a5559f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

cli/src/main/java/io/vertx/core/impl/launcher/commands/BareCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ protected EventBusOptions getEventBusOptions(JsonObject jsonObject) {
423423
return eventBusOptions;
424424
}
425425

426-
private static final ThreadLocal<Logger> configureFromSystemProperties = new ThreadLocal<>();
426+
protected static final ThreadLocal<Logger> configureFromSystemProperties = new ThreadLocal<>();
427427

428428
/**
429429
* This is used as workaround to retain the existing behavior of the Vert.x CLI and won't be executed

cli/src/main/java/io/vertx/core/impl/launcher/commands/RunCommand.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
import io.vertx.core.cli.CLIException;
1616
import io.vertx.core.cli.CommandLine;
1717
import io.vertx.core.cli.annotations.*;
18-
import io.vertx.core.internal.VertxInternal;
1918
import io.vertx.core.impl.launcher.VertxLifecycleHooks;
19+
import io.vertx.core.internal.VertxInternal;
2020
import io.vertx.core.json.JsonObject;
2121
import io.vertx.core.spi.launcher.ExecutionContext;
2222

@@ -254,8 +254,16 @@ public void run() {
254254
}
255255

256256
deploymentOptions = new DeploymentOptions();
257-
configureFromSystemProperties(deploymentOptions, DEPLOYMENT_OPTIONS_PROP_PREFIX);
258-
deploymentOptions.setConfig(conf).setThreadingModel(worker ? ThreadingModel.WORKER : ThreadingModel.EVENT_LOOP).setHa(ha).setInstances(instances);
257+
configureFromSystemProperties.set(log);
258+
try {
259+
configureFromSystemProperties(deploymentOptions, DEPLOYMENT_OPTIONS_PROP_PREFIX);
260+
} finally {
261+
configureFromSystemProperties.set(null);
262+
}
263+
deploymentOptions.setConfig(conf).setHa(ha).setInstances(instances);
264+
if (worker) {
265+
deploymentOptions.setThreadingModel(ThreadingModel.WORKER);
266+
}
259267
beforeDeployingVerticle(deploymentOptions);
260268
deploy();
261269
} else {

0 commit comments

Comments
 (0)