How to pass VertxOptions from the command line (e.g. workflows)

How to pass VertxOptions from the command line (e.g. workflows)?

I'm talking about something like this:

java -jar fat.jar --workerThreads 40

or

vertx run server.js --workerThreads 40

This parameter is not mentioned in the manual or API.

Is there any way to do this?

I know there is an API:

var Vertx = require("vertx-js/vertx");
var vertx = Vertx.vertx({
    "workerPoolSize" : 40
});

But when I use this API, I get a warning from Vertx:

You're already on a Vert.x context, are you sure you want to create a new Vertx instance?

So, I think I'm doing something wrong ...

+4
source share
1 answer

You need to specify it as a system property with the prefix vertx.options.

So for a thick can it will be:

java -jar fat.jar -Dvertx.options.workerThreads 40

As for the properties you can set, everything that a parameter in VertxOptions has has a corresponding property name: the name of the installer without the "set" part.

, :

options.setClusterPort(5555)

-Dvertx.options.clusterPort

.

, "vertx.options" .

0

Source: https://habr.com/ru/post/1615447/


All Articles