Java - Vert.X Framework

Java Conceptuel Diagram

About

Vert.x is not a framework but a toolkit: the core library defines the fundamental APIs for writing asynchronous networked applications, and then you can pick the useful modules for your application (e.g., database connection, monitoring, authentication, logging, service discovery, clustering support, etc).

Vert.x:

Usage

  • high volume message
  • event processing,
  • micro-services,
  • API gateways,
  • HTTP APIs for mobile applications,
  • etc

Concept

Three concepts:

  • Vertx - The core instance that allows:
    • high availability (HA) support. 1)
    • reference to the event bus,
    • setting timers,
    • calls the handlers using the event loop thread (Reactor pattern)
  • verticle - the actors deployed on Vertx
  • event bus - the bus that allows verticles to communicate

App

  • Verticle
package examples.vertx;

import io.vertx.core.AbstractVerticle;
import io.vertx.core.Future;

public class MyVerticle extends AbstractVerticle {

    @Override
    public void start(Future<Void> startFuture) {
        System.out.println("MyVerticle started!");
    }

    @Override
    public void stop(Future stopFuture) throws Exception {
        System.out.println("MyVerticle stopped!");
    }

}
  • Main
import io.vertx.core.Vertx;

public class VertxApp {

    public static void main(String[] args) {
        Vertx vertx = Vertx.vertx();
        vertx.deployVerticle(new MyVerticle());
    }

}





Discover More
Java Conceptuel Diagram
Vert.x - Http Client

in Vert.x LowLevel: io/vertx/core/VertxVertx - Http Client HigLevel: WebCli (io/vertx/ext/web/client/WebClient)
Java Conceptuel Diagram
Vert.x - Promise/Future

promise and future in Vert.x Do not confuse futures with promises. futures represent the “read-side” of an asynchronous result, promises represent the “write-side”. They allow you to defer...
Java Conceptuel Diagram
Vert.x - Timed out Exception when testing

This is a really common error when you start with Vert.x and I lost a couple of hours on that many times. I figure out, I will put it available to everybody. If you get an error like that when you are...
Java Conceptuel Diagram
Vert.x - Verticle

Verticles are the technical units of deployments of code in Vert.x. Verticles share certain similarities with actors in the actor model. Verticles communicate with each other by generating messages...
Web - Framework

This framework provides an http server with at minimal a routing capability and adds above other features such as: templating authentication Framework Description Languages Vertx The reactive...
Card Puncher Data Processing
What is an Event Loop?

An Event loop is a thread that waits for and dispatches events or messages that may contains: data or runnable code An event loop is also known as: message dispatcher, message loop, message...



Share this page:
Follow us:
Task Runner