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 productive
Search
Paulo Lopes
December 14, 2016
Programming
0
51
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
35
10 things I learned making the fastest js server runtime in the world
pmlopes
0
62
Going fullstack React(ive)
pmlopes
0
23
Microservices in Vert.x
pmlopes
0
170
Monoliths must die!
pmlopes
0
51
Haarlem goes Reactive with Vert.x
pmlopes
0
31
Reactive Distributes Applications with Vert.x
pmlopes
0
47
Other Decks in Programming
See All in Programming
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.4k
Git Rebase
bkuhlmann
11
1.6k
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
840
Apache Hive 4 on Treasure Data
ryukobayashi
0
350
ONE WEDGE_company_guide
1wedge_one
0
500
Ruby GitHub Packages
bkuhlmann
0
630
AmperとFleetを使ったAndroidアプリ
yoppie
0
180
GitHub Copilotのススメ
marcy731
1
200
Hanami and htmx
bkuhlmann
0
210
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
190
二郎系ラーメンのコールで学ぶ AST 解析
memory1994
PRO
7
1.7k
冗長なエラーログを削減し、スタックトレースを手に入れる / Reducing Verbose Error Logs and Obtaining Stack Traces
upamune
0
840
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
How to train your dragon (web standard)
notwaldorf
73
5.2k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
659
120k
A designer walks into a library…
pauljervisheath
200
23k
Writing Fast Ruby
sferik
621
60k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
116
18k
Building Effective Engineering Teams - LeadDev
addyosmani
28
1.9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
7
1k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
What’s in a name? Adding method to the madness
productmarketing
PRO
16
2.6k
Practical Orchestrator
shlominoach
182
9.7k
Designing on Purpose - Digital PM Summit 2013
jponch
110
6.5k
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