A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a...
Transcript of A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a...
![Page 1: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/1.jpg)
BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH
A Hitchikers Introduction to Vertx
Anatole Tresch, Principal Consultant
0
![Page 2: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/2.jpg)
2 Hitchhikers Introduction to Vertx
About me...
● Principal Consultant, Trivadis AG (Switzerland)● Star Spec Lead JSR 354● Open Source Enthusiast
● Twitter: @atsticks● [email protected]● [email protected]●
![Page 3: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/3.jpg)
3 Hitchhikers Introduction to Vertx
Agenda
● Basics
● Networking
● Clustering
● Vertx Maven Plugin
● There is more...
![Page 4: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/4.jpg)
Vertx?Is that something
to eat?
![Page 5: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/5.jpg)
5 Hitchhikers Introduction to Vertx
Tool-kit
for reactive applications
on the JVM
![Page 6: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/6.jpg)
6 Hitchhikers Introduction to Vertx
● Vert.x is not a container.
● You use the components you like.
● You can combine Vert.x with all the other libraries
you like.
Toolbox
![Page 7: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/7.jpg)
7 Hitchhikers Introduction to Vertx
Reactive
Source: http://www.reactivemanifesto.org/
![Page 8: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/8.jpg)
8 Hitchhikers Introduction to Vertx
Core
● TCP/HTTP client and server, Datagram Sockets
● Event bus● Shared data● Periodic and delayed actions● Verticles● DNS client● File system access● HA and Clustering
![Page 9: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/9.jpg)
9 Hitchhikers Introduction to Vertx
Starting
![Page 10: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/10.jpg)
10 Hitchhikers Introduction to Vertx
The Eventloop
● Events are distributed by the event loop thread aka Reactor
● Vertx = Multi-Reactor (by default Cores*2)
● Don‘t block the event loop !!!
![Page 11: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/11.jpg)
11 Hitchhikers Introduction to Vertx
Running Blocking Code
![Page 12: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/12.jpg)
12 Hitchhikers Introduction to Vertx
The Event Bus
● The nervous system of Vert.x.
● One single event bus instance for every Vert.x instance.
● Allows different parts of your application to communicate.
● Can be bridged to support client side JavaScript.
● A distributed peer-to-peer messaging spanning multiple nodes and browsers.
● Publish/subscribe, point to point, and request-response messaging.
![Page 13: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/13.jpg)
13 Hitchhikers Introduction to Vertx
Registering Handlers to the Event Bus
![Page 14: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/14.jpg)
14 Hitchhikers Introduction to Vertx
Publishing Events on the Event Bus
![Page 15: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/15.jpg)
15 Hitchhikers Introduction to Vertx
Acknowledging Messages
![Page 16: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/16.jpg)
16 Hitchhikers Introduction to Vertx
Delivery Options
![Page 17: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/17.jpg)
17 Hitchhikers Introduction to Vertx
JSON Support
● Vertx comes with full JSON OOTB (based on Jackson Library)
● JSON can is by default support over the event bus
● JsonObject.encode()/JsonArray.encode() → String
![Page 18: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/18.jpg)
18 Hitchhikers Introduction to Vertx
High Availability
Verticles can be deployed with High Availability enabled:
![Page 19: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/19.jpg)
19 Hitchhikers Introduction to Vertx
Buffers
![Page 20: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/20.jpg)
20 Hitchhikers Introduction to Vertx
Verticles● Simple, scalable, actor-like deployment and concurrency model
● Not a strict actor-model implementation, but similar
● Entirely optional
![Page 21: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/21.jpg)
21 Hitchhikers Introduction to Vertx
![Page 22: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/22.jpg)
22 Hitchhikers Introduction to Vertx
Verticle Types
![Page 23: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/23.jpg)
23 Hitchhikers Introduction to Vertx
Deploying Verticles
Or you use references for VerticleFactories for polyglot support,,,
![Page 24: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/24.jpg)
24 Hitchhikers Introduction to Vertx
Timers and Delays
One shot timers:
Periodic timers:
![Page 25: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/25.jpg)
25 Hitchhikers Introduction to Vertx
Shared Data● Local shared maps
● Cluster-wide asynchronous maps
● Cluster-wide locks & counters (not shown)
![Page 26: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/26.jpg)
Networking
![Page 27: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/27.jpg)
27 Hitchhikers Introduction to Vertx
TCP Server
![Page 28: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/28.jpg)
28 Hitchhikers Introduction to Vertx
TCP Server Reading/Writing
![Page 29: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/29.jpg)
29 Hitchhikers Introduction to Vertx
TCP Client
![Page 30: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/30.jpg)
30 Hitchhikers Introduction to Vertx
HTTP Server
![Page 31: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/31.jpg)
31 Hitchhikers Introduction to Vertx
HTTP Client
![Page 32: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/32.jpg)
32 Hitchhikers Introduction to Vertx
Vertx Web
Provides more flexible support for writing web services.
![Page 33: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/33.jpg)
33 Hitchhikers Introduction to Vertx
Vertx Web – Basic Routing
![Page 34: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/34.jpg)
34 Hitchhikers Introduction to Vertx
Vertx Web – Rest Endpoint
![Page 35: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/35.jpg)
35 Hitchhikers Introduction to Vertx
Vertx Web – Rest Endpoint
![Page 36: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/36.jpg)
36 Hitchhikers Introduction to Vertx
Vertx CircuitBreaker
![Page 37: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/37.jpg)
37 Hitchhikers Introduction to Vertx
Vertx ServiceDiscovery
![Page 38: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/38.jpg)
38 Hitchhikers Introduction to Vertx
Vertx ServiceDiscovery – Provider Sample
![Page 39: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/39.jpg)
39 Hitchhikers Introduction to Vertx
Vertx ServiceDiscovery – Consumer Sample
![Page 40: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/40.jpg)
Clustering & HA
![Page 41: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/41.jpg)
41 Hitchhikers Introduction to Vertx
Clustering
![Page 42: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/42.jpg)
42 Hitchhikers Introduction to Vertx
High Availability
![Page 43: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/43.jpg)
Vertx Maven Plugin
![Page 44: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/44.jpg)
44 Hitchhikers Introduction to Vertx
Vertx Maven Plugin
![Page 45: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/45.jpg)
I want to see a demo.
Please give me more.
![Page 46: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/46.jpg)
46 Hitchhikers Introduction to Vertx
Not discussed...● Vertx CLI● MQTT Client/Server● Configuration● Metrics Support● Health-Checks● Shell● Test Support● Service Proxies● Openshift / Docker Tooling● JDBC● NoSql Support● Advanced:
● Code Generation, Language Bindings, etc
![Page 47: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/47.jpg)
47 Hitchhikers Introduction to Vertx
Demo Time ...
![Page 48: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/48.jpg)
Recap
![Page 49: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/49.jpg)
49 Hitchhikers Introduction to Vertx
Recap
● Vertx is a very flexible and modular toolkit
● It is rather leightweight (ca. 6 MB for something useful)
● It is polyglot, supporting a big range of languages
● It is amazing fast
● It supports all requirements of the reactive manifesto
● It sometimes can be a beast
● It requires Java 8+
● It is fun to work with
![Page 50: A Hitchikers Introduction 0 to Vertx - Eclipse49 Hitchhikers Introduction to Vertx Recap Vertx is a very flexible and modular toolkit It is rather leightweight (ca. 6 MB for something](https://reader030.fdocuments.in/reader030/viewer/2022041014/5ec5640be582ad621b7d04c3/html5/thumbnails/50.jpg)
Hitchhikers Introduction to Vertx
A Hitchhikers Introduction to VertxAnatole TreschPrincipal Consultant
Tel. +41 58 459 53 [email protected]
Vertx: http://vertx.io
Vertx Maven Plugin: https://vmp.fabric8.io/
Reactive Manifesto: http://www.reactivemanifesto.org/