Modern app programming
with RxJava & Eclipse Vert.x
Who am I?
● Thomas Segismont
● tsegismont on GitHub, Twitter, Gmail, Freenode...
● Vert.x core team since August 2016
● At Red Hat since November 2012 (RHQ and Hawkular)
#RivieraDev @vertx_project
Expectations
● Goals
– Why is reactive programming important?
– What are RxJava and Vert.x?
– How can I combine them to build scalable, efficient and resilient
apps?
● Non goals
– In-depth study of RxJava or Vert.x
#RivieraDev @vertx_project
Back to the late 90s…
A hotel room booking engine
http://example.com
http://example.com
http://example.com
Such apps are mainstream today!
● Microservices
● API economy
#RivieraDev @vertx_project
Alexandre Duret-Lutz (CC BY-SA 2.0)
Event loop systems
Reactor pattern
Single
thread
New stuff?
● Browser (AJAX, #setTimeout)
● GUI
● Node.js
#RivieraDev @vertx_project
Event loop benefits
● Simple concurrency model
● Mechanical sympathy http://bit.ly/2cJMBsG
– Higher throughput
– Predictable latency
#RivieraDev @vertx_project
Vert.x
What is Vert.x
● A toolkit (lib)
● … to build polyglot (on the JVM)
– JS, Groovy, Ruby, Scala (3.4), Kotlin (3.4)
● … reactive systems
#RivieraDev @vertx_project
Demo
Damn simple verticle
Modern app programming with RxJava and Eclipse Vert.x
Multi-Reactor
#RivieraDev @vertx_project
Event Bus
● Nervous system of Vert.x
● Message passing style
● Different messaging paradigms:
– Point to point
– Publish/Subscribe
– Request/Reply
#RivieraDev @vertx_project
Running blocking code
● In the real world, most JVM libraries have blocking APIs
– JDBC
– io.File
– Your legacy libs
● With Vert.x you can interact with blocking parts easily
● You won’t throw away your code assets!
#RivieraDev @vertx_project
Modern app programming with RxJava and Eclipse Vert.x
Callback based (reactive imperative)
CALLBACK HELL !
RxJava
Data and events flows
● It is great at organizing transformation of data and coordination
of events
● It makes most sense when many sources of events are
involved (modern apps!)
#RivieraDev @vertx_project
Push based
Observable Observer
Subscription
● OnNext 0..∞
● Terminal event 0..1
– OnComplete
– OnError
#RivieraDev @vertx_project
Reactive pull backpressure
Observable Observer
Subscription
Request
#RivieraDev @vertx_project
Observable / Single / Completable
Zero One Many
Sync void T Iterable<T>
Async Completable Single<T> Observable<T>
#RivieraDev @vertx_project
Demo
Damn simple Rx Verticle
Music Store Demo
https://github.com/tsegismont/vertx-musicstore
http://example.com
http://example.com
http://example.com
https://coverartarchive.org/
Postgres
Couchbase
Vert.x RxJava
Vert.x
Web Client
HTTP
Vert.x
JDBC Client
Couchbase
RxJava driver
Event Bus Bridge
(WebSocket)
Vert.x
Local Cache
Observable#map
ReactiveX.io Creative Commons Attribution 3.0 License
Observable#map
private Single<JsonArray> findAlbums(SQLConnection sqlConnection, Long artistId) {
return sqlConnection.rxQueryStreamWithParams(findAlbumsByArtist, new JsonArray().add(artistId))
.flatMapObservable(SQLRowStream::toObservable)
.map(row -> new JsonObject().put("id", row.getLong(0)).put("title", row.getString(1)))
.collect(JsonArray::new, JsonArray::add)
.toSingle();
}
#RivieraDev @vertx_project
Observable#flatMap
ReactiveX.io Creative Commons Attribution 3.0 License
Single#flatMap
public void handle(RoutingContext rc) {
dbClient.rxGetConnection().flatMap(sqlConnection -> {
return findGenres(sqlConnection).doAfterTerminate(sqlConnection::close);
}).flatMap(genres -> {
rc.put("genres", genres);
return templateEngine.rxRender(rc, "templates/index");
}).subscribe(rc.response()::end, rc::fail);
}
#RivieraDev @vertx_project
Single#zip
ReactiveX.io Creative Commons Attribution 3.0 License
Single#zip
Single<JsonObject> as = findAlbum(sqlConnection, albumId);
Single<JsonArray> ts = findTracks(sqlConnection, albumId);
return Single.zip(as, ts, (album, tracks) -> {
Map<String, Object> data = new HashMap<>(2);
data.put("album", album);
data.put("tracks", tracks);
return data;
}).doAfterTerminate(sqlConnection::close);
#RivieraDev @vertx_project
Observable#observeOn
ReactiveX.io Creative Commons Attribution 3.0 License
Observable#observeOn
#RivieraDev @vertx_project
albumCommentsBucket.query(Query.parametrized(findRecentCommentsByAlbum, params))
.observeOn(RxHelper.scheduler(rc.vertx()))
.flatMap(AsyncQueryResult::rows)
.limit(5)
.collect(JsonArray::new, (jsonArray, row) -> jsonArray.add(new JsonObject(row.value().toMap())))
.toSingle()
.flatMap(data -> {
rc.put("comments", data);
return templateEngine.rxRender(rc, "templates/partials/album_comments");
}).subscribe(rc.response()::end, rc::fail);
#RivieraDev @vertx_project
http://red.ht/2pgMEoA
Thank you!
http://vertx.io
Come get your sticker!
#RivieraDev @vertx_project

More Related Content

PDF
RxJava - introduction & design
PDF
Reactive programming with Rxjava
PDF
Building ‘Bootiful’ microservices cloud
PPTX
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
PPTX
Introduction to Reactive Java
PDF
Introduction to Akka-Streams
PDF
Reactor in Action
PDF
Microservices with Netflix OSS & Spring Cloud - Arnaud Cogoluègnes
RxJava - introduction & design
Reactive programming with Rxjava
Building ‘Bootiful’ microservices cloud
Javantura v3 - ES6 – Future Is Now – Nenad Pečanac
Introduction to Reactive Java
Introduction to Akka-Streams
Reactor in Action
Microservices with Netflix OSS & Spring Cloud - Arnaud Cogoluègnes

What's hot (20)

PPTX
Asynchronous programming in ASP.NET
PDF
Event Machine
PPT
Reactive programming with examples
PDF
Microservices with Spring Cloud
PDF
Queick: A Simple Job Queue System for Python
PDF
Reactive Streams: Handling Data-Flow the Reactive Way
KEY
Concurrency in ruby
PDF
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
PDF
Spring Cloud and Netflix OSS overview v1
PDF
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
PDF
Understanding and Extending Prometheus AlertManager
PPTX
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
PPTX
Asynchronous Python with Twisted
PDF
WTF is Twisted?
PDF
Microservices with Netflix OSS and Spring Cloud - Dev Day Orange
PDF
Reactive Card Magic: Understanding Spring WebFlux and Project Reactor
PDF
Reactive programming with RxJava
PDF
Building Scalable Stateless Applications with RxJava
PDF
CDK Meetup: Rule the World through IaC
PDF
Kubernetes and Prometheus
Asynchronous programming in ASP.NET
Event Machine
Reactive programming with examples
Microservices with Spring Cloud
Queick: A Simple Job Queue System for Python
Reactive Streams: Handling Data-Flow the Reactive Way
Concurrency in ruby
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Cloud and Netflix OSS overview v1
Performance measurement methodology — Maksym Pugach | Elixir Evening Club 3
Understanding and Extending Prometheus AlertManager
Gabriele Provinciali/Gabriele Folchi/Luca Postacchini - Sviluppo con piattafo...
Asynchronous Python with Twisted
WTF is Twisted?
Microservices with Netflix OSS and Spring Cloud - Dev Day Orange
Reactive Card Magic: Understanding Spring WebFlux and Project Reactor
Reactive programming with RxJava
Building Scalable Stateless Applications with RxJava
CDK Meetup: Rule the World through IaC
Kubernetes and Prometheus
Ad

Viewers also liked (20)

PDF
Vert.X: Microservices Were Never So Easy (Clement Escoffier)
PPTX
Vert.x for Microservices Architecture
PPTX
Building microservices with vert.x 3.0
PPTX
autodiscoverable microservices with vertx3
PDF
An Introduction to Reactive Application, Reactive Streams, and options for JVM
PPTX
DDD-Enabling Architectures with EventStore
PDF
Building Evented Single Page Applications
PDF
Reactive programming
PPTX
Reactive web applications
PDF
Reactive Microservices with Vert.x
PDF
Case study - Nuskin: Statefull Applications in a Stateless World
PDF
Rxjava meetup presentation
PDF
Develop and Deploy Cloud-Native Apps as Resilient Microservice Architectures
PPTX
Patterns and practices for real-world event-driven microservices
PDF
Can Single Page Applications Deliver a World-Class Web UX?
PDF
RxJava 2.0 介紹
PDF
Securing Single-Page Applications with OAuth 2.0
PDF
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
PPTX
Welcome to rx java2
PPTX
Rocks of Aia
Vert.X: Microservices Were Never So Easy (Clement Escoffier)
Vert.x for Microservices Architecture
Building microservices with vert.x 3.0
autodiscoverable microservices with vertx3
An Introduction to Reactive Application, Reactive Streams, and options for JVM
DDD-Enabling Architectures with EventStore
Building Evented Single Page Applications
Reactive programming
Reactive web applications
Reactive Microservices with Vert.x
Case study - Nuskin: Statefull Applications in a Stateless World
Rxjava meetup presentation
Develop and Deploy Cloud-Native Apps as Resilient Microservice Architectures
Patterns and practices for real-world event-driven microservices
Can Single Page Applications Deliver a World-Class Web UX?
RxJava 2.0 介紹
Securing Single-Page Applications with OAuth 2.0
Voxxed Days Vienna - The Why and How of Reactive Web-Applications on the JVM
Welcome to rx java2
Rocks of Aia
Ad

Similar to Modern app programming with RxJava and Eclipse Vert.x (20)

PDF
Reactive microservices with eclipse vert.x
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
PPTX
Full-Stack-Presentation-Slide(Longsaar_Francis).pptx
PDF
Angular (v2 and up) - Morning to understand - Linagora
PDF
Cross-platform Desktop application with AngularJS and build with Node-webkit
PDF
Reaktive Programmierung mit den Reactive Extensions (Rx)
PDF
Software Architecture - All you need to know
PPTX
Reactive web applications using MeteorJS
PDF
Reactive Applications in Java
PPTX
Web summit.pptx
PDF
Geoscience and Microservices
PPTX
Spring Webflux
PDF
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
PDF
Sergio Seabra - Red Hat - OSL19
PPTX
Magento NodeJS Microservices — Yegor Shytikov | Magento Meetup Online #11
PPTX
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
PDF
Transformacion e innovacion digital Meetup - Application Modernization and Mi...
PDF
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
PDF
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014
Reactive microservices with eclipse vert.x
TDC2017 | São Paulo - Trilha Java EE How we figured out we had a SRE team at ...
Building Reactive Microservices with Vert.x
Full-Stack-Presentation-Slide(Longsaar_Francis).pptx
Angular (v2 and up) - Morning to understand - Linagora
Cross-platform Desktop application with AngularJS and build with Node-webkit
Reaktive Programmierung mit den Reactive Extensions (Rx)
Software Architecture - All you need to know
Reactive web applications using MeteorJS
Reactive Applications in Java
Web summit.pptx
Geoscience and Microservices
Spring Webflux
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
Sergio Seabra - Red Hat - OSL19
Magento NodeJS Microservices — Yegor Shytikov | Magento Meetup Online #11
Vue Storefront - Progressive Web App for Magento (1.9, 2.x) - MM18DE speech
Transformacion e innovacion digital Meetup - Application Modernization and Mi...
Rolando Santamaría Masó - Simplicity meets scalability - code.talks 2015
Conquer Architectural Challenges with End-to-End JavaScript - enterJS 2014

Recently uploaded (20)

PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
PPTX
Introduction to Windows Operating System
PDF
Practical Indispensable Project Management Tips for Delivering Successful Exp...
PPTX
Plex Media Server 1.28.2.6151 With Crac5 2022 Free .
PDF
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
PPTX
Download Adobe Photoshop Crack 2025 Free
PPTX
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
PDF
AI-Powered Fuzz Testing: The Future of QA
PDF
E-Commerce Website Development Companyin india
PPTX
Python is a high-level, interpreted programming language
PDF
Wondershare Recoverit Full Crack New Version (Latest 2025)
PDF
BoxLang Dynamic AWS Lambda - Japan Edition
PDF
DNT Brochure 2025 – ISV Solutions @ D365
PPTX
Airline CRS | Airline CRS Systems | CRS System
PDF
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
PPTX
Trending Python Topics for Data Visualization in 2025
DOC
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
Workplace Software and Skills - OpenStax
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
novaPDF Pro 11.9.482 Crack + License Key [Latest 2025]
Introduction to Windows Operating System
Practical Indispensable Project Management Tips for Delivering Successful Exp...
Plex Media Server 1.28.2.6151 With Crac5 2022 Free .
AI/ML Infra Meetup | Beyond S3's Basics: Architecting for AI-Native Data Access
Download Adobe Photoshop Crack 2025 Free
Cybersecurity-and-Fraud-Protecting-Your-Digital-Life.pptx
AI-Powered Fuzz Testing: The Future of QA
E-Commerce Website Development Companyin india
Python is a high-level, interpreted programming language
Wondershare Recoverit Full Crack New Version (Latest 2025)
BoxLang Dynamic AWS Lambda - Japan Edition
DNT Brochure 2025 – ISV Solutions @ D365
Airline CRS | Airline CRS Systems | CRS System
Introduction to Ragic - #1 No Code Tool For Digitalizing Your Business Proces...
Trending Python Topics for Data Visualization in 2025
UTEP毕业证学历认证,宾夕法尼亚克拉里恩大学毕业证未毕业
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Workplace Software and Skills - OpenStax

Modern app programming with RxJava and Eclipse Vert.x