SlideShare a Scribd company logo
Vert.x – Event Driven Non Blocking Reactive Toolkit
Brian S Paskin, Senior Application Architect, R&D Services, IBM Cloud Innovations Lab
6 April 2020
WebSphere Liberty Lunch and Learn
Introduction
2
 Vert.x is an open source project by the Eclipse Foundation
 Is a reactive toolkit that can used as a serverless implementation or in an application
 Used for writing asynchronous network applications
 Supported under multiple Java based languages (polyglot)
– Java, Kotlin, JavaScript, Groovy, Ruby, Scala
 Has two programming methods, with or without Verticles (spelled that way)
 There are different libraries for databases, monitoring, logging, et cetera
 Non blocking and event driven that is scalable using an Event Bus
– Uses an Event Loop to process requests
– Event Bus to handle communications between Verticles
– Can span multiple JVMs and systems
 Can be used with Quarkus and GraalVM
 Requires Maven Shade to create a fat jar
Introduction
3
Event Loop
4
 Implementation of the multi Reactor design pattern
– Continuously checking for new events and pass it to the proper Handler
– Normal Reactor is single threaded, but Vert.x is multi-threaded
 Number of threads for the Event Loop depends on the number of processors
– Is equal to 2 * number of processors
– Not based on the number of Verticles deployed
– Threads are assigned in a round robin method for Verticles
 Verticles will always execute on the assigned thread
 Worker Verticles have their own thread pools
 The Context is passed to the Verticle from the Event Loop
– All Handlers in an Event Loop run using the same Context
– Each Context has its own error handler
– Maintains thread safety
 Never block the event loop
Event Loop, Contexts, and Verticles
5
Verticles
6
 A Verticle is a unit of deployment
 Assigned a Thread in an Event Loop
 Each Verticle has an isolated classloader and cannot share global state
 Verticles can be passed configuration information
 2 Different Types of Verticles
– Standard
– Workers
 A standard Verticle should be quick and a non blocking unit of work
 A worker Verticle is like a standard Verticle but using a different Thread pool
– Can call blocking code
– Used for limiting number of executions of code (ie. calling backend system)
 Can be run in high available mode
– Deploys new Verticle if it dies abruptly
Event Bus
7
 The Event Bus is used for Verticles to communicate with each other by sending messages
– Single instance per Vert.x instance
– Asynchronous
 Can be used with Verticles in the same JVM or across multiple JVMs and systems
– Outside of a single JVM Hazelcast is used to transport messages
 Can be used to communicate with JavaScript
 Three types of messaging
– Publish and subscribe
– Point to point
– Request – response
 Failures in all or part of the Event Bus may lead to lost messages
Introduction
8
Common Libraries Highlights
9
 Core
– Deploy Verticles
– HTTP Server
– Basic Event Bus
– Logging
– JSON and Parser
– Datagrams
– Metrics
– High availability and failover
– Timer events
– Buffers
 Web
– Route requests to Handlers and sub routers
– Routing based on criteria (HTTP Method, MIME type, etc.)
– Authentication (OAuth, Basic)
– Serve web pages
– CORS
– Uploads
– Cookie Handling
– Form handling
– Virtual hosts
– SockJS support
Common Libraries Highlights
10
 Configuration
– Multiple formats (JSON, Properties, YAML, HOCON, System Props, Environment Entries, etc.)
– Can read default configuration file or specify file
– Different configurations can be passed to different Verticles
 JDBC Client
 MongoDB Client
 SQL Common
– Used in conjunction of one of the other data access libraries
 Reactive
– Uses RxJava
 Circuit Breaks for Micro Services
 MQTT
 Kafka Client
 Mail Client
More information
11
 Sample code on GitHub
 Libraries
 Build a starter application
Vert.x Event Driven Non Blocking Reactive Toolkit

More Related Content

PDF
Kernel Recipes 2019 - XDP closer integration with network stack
PDF
Wireless Deauth and Disassociation Attacks explained
PPTX
Hypervisors
PDF
Linux Linux Traffic Control
PDF
Cloud Network Virtualization with Juniper Contrail
PDF
Advanced Networking: The Critical Path for HPC, Cloud, Machine Learning and more
PPTX
Kernel Proc Connector and Containers
PDF
Swift message reference guide
Kernel Recipes 2019 - XDP closer integration with network stack
Wireless Deauth and Disassociation Attacks explained
Hypervisors
Linux Linux Traffic Control
Cloud Network Virtualization with Juniper Contrail
Advanced Networking: The Critical Path for HPC, Cloud, Machine Learning and more
Kernel Proc Connector and Containers
Swift message reference guide

What's hot (11)

