GithubHelp home page GithubHelp logo

simple-vertx-verticle-maven's Introduction

Vert.x Simple Maven Verticle project

This project is very similar to the maven-simplest project but instead of embedding Vert.x it shows an example of writing the code as a verticle.

You can run it directly in your IDE by creating a run configuration that uses the main class io.vertx.core.Launcher, passes in the arguments run io.vertx.example.HelloWorldVerticle, and specify using the classpath of module maven-verticle.

The pom.xml uses the Maven shade plugin to assemble the application and all it’s dependencies into a single "fat" jar.

To build a "fat jar"

mvn package

To run the fat jar:

java -jar target/maven-verticle-4.3.1-fat.jar

(You can take that jar and run it anywhere there is a Java 8+ JRE. It contains all the dependencies it needs so you don’t need to install Vert.x on the target machine).

Now point your browser at http://localhost:8080

The application can be launched directly from Maven:

  • to run it using the classes form target/classes: mvn compile exec:java@run

  • to run the fat jar: mvn package exec:exec@run-app

Writing code in verticles allow you to scale it more easily, e.g. let’s say you have 8 cores on your server and you want to utilize them all, you can deploy 8 instances as follows:

java -jar target/maven-verticle-4.3.1-fat.jar -instances 8

You can also enable clustering and ha at the command line, e.g.

java -jar target/maven-verticle-4.3.1-fat.jar -cluster
java -jar target/maven-verticle-4.3.1-fat.jar -ha

You can also pass a configuration to the verticle:

java -jar target/maven-verticle-4.3.1-fat.jar -conf src/conf/my-conf.json

Please see the docs for a full list of Vert.x command line options.

simple-vertx-verticle-maven's People

Contributors

sandeepnegi1996 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.