Table of Contents

Vert.x - The launcher run command

About

The run command (Code) is a command of the launcher.

It will:

Example

Vertx command line

Via the vertx command line

cd /verticles # the location of the verticle jar
vertx run io.vertx.sample.RandomGeneratorVerticle 
    -cp /verticles/MY_VERTICLE.jar 

Fat jar

Via a fat jar

java -jar my-vertx-fat.jar run \
    -cluster \
    -conf myconf.json \
    -cp path/to/dir/conf/cluster_xml

Docker

Via the docker vertx-exec image

docker run -i -t -p 8080:8080 \ 
    -v $PWD:/verticles vertx/vertx3-exec \  
    run io.vertx.sample.RandomGeneratorVerticle \ 
    -cp /verticles/MY_VERTICLE.jar 

Syntax

Runs a Verticle called <main-verticle> in its own instance of vert.x.

(launcher) run \
    [-cp <classpath>] \ 
    [--cluster] \
    [--cluster-host <host>] \
    [--cluster-port <port>] \
    [--cluster-public-host <public-host>] \
    [--cluster-public-port <public-port>] \
    [--conf <config>]  \
    [--ha] \
    [--hagroup <group>] \
    [--instances <instances>] \
    [--on-redeploy <cmd>] \
    [--options <options>] \ #vertx options
    [--quorum <q>] \
    [--redeploy <includes>] \
    [--redeploy-grace-period <period>] \
    [--redeploy-scan-period <period>] \
    [--redeploy-termination-period <period>]  \
    [--worker] \
    main-verticle

where:

Launcher

Cluster

Vertx

There is a mapping between system properties and Vert.x Options as in:

-Dvertx.options.workerPoolSize=20 

Verticle

The deployment options of the main verticle can also be configured from system properties:

-Dvertx.deployment.options.worker=true
-Dvertx.deployment.options.instances=2 # 1 by default

High Avaibility

Hot deployment

Vert.x - Hot reloading / Live redeploy