PDF
Ripe71 FastNetMon open source DoS / DDoS mitigation
PDF
LXC, Docker, security: is it safe to run applications in Linux Containers?
PPTX
Introduction to CXL Fabrics
PPTX
Ibm spectrum scale fundamentals workshop for americas part 4 spectrum scale_r...
PPT
Cs423 raw sockets_bw
PDF
WebSphere MQ CHLAUTH - including V8 changes
PDF
Open vSwitch Offload: Conntrack and the Upstream Kernel
PDF
IBM MQ High Availabillity and Disaster Recovery (2017 version)
ODP
Dpdk performance
PPTX
network performance measurement using Iperf
PDF
Task migration using CRIU
Ripe71 FastNetMon open source DoS / DDoS mitigation
LXC, Docker, security: is it safe to run applications in Linux Containers?
Introduction to CXL Fabrics
Ibm spectrum scale fundamentals workshop for americas part 4 spectrum scale_r...
Cs423 raw sockets_bw
WebSphere MQ CHLAUTH - including V8 changes
Open vSwitch Offload: Conntrack and the Upstream Kernel
IBM MQ High Availabillity and Disaster Recovery (2017 version)
Dpdk performance
network performance measurement using Iperf
Task migration using CRIU
Ad

Similar to Vert.x Event Driven Non Blocking Reactive Toolkit (20)

PPTX
PPTX
Vert.x for Microservices Architecture
PDF
Vert.X like Node.js but polyglot and reactive on JVM
PDF
Vert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
PPTX
Vert.x v3 - high performance polyglot application toolkit
ODP
Groovy & Grails eXchange 2012 vert.x presentation
PPTX
Building microservices with vert.x 3.0
PDF
Vert.x - Dessì
PPTX
Vert.x devoxx london 2013
PDF
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
PPTX
Event driven systems
PPT
JUDCon Brazil 2013 - Vert.x an introduction
PDF
BASICS OF VERT.X - A toolkit for building asynchronous and reactive app
PDF
Development with Vert.x: an event-driven application framework for the JVM
PDF
Vertx In Action Asynchronous And Reactive Java Julien Ponge
PDF
Vert.x introduction
ODP
Vert.x keynote for EclipseCon 2013
PDF
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
PDF
Building Reactive Microservices with Vert.x
Vert.x for Microservices Architecture
Vert.X like Node.js but polyglot and reactive on JVM
Vert.x - Tehran JUG meeting Aug-2014 - Saeed Zarinfam
Vert.x v3 - high performance polyglot application toolkit
Groovy & Grails eXchange 2012 vert.x presentation
Building microservices with vert.x 3.0
Vert.x - Dessì
Vert.x devoxx london 2013
Introducing Vert.x 2.0 - Taking polyglot application development to the next ...
Event driven systems
JUDCon Brazil 2013 - Vert.x an introduction
BASICS OF VERT.X - A toolkit for building asynchronous and reactive app
Development with Vert.x: an event-driven application framework for the JVM
Vertx In Action Asynchronous And Reactive Java Julien Ponge
Vert.x introduction
Vert.x keynote for EclipseCon 2013
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
Building Reactive Microservices with Vert.x
Ad

Recently uploaded (20)

PDF
Paper PDF World Game (s) Great Redesign.pdf
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PDF
SASE Traffic Flow - ZTNA Connector-1.pdf
PPTX
Digital Literacy And Online Safety on internet
PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PDF
Introduction to the IoT system, how the IoT system works
PPTX
SAP Ariba Sourcing PPT for learning material
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPT
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
PPTX
E -tech empowerment technologies PowerPoint
PPTX
Mathew Digital SEO Checklist Guidlines 2025
PPTX
Internet___Basics___Styled_ presentation
PDF
Slides PDF The World Game (s) Eco Economic Epochs.pdf
PPT
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
PDF
WebRTC in SignalWire - troubleshooting media negotiation
PDF
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...
Paper PDF World Game (s) Great Redesign.pdf
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
SASE Traffic Flow - ZTNA Connector-1.pdf
Digital Literacy And Online Safety on internet
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
Decoding a Decade: 10 Years of Applied CTI Discipline
Power Point - Lesson 3_2.pptx grad school presentation
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
introduction about ICD -10 & ICD-11 ppt.pptx
Introduction to the IoT system, how the IoT system works
SAP Ariba Sourcing PPT for learning material
522797556-Unit-2-Temperature-measurement-1-1.pptx
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
E -tech empowerment technologies PowerPoint
Mathew Digital SEO Checklist Guidlines 2025
Internet___Basics___Styled_ presentation
Slides PDF The World Game (s) Eco Economic Epochs.pdf
isotopes_sddsadsaadasdasdasdasdsa1213.ppt
WebRTC in SignalWire - troubleshooting media negotiation
Vigrab.top – Online Tool for Downloading and Converting Social Media Videos a...

Vert.x Event Driven Non Blocking Reactive Toolkit

  • 1. Vert.x – Event Driven Non Blocking Reactive Toolkit Brian S Paskin, Senior Application Architect, R&D Services, IBM Cloud Innovations Lab 6 April 2020 WebSphere Liberty Lunch and Learn
  • 2. Introduction 2  Vert.x is an open source project by the Eclipse Foundation  Is a reactive toolkit that can used as a serverless implementation or in an application  Used for writing asynchronous network applications  Supported under multiple Java based languages (polyglot) – Java, Kotlin, JavaScript, Groovy, Ruby, Scala  Has two programming methods, with or without Verticles (spelled that way)  There are different libraries for databases, monitoring, logging, et cetera  Non blocking and event driven that is scalable using an Event Bus – Uses an Event Loop to process requests – Event Bus to handle communications between Verticles – Can span multiple JVMs and systems  Can be used with Quarkus and GraalVM  Requires Maven Shade to create a fat jar
  • 4. Event Loop 4  Implementation of the multi Reactor design pattern – Continuously checking for new events and pass it to the proper Handler – Normal Reactor is single threaded, but Vert.x is multi-threaded  Number of threads for the Event Loop depends on the number of processors – Is equal to 2 * number of processors – Not based on the number of Verticles deployed – Threads are assigned in a round robin method for Verticles  Verticles will always execute on the assigned thread  Worker Verticles have their own thread pools  The Context is passed to the Verticle from the Event Loop – All Handlers in an Event Loop run using the same Context – Each Context has its own error handler – Maintains thread safety  Never block the event loop
  • 5. Event Loop, Contexts, and Verticles 5
  • 6. Verticles 6  A Verticle is a unit of deployment  Assigned a Thread in an Event Loop  Each Verticle has an isolated classloader and cannot share global state  Verticles can be passed configuration information  2 Different Types of Verticles – Standard – Workers  A standard Verticle should be quick and a non blocking unit of work  A worker Verticle is like a standard Verticle but using a different Thread pool – Can call blocking code – Used for limiting number of executions of code (ie. calling backend system)  Can be run in high available mode – Deploys new Verticle if it dies abruptly
  • 7. Event Bus 7  The Event Bus is used for Verticles to communicate with each other by sending messages – Single instance per Vert.x instance – Asynchronous  Can be used with Verticles in the same JVM or across multiple JVMs and systems – Outside of a single JVM Hazelcast is used to transport messages  Can be used to communicate with JavaScript  Three types of messaging – Publish and subscribe – Point to point – Request – response  Failures in all or part of the Event Bus may lead to lost messages
  • 9. Common Libraries Highlights 9  Core – Deploy Verticles – HTTP Server – Basic Event Bus – Logging – JSON and Parser – Datagrams – Metrics – High availability and failover – Timer events – Buffers  Web – Route requests to Handlers and sub routers – Routing based on criteria (HTTP Method, MIME type, etc.) – Authentication (OAuth, Basic) – Serve web pages – CORS – Uploads – Cookie Handling – Form handling – Virtual hosts – SockJS support
  • 10. Common Libraries Highlights 10  Configuration – Multiple formats (JSON, Properties, YAML, HOCON, System Props, Environment Entries, etc.) – Can read default configuration file or specify file – Different configurations can be passed to different Verticles  JDBC Client  MongoDB Client  SQL Common – Used in conjunction of one of the other data access libraries  Reactive – Uses RxJava  Circuit Breaks for Micro Services  MQTT  Kafka Client  Mail Client
  • 11. More information 11  Sample code on GitHub  Libraries  Build a starter application

Editor's Notes

  • #3: Serverless implementation – an App Server/Transaction processor is not needed. SpringBoot is serverless. Reactive programming is a programming paradigm, associated with asynchronous streams, which respond to any changes or events. Vert.x uses an event bus, to communicate with different parts of the application and passes events, asynchronously to handlers when they available. a verticle is a unit of deployment Vert.x does not follow the JEE / Jakarta EE standards Uses Netty and Hazelcast under the covers Need Maven Shade to create a fat jar.
  • #5: https://medium.com/@alexey.soshin/understanding-vert-x-event-loop-46373115fb3e https://vertx.io/blog/an-introduction-to-the-vert-x-context-object/ https://vertx.io/docs/vertx-core/java/
  • #6: https://vertx.io/blog/an-introduction-to-the-vert-x-context-object/
  • #7: https://vertx.io/docs/guide-for-java-devs/
  • #8: \
  • #10: https://vertx.io/docs
  • #11: https://vertx.io/docs