Skip to main content

Posts

Showing posts from June, 2019

vertx command line parameters

How to pass command line parameters to "vertx run"ContextI'm using continuous delivery and need to checkout a git branch then launch the verticle with a parameter.
For example:
I chekcout the "demo" git branchI deploy it to the target I remotely run the verticle with "vertx run 'demo'" (this actually doesn't work, but it illustrates my needs)The solution: use system environment variablesThe documentation https://vertx.io/docs/vertx-config/java/ is mentionning it, but it was not straight to me, so here is precisely how I did:
package org.rktmb.vertx // ... import io.vertx.config.ConfigStoreOptions; import io.vertx.config.ConfigRetriever; import io.vertx.config.ConfigRetrieverOptions; // ... public class MainVerticle extends SyncVerticle { @Override public void start(Future startFuture) throws Exception { // ... ConfigStoreOptions jsonEnvConfig = new ConfigStoreOptions().setType("env") .setConfig(new Js…