Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Reactive programming on the JVM fast and produc...
Search
Paulo Lopes
December 14, 2016
Programming
0
62
Reactive programming on the JVM fast and productive
Paulo Lopes
December 14, 2016
Tweet
Share
More Decks by Paulo Lopes
See All by Paulo Lopes
Crushing Latency with Vert.x
pmlopes
0
43
10 things I learned making the fastest js server runtime in the world
pmlopes
0
65
Going fullstack React(ive)
pmlopes
0
30
Microservices in Vert.x
pmlopes
0
180
Monoliths must die!
pmlopes
0
55
Haarlem goes Reactive with Vert.x
pmlopes
0
47
Reactive Distributes Applications with Vert.x
pmlopes
0
54
Other Decks in Programming
See All in Programming
Six and a half ridiculous things to do with Quarkus
hollycummins
0
190
Web フロントエンドエンジニアに開かれる AI Agent プロダクト開発 - Vercel AI SDK を観察して AI Agent と仲良くなろう! #FEC余熱NIGHT
izumin5210
3
580
Pull-Requestの内容を1クリックで動作確認可能にするワークフロー
natmark
2
520
Range on Rails ―「多重範囲型」という新たな選択肢が、複雑ロジックを劇的にシンプルにしたワケ
rizap_tech
0
6.7k
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
33k
CSC509 Lecture 05
javiergs
PRO
0
300
CSC509 Lecture 03
javiergs
PRO
0
340
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
490
ALL CODE BASE ARE BELONG TO STUDY
uzulla
25
6.4k
タスクの特性や不確実性に応じた最適な作業スタイルの選択(ペアプロ・モブプロ・ソロプロ)と実践 / Optimal Work Style Selection: Pair, Mob, or Solo Programming.
honyanya
3
180
品質ワークショップをやってみた
nealle
0
570
ソフトウェア設計の実践的な考え方
masuda220
PRO
4
620
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
Thoughts on Productivity
jonyablonski
70
4.9k
Speed Design
sergeychernyshev
32
1.2k
Producing Creativity
orderedlist
PRO
347
40k
Build The Right Thing And Hit Your Dates
maggiecrowley
37
2.9k
It's Worth the Effort
3n
187
28k
Gamification - CAS2011
davidbonilla
81
5.5k
A better future with KSS
kneath
239
18k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
620
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.5k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Visualization
eitanlees
149
16k
Transcript
REACTIVE PROGRAMMING ON THE JVM FAST AND PRODUCTIVE / Paulo
Lopes @jetdrone
REACTIVE WHAT'S THAT? Responsive Resilient Message Driven Elastic
None
TOOLKIT <dependency> <groupid>io.vertx</groupid> <artifactid>core</artifactid> <version>3.3.3</version> </dependency>
UNOPINIONATED import io.vertx.core.AbstractVerticle; public class Server extends AbstractVerticle { public
void start() { vertx.createHttpServer().requestHandler(req -> { req.response() .putHeader("content-type", "text/plain") .end("Hello from Vert.x!"); }).listen(8080); } }
REACTIVE conn.query("SELECT * from EMP", res -> { if (res.succeeded())
{ // Get the result set ResultSet resultSet = res.result(); } else { // Failed! } });
POLYGLOT $vertx.create_http_server().request_handler() { |req| req.response() .put_header("content-type", "text/plain") .end("Hello from Vert.x!")
}.listen(8080)
DISTRIBUTED EventBus eb = vertx.eventBus(); eb.consumer("news.uk.sport", message -> { println("I
have received a message: " + message.body()); });
ENTERPRISE SCALE ISN'T WEB SCALE!
None
HOW DOES VERT.X SCALE?
None
None
None
None
None
None
None
None
EVOLUTIONARY MIGRATION
None
None
None
TO THE POINT DISCOVERY
UNLIMITED HORIZONTAL SCALING
None
UNLIMITED HORIZONTAL SCALING
None
LIGHTWEIGHT
TIME FOR ACTION
C10K SERVER app .route("/eventbus/*") .handler(SockJSHandler.create(vertx).bridge(options)); vertx .createHttpServer() .requestHandler(app::accept) .listen(8080, res
-> { // publish a new message every 10 sec vertx.setPeriodic(10000L, t -> { vertx.eventBus().publish("time", new JsonObject() .put("unixtime", System.currentTimeMillis())); }); System.out.println("Server ready!"); });
C10K CLIENT for (int i = 0; i < sockets.length;
i++) { vertx .createHttpClient() .websocket(8080, "localhost", "/eventbus/websocket", ws -> { ws.frameHandler(frame -> println(frame.binaryData())); // subscribe to the "time" address ws.writeFrame(WebSocketFrame.textFrame(SUBSCRIBE, true)); }); }
None
REALTIME APPLICATIONS https://github.com/pmlopes/vert-x3-experiments/tree/realtime-canvas
LOW LATENCY HTTP2 https://github.com/vert-x3/vertx-examples/tree/master/web- examples/src/main/java/io/vertx/example/web/http2
BUT WE WANT REAL WORLD APPS! frontend backend devops
None
None
None
None
FINAL PRODUCT
None
NOT CONVINCED YET?
VERT.X 3 FOR YOUR NEXT CURRENT PROJECT!
None
None
THANK YOU! Vert.x is fun! http://vertx.io http://jetdrone.xyz/vertx-starter