Skip to content

Instantly share code, notes, and snippets.

@percyvega
Last active October 6, 2021 02:02
Show Gist options
  • Save percyvega/e362c195310c89661970309ab4d223fa to your computer and use it in GitHub Desktop.
Save percyvega/e362c195310c89661970309ab4d223fa to your computer and use it in GitHub Desktop.

Vert.x is a toolkit to build reactive and distributed systems.

It's a server API for writing asynchronous networking applications (e.g. for db connectivity, monitoring, authentication, service discovery, clustering, etc.)

You can use Vert.x callback-based API exclusively, but Vert.x also implements an equivalent Rxified API using RxJava under the hood. This provides a great platform to integrate Vert.x modules within RxJava applications.

Vert.x provides fluent HTTP endpoints and route configuration backed by handlers where the business logic is implemented. But the real nervous system is the event bus that acts as a telecom provider to all Vert.x local or distributed components.

Its event-bus supports:

- Communication modes:
	1) Point-to-point
	2) Request-response
	3) Pub-sub messaging
- Unclustered communication between polyglot verticles within the same JVM instance
- Clustered communication between polyglot verticles in multiple JVM instances
- Bridge to Stomp or AMQP implementations for integration with other applications
- Bridge to SockJS for direct integration with Javascript frontends

The event-bus is supported by:

- Cluster managers such as Hazelcast, InfiniSpan, Ignite or ZooKeeper that provides distributed Maps, Locks, and Counters through a higher-level API access
- Vert.x service discovery API providing an address based abstraction to underlying complex addressing schemes
- SSL capable TCP service access points for bi-directional secured communication and maximum performance

Event Loop (Standard) verticles

- Drawn from the event-loop pool, which has 2 x Cores threads
- Always the same thread per verticle, which may have any number of threads.

Worker verticles are drawn from the workers pool; not always the same thread per verticle.

An even loop (never-to-be-blocked) verticle assigns work to a (likely) blocking worker verticle which then alerts the event loop verticle of its completion via a handler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment