Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
src
README.md
pom.xml
run.sh

README.md

Worker Verticle

This example shows the use of worker verticle. A word you send with the HTTP Post request over the http://localhost:8080/get/:message is saved to a text file that's located under recources directory.

   final Vertx vertx = Vertx.vertx();
        final DeploymentOptions options = new DeploymentOptions().setWorker(true)
                .setWorkerPoolSize(DEFAULT_WORKER_POOL_SIZE);
        vertx.deployVerticle(new WorkerVerticle(), options, res -> {
            if (res.succeeded()) {
                log.info("Deployment id is: " + res.result());
            } else {
                log.info("Deployment failed!");
            }
        });

Requirements

  • JDK 8 or later
  • Maven 3.0.0 or later

To compile

mvn celan install

To run

java -jar target/workerVerticleLauncher.jar -worker

Or

sh run.sh

Relevant article is

How to Run Blocking Code in Vert.x