About
The Vertx launcher is one of the two way to start an application
It is a launcher class that wraps the management of a vertx instance and the deployment of a main verticle.
It can be used:
- to manage a Vert.x application (run, start, stop, list) (in the foreground with the run command or in the background with the start command)
- to run a bare Vert.x instance.
This class is used as the main class and wrapped by:
- the vertx command line.
Ide Configuration
Idea Run
For instance to run a verticle in IDEA, you would configure this run.
Implementation
docs/apidocs/io/vertx/core/Launcher.html can be seen as a standard version of a main class
Custom
You may extends the launcher to execute code at some lifecycle endpoints (before/after creating a vertx, before/after verticle deployment)
Command
Run
Start
java -jar my-verticle-fat.jar start --vertx-id=my-app-name
where:
- vertx-id : the application id, uses a random UUID if not set
- java-opts : the Java Virtual Machine options, uses the JAVA_OPTS environment variable if not set. As the start command spawns a new process, the java options passed to the JVM are not propagated, so you must use java-opts to configure the JVM (-X, -D…).
- redirect-output : redirect the spawned process output and error streams to the parent process streams.
Stop
java -jar my-verticle-fat.jar stop my-app-name
List
java -jar my-verticle-fat.jar list