Vert.x - Launcher class

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:

This class is used as the main class and wrapped by:

Ide Configuration

Idea Run

For instance to run a verticle in IDEA, you would configure this run.

_

Implementation

io/vertx/core/Launcher 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)

See Vertx - Launcher extension (Custom launcher)

Command

Commands

  • run - Start a Vert.x instance and deploy a verticle
  • start - Start a Vertx application in the background
  • stop - Stop a background application
  • list - List the background application

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

Powered by ComboStrap