SlideShare a Scribd company logo
From Streams to
Reactive Streams
Oleg Tsal-Tsalko
JavaDay Kyiv 2017
SOLUTION ARCHITECT AT EPAM SYSTEMS.
PASSIONATE DEVELOPER, SPEAKER,
ACTIVE MEMBER OF KIEV JUG.
PARTICIPATE IN DIFFERENT EDUCATIONAL
INITIATIVES, ENGINEERING EVENTS AND
JCP/ADOPTJSR PROGRAMS.
MEMBER OF ARCHITECTURE EXCELLENCE
INITIATIVE AND ENGINEERING
PRODUCTIVITY GROUPS IN EPAM.
OLEG TSAL-TSALKO
CONFIDENTIAL 3
Agenda
Reactive Manifesto
Reactive Programming
Reactive Streams spec
Project Reactor
CONFIDENTIAL 4
Nowadays challenges
CONFIDENTIAL 5
CONFIDENTIAL 6
CONFIDENTIAL 7
CONFIDENTIAL 8
Non-blocking architecture
• Can’t write imperative code anymore
• Can’t assume single thread of control
• Must deal with async results (listeners/callbacks)
• Everything becomes stream of events
CONFIDENTIAL 9
What is Reactive Programming?
CONFIDENTIAL 10
Concurrent
Programming
Reactive
Programming
CONFIDENTIAL 11
Reactive Use Cases
External Non-blocking Service Calls
Highly Concurrent Message Consumers
Spreadsheets
Abstraction Over (A)synchronous Processing
…
CONFIDENTIAL 12
Existing implementations
CONFIDENTIAL 13
One spec to rule them all
CONFIDENTIAL 14
Reactive Streams spec
Asynchronous stream processing with non-blocking back pressure
The Problem
Handling streams of “live” data
whose volume is not predetermined so that
fast data source does not overwhelm the stream destination
Scope
Minimal set of interfaces, methods and protocols to build
asynchronous streams of data with non-blocking back pressure
CONFIDENTIAL 15
What is back-pressure?
CONFIDENTIAL 16
CONFIDENTIAL 17
Back-pressure
CONFIDENTIAL 18
Reactive Streams API
CONFIDENTIAL 19
Publish-Subscribe Flow
CONFIDENTIAL 20
Difference to CompletableFuture
If you have a reference to the Future,
it means the task processing an asynchronous result is already
executing!
Deferred - nothing happens before the call to subscribe()
Pull - Subscriber pull the next chunk of data when needed
Push - Producer push new data to Consumer according to demand
CompletableFuture is push only model
ReactiveStreams is deferred pull-push model
CONFIDENTIAL 21
Spring Reactor
CONFIDENTIAL 22
Spring Reactor evolution
CONFIDENTIAL 23
Reactor in Spring ecosystem
CONFIDENTIAL 24
Three things you can do with Flux/Mono:
1. operate on it
2. subscribe to it
3. configure it
Simple and clear, isn’t it?
CONFIDENTIAL 25
Fluent API
CONFIDENTIAL 26
CONFIDENTIAL 27
Programming model is very similar
Both heavily use operators chaining and lambdas
Java8 Streams
Reactive
Streams
However purpose is different!!!
Reactive Streams operate on
reactive data
and represent data over time
Java8 streams operate on
collections
and have all or nothing semantics
CONFIDENTIAL 28
Reactive streams lifecycle
• Assembly-time: When you compose your stream
just().subscribeOn().map()
• Subscription-time: When Subscriber subscribes to a stream
and it triggers a "storm" of subscriptions under the hood
• Runtime: When items are generated followed by zero or one
terminal event of error/completion
CONFIDENTIAL 29
Links
Exercises to practice: https://github.com/reactor/lite-rx-api-
hands-on
Examples shown:
https://github.com/olegts/ReactiveStreams/tree/master/src/
test/java/org/reactivestreams/reactor/javaday
Reactive Streams: https://github.com/reactive-
streams/reactive-streams-jvm
Project Reactor: https://projectreactor.io/docs
CONFIDENTIAL 30

More Related Content

What's hot (19)

PDF
OSDC 2018 - Distributed monitoring
Gianluca Arbezzano
 
PDF
Angular 2 observables
Geoffrey Filippi
 
PDF
The Apollo and GraphQL Stack
Sashko Stubailo
 
PDF
Reactive Spring Framework 5
Aliaksei Zhynhiarouski
 
PDF
Spring Framework 5: History and Reactive features
Aliaksei Zhynhiarouski
 
PDF
Go reactive - Manuel Vicente Vivo
Manuel Vicente Vivo
 
PDF
James Baxley - Statically typing your GraphQL app
React Conf Brasil
 
PPTX
JOIN 2021 Testable and reusable build automation Using Tekton
Pieter Vincken
 
PDF
Running Flink in Production: The good, The bad and The in Between - Lakshmi ...
Flink Forward
 
PPTX
A stream: Ad-hoc Shared Stream Processing - Jeyhun Karimov, DFKI GmbH
Flink Forward
 
PDF
The Evolution of Continuous Delivery at Scale @ Linkedin
C4Media
 
PDF
Spring framework 5: New Core and Reactive features
Aliaksei Zhynhiarouski
 
PDF
KubeCon EU 2016: Kubernetes in Production in The New York Times newsroom
KubeAcademy
 
PDF
DevNation Workshop: Object detection with Red Hat OpenShift Data Science [Mar...
Red Hat Developers
 
PPTX
Ray distributed python framework
AryanJadon3
 
PPTX
Flink Forward Berlin 2017: Kostas Kloudas - Complex Event Processing with Fli...
Flink Forward
 
PPTX
GraphQL Introduction
bobo52310
 
PPTX
How to contribute to an open source project and don’t die during the Code Rev...
Victor Morales
 
PDF
Ratpack and Grails 3
Lari Hotari
 
OSDC 2018 - Distributed monitoring
Gianluca Arbezzano
 
Angular 2 observables
Geoffrey Filippi
 
The Apollo and GraphQL Stack
Sashko Stubailo
 
Reactive Spring Framework 5
Aliaksei Zhynhiarouski
 
Spring Framework 5: History and Reactive features
Aliaksei Zhynhiarouski
 
Go reactive - Manuel Vicente Vivo
Manuel Vicente Vivo
 
James Baxley - Statically typing your GraphQL app
React Conf Brasil
 
JOIN 2021 Testable and reusable build automation Using Tekton
Pieter Vincken
 
Running Flink in Production: The good, The bad and The in Between - Lakshmi ...
Flink Forward
 
A stream: Ad-hoc Shared Stream Processing - Jeyhun Karimov, DFKI GmbH
Flink Forward
 
The Evolution of Continuous Delivery at Scale @ Linkedin
C4Media
 
Spring framework 5: New Core and Reactive features
Aliaksei Zhynhiarouski
 
KubeCon EU 2016: Kubernetes in Production in The New York Times newsroom
KubeAcademy
 
DevNation Workshop: Object detection with Red Hat OpenShift Data Science [Mar...
Red Hat Developers
 
Ray distributed python framework
AryanJadon3
 
Flink Forward Berlin 2017: Kostas Kloudas - Complex Event Processing with Fli...
Flink Forward
 
GraphQL Introduction
bobo52310
 
How to contribute to an open source project and don’t die during the Code Rev...
Victor Morales
 
Ratpack and Grails 3
Lari Hotari
 

Similar to From Streams to Reactive Streams (20)

PDF
Reactive Applications in Java
Alexander Mrynskyi
 
PPTX
Reactive applications tools of the trade huff po
shinolajla
 
PDF
Reactive microservices with eclipse vert.x
Ram Maddali
 
PDF
Streaming to a new Jakarta EE
Markus Eisele
 
PDF
Streaming to a New Jakarta EE
J On The Beach
 
PPT
Building Reactive webapp with React/Flux
Keuller Magalhães
 
PPTX
Spring webflux
Carlos E. Salazar
 
PDF
Monoliths to microservices workshop
Judy Breedlove
 
PPTX
Deploying more technology to shift from agility to anti-fragility
Spyros Lambrinidis
 
PDF
App specific app architecture
Petr Zvoníček
 
PPTX
Flux - rethink in design pattern
Oleg Gomozov
 
PDF
Red Hat Java Update and Quarkus Introduction
John Archer
 
PPTX
Reactive Web Development with Spring Boot 2
Mike Melusky
 
PDF
Fallacies of distributed computing with Kubernetes on AWS
Raffaele Di Fazio
 
PDF
05.10.2017 AWS User Group Meetup - FALLACIES OF DISTRIBUTED COMPUTING WITH KU...
Zalando adtech lab
 
PDF
Application Modernisation through Event-Driven Microservices
confluent
 
PDF
Day in the life event-driven workshop
Christina Lin
 
PPTX
Managing Microservices at Scale
Perforce
 
PDF
Current & Future Use-Cases of OpenDaylight
abhijit2511
 
PDF
Reactive Microservices with Spring 5: WebFlux
Trayan Iliev
 
Reactive Applications in Java
Alexander Mrynskyi
 
Reactive applications tools of the trade huff po
shinolajla
 
Reactive microservices with eclipse vert.x
Ram Maddali
 
Streaming to a new Jakarta EE
Markus Eisele
 
Streaming to a New Jakarta EE
J On The Beach
 
Building Reactive webapp with React/Flux
Keuller Magalhães
 
Spring webflux
Carlos E. Salazar
 
Monoliths to microservices workshop
Judy Breedlove
 
Deploying more technology to shift from agility to anti-fragility
Spyros Lambrinidis
 
App specific app architecture
Petr Zvoníček
 
Flux - rethink in design pattern
Oleg Gomozov
 
Red Hat Java Update and Quarkus Introduction
John Archer
 
Reactive Web Development with Spring Boot 2
Mike Melusky
 
Fallacies of distributed computing with Kubernetes on AWS
Raffaele Di Fazio
 
05.10.2017 AWS User Group Meetup - FALLACIES OF DISTRIBUTED COMPUTING WITH KU...
Zalando adtech lab
 
Application Modernisation through Event-Driven Microservices
confluent
 
Day in the life event-driven workshop
Christina Lin
 
Managing Microservices at Scale
Perforce
 
Current & Future Use-Cases of OpenDaylight
abhijit2511
 
Reactive Microservices with Spring 5: WebFlux
Trayan Iliev
 
Ad

More from Oleg Tsal-Tsalko (14)

PPTX
Developer on a mission (Devoxx UA 2021)
Oleg Tsal-Tsalko
 
PPTX
Developer on a mission
Oleg Tsal-Tsalko
 
PDF
Java 9 Jigsaw HackDay
Oleg Tsal-Tsalko
 
PDF
JUG UA AdoptJSR participation
Oleg Tsal-Tsalko
 
PDF
Develop modern apps using Spring ecosystem at time of BigData
Oleg Tsal-Tsalko
 
PDF
Java 8 features
Oleg Tsal-Tsalko
 
PDF
Lambdas HOL
Oleg Tsal-Tsalko
 
PDF
Java 8 date & time javaday2014
Oleg Tsal-Tsalko
 
PDF
Java 8 date & time
Oleg Tsal-Tsalko
 
PDF
Get ready for spring 4
Oleg Tsal-Tsalko
 
PDF
Enterprise Integration Patterns
Oleg Tsal-Tsalko
 
PPTX
Distributed systems and scalability rules
Oleg Tsal-Tsalko
 
PPTX
Next stop: Spring 4
Oleg Tsal-Tsalko
 
PPTX
JUG involvment in JCP and AdopJSR program
Oleg Tsal-Tsalko
 
Developer on a mission (Devoxx UA 2021)
Oleg Tsal-Tsalko
 
Developer on a mission
Oleg Tsal-Tsalko
 
Java 9 Jigsaw HackDay
Oleg Tsal-Tsalko
 
JUG UA AdoptJSR participation
Oleg Tsal-Tsalko
 
Develop modern apps using Spring ecosystem at time of BigData
Oleg Tsal-Tsalko
 
Java 8 features
Oleg Tsal-Tsalko
 
Lambdas HOL
Oleg Tsal-Tsalko
 
Java 8 date & time javaday2014
Oleg Tsal-Tsalko
 
Java 8 date & time
Oleg Tsal-Tsalko
 
Get ready for spring 4
Oleg Tsal-Tsalko
 
Enterprise Integration Patterns
Oleg Tsal-Tsalko
 
Distributed systems and scalability rules
Oleg Tsal-Tsalko
 
Next stop: Spring 4
Oleg Tsal-Tsalko
 
JUG involvment in JCP and AdopJSR program
Oleg Tsal-Tsalko
 
Ad

Recently uploaded (20)

PPT
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
PPTX
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
PDF
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
DOC
MRRS Strength and Durability of Concrete
CivilMythili
 
PDF
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
PPTX
Element 7. CHEMICAL AND BIOLOGICAL AGENT.pptx
merrandomohandas
 
PPTX
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
PPTX
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
PPTX
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
PPTX
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
DOCX
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
PDF
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
PPTX
Server Side Web Development Unit 1 of Nodejs.pptx
sneha852132
 
PDF
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PDF
Zilliz Cloud Demo for performance and scale
Zilliz
 
PDF
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
MRRS Strength and Durability of Concrete
CivilMythili
 
Viol_Alessandro_Presentazione_prelaurea.pdf
dsecqyvhbowrzxshhf
 
Element 7. CHEMICAL AND BIOLOGICAL AGENT.pptx
merrandomohandas
 
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
原版一样(Acadia毕业证书)加拿大阿卡迪亚大学毕业证办理方法
Taqyea
 
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
Introduction to Productivity and Quality
মোঃ ফুরকান উদ্দিন জুয়েল
 
Server Side Web Development Unit 1 of Nodejs.pptx
sneha852132
 
GTU Civil Engineering All Semester Syllabus.pdf
Vimal Bhojani
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
Zilliz Cloud Demo for performance and scale
Zilliz
 
Set Relation Function Practice session 24.05.2025.pdf
DrStephenStrange4
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 

From Streams to Reactive Streams