SlideShare a Scribd company logo
Let’s go reactive with
JAVA Presented By :
Vinisha Sharma
Software consultant - Knoldus Inc
© 2018 Minimal – Presentation template
2
Agenda
● Reactive Programming
● Reactive Streams
Specification
● Project Reactor
● Mono/ Flux
● Spring Boot Webflux
● Demo
3
05
4
❑ Programming paradigm oriented around - data flows and
propagation of change.
❑ Asynchronous and Non Blocking.
❑ Data flow as an Event/Message Driven stream
Reactive Programming
5
Reactive Manifesto
6
Reactive
Streams
7
Reactive streams
Reactive Streams is an initiative to provide a standard for asynchronous
stream processing with non-blocking back pressure
Functional Style Code
● Java 8 Streams API
● Lambdas
Event Driven Streams
● Event or Message for
every result item
from Data Source
● Event or Message for
Completion or error
● Asynchronous and
non-blocking
Deferred Push/Pull
Model
Back Pressure
F
BE
D
8
Imperative Programming
9
Reactive Streams
Specification
10
Reactive Stream Specification
Specification or Rules for a Reactive Stream
(Created by Pivotal, Netflix, LightBend, Twitter
etc...)
11
public interface Publisher<T> {
public void subscribe(Subscriber<? super T>
s);
}
❑ Represents the Data source
❑ Database
❑ External Service, etc…..
Publisher
12
public interface Subscriber<T> {
public void onSubscribe(Subscription s);
public void onNext(T t);
public void onError(Throwable t);
public void onComplete();
}
❑ Represents the consumer of the stream data
Subscriber
13
public interface Subscription {
public void request(long n);
public void cancel();
}
Subscription
14
public interface Processor<T, R> extends
Subscriber<T>, Publisher<R> {
}
❑ A Processor represents a processing stage—which is both
a Subscriber and a Publisher.
Processor
15
Publisher/Subscriber Event Flow
16
Publisher/Subscriber Event Flow
17
Data Flow as an Event Driven Stream
18
Data Flow as an Event Driven Stream
❏ On Error
19
Data Flow as an Event Driven Stream
❏ No data
20
Back pressure
21
Project Reactor
and
Spring Webflux
22
❑ Reactor is a fully non-blocking reactive programming foundation for
the JVM, with efficient demand management (in the form of managing
"backpressure").
❑ Integrates directly with the Java 8 functional APIs, notably
CompletableFuture, Stream, and Duration.
❑ Reactive Types - Offers asynchronous sequence (MONO/FLUX) for
reactive streams
Project Reactor
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
</dependency>
23
❑ Publisher<T> that emits at most one item
❑ Optionally terminates with an onComplete signal or an onError signal.
Mono
24
❑ Publisher<T> that emits 0 to n items
❑ Optionally terminates with an onComplete signal or an onError signal.
Flux
25
Mono Vs Flux
Mono<Student> Flux<Student>
26
❑ Reactive-stack web framework
❑ Non Blocking and Supports Reactive Streams back
pressure
❑ Runs on such servers as Netty, Undertow, and Servlet 3.1+
containers.
Spring Webflux
27
DEMO
28
❑ https://projectreactor.io/
❑ https://github.com/reactive-streams/reactive-streams-jvm
❑ https://stackify.com/reactive-spring-5/
References
29
Thank You
30
Stay in touch
Contact Details:
vinsha.sharma@knoldus.com
or
linkedin.com/in/vinisha-sharma-26538a135

More Related Content

PDF
Understanding Reactive Programming
PDF
Introduction to Reactive Streams and Reactor 2.5
PDF
Reactive Programming in Java and Spring Framework 5
PDF
Declarative Concurrency with Reactive Programming
PPTX
Reactive programming
PDF
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
PPTX
Reactive programming with rx java
PDF
Reactive microservices with eclipse vert.x
Understanding Reactive Programming
Introduction to Reactive Streams and Reactor 2.5
Reactive Programming in Java and Spring Framework 5
Declarative Concurrency with Reactive Programming
Reactive programming
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
Reactive programming with rx java
Reactive microservices with eclipse vert.x

What's hot (20)

PDF
Servlet vs Reactive Stacks in 5 Use Cases
PDF
Reactive Card Magic: Understanding Spring WebFlux and Project Reactor
PDF
Reactive Microservices with Spring 5: WebFlux
PDF
Spring Boot on Amazon Web Services with Spring Cloud AWS
PDF
Reactive: Programming -> Systems -> Architecture
PDF
Building Distributed Systems with Netflix OSS and Spring Cloud
PDF
React-js
PPTX
Reactive for the Impatient - Mary Grygleski
PDF
Introducing Spring Framework 5.3
PDF
Introducing spring
PDF
Demo on JavaFX
PPTX
J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"
PDF
Arquitecturas de microservicios - Medianet Software
PPTX
React gsg presentation with ryan jung &amp; elias malik
PDF
Reactive java - Reactive Programming + RxJava
PDF
Spring GraphQL
PDF
From Spring Framework 5.3 to 6.0
PPTX
From Streams to Reactive Streams
PDF
Java APIs - the missing manual
PDF
What's new in java 9?
Servlet vs Reactive Stacks in 5 Use Cases
Reactive Card Magic: Understanding Spring WebFlux and Project Reactor
Reactive Microservices with Spring 5: WebFlux
Spring Boot on Amazon Web Services with Spring Cloud AWS
Reactive: Programming -> Systems -> Architecture
Building Distributed Systems with Netflix OSS and Spring Cloud
React-js
Reactive for the Impatient - Mary Grygleski
Introducing Spring Framework 5.3
Introducing spring
Demo on JavaFX
J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"
Arquitecturas de microservicios - Medianet Software
React gsg presentation with ryan jung &amp; elias malik
Reactive java - Reactive Programming + RxJava
Spring GraphQL
From Spring Framework 5.3 to 6.0
From Streams to Reactive Streams
Java APIs - the missing manual
What's new in java 9?
Ad

Similar to Let’s go reactive with JAVA (20)

PPTX
Reactive Programming In Java Using: Project Reactor
PDF
Spring Framework 5.0による Reactive Web Application #JavaDayTokyo
PDF
reactive_programming_for_java_developers.pdf
PDF
Guide to Spring Reactive Programming using WebFlux
PPTX
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
PDF
Reactive streams
PDF
Introduction to Spring webflux
PPTX
Reactive programming
PPTX
Going Reactive with Spring 5
PDF
Springone2gx 2014 Reactive Streams and Reactor
PDF
Workshop: Event-sourced system through Reactive Streams
PPTX
Workshop: Event-sourced system through Reactive Streams
PPTX
Reactive solutions using java 9 and spring reactor
PDF
Reactive Applications in Java
PPTX
Reactive programming for java developers
PDF
Spring 5 Webflux - Advances in Java 2018
PDF
Openbar 12 - Leuven - From reactive programming to reactive architecture
PDF
Getting into the flow building applications with reactive streams
PDF
Microservices with Spring 5 Webflux - jProfessionals
PDF
Embracing Reactive Streams with Java 9 and Spring 5
Reactive Programming In Java Using: Project Reactor
Spring Framework 5.0による Reactive Web Application #JavaDayTokyo
reactive_programming_for_java_developers.pdf
Guide to Spring Reactive Programming using WebFlux
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
Reactive streams
Introduction to Spring webflux
Reactive programming
Going Reactive with Spring 5
Springone2gx 2014 Reactive Streams and Reactor
Workshop: Event-sourced system through Reactive Streams
Workshop: Event-sourced system through Reactive Streams
Reactive solutions using java 9 and spring reactor
Reactive Applications in Java
Reactive programming for java developers
Spring 5 Webflux - Advances in Java 2018
Openbar 12 - Leuven - From reactive programming to reactive architecture
Getting into the flow building applications with reactive streams
Microservices with Spring 5 Webflux - jProfessionals
Embracing Reactive Streams with Java 9 and Spring 5
Ad

More from Tech Triveni (20)

PDF
UI Dev in Big data world using open source
PDF
Why should a Java programmer shifts towards Functional Programming Paradigm
PDF
Reactive - Is it really a Magic Pill?
PDF
Tackling Asynchrony with Kotlin Coroutines
PDF
Programmatic Ad Tracking: Let the power of Reactive Microservices do talking
PDF
Let's refine your Scala Code
PDF
Supercharged imperative programming with Haskell and Functional Programming
PDF
Observability at scale with Neural Networks: A more proactive approach
PDF
Semi-Supervised Insight Generation from Petabyte Scale Text Data
PDF
Finding the best solution for Image Processing
PDF
Proximity Targeting at Scale using Big Data Platforms
PDF
Effecting Pure Change - How anything ever gets done in functional programming...
PDF
Becoming a Functional Programmer - Harit Himanshu (Nomis Solutions)
PDF
Live coding session on AI / ML using Google Tensorflow (Python) - Tanmoy Deb ...
PDF
Distributing the SMACK stack - Kubernetes VS DCOS - Sahil Sawhney (Knoldus Inc.)
PDF
Blue Pill / Red Pill : The Matrix of thousands of data streams - Himanshu Gup...
PDF
UX in Big Data Analytics - Paramjit Jolly (Guavus)
PDF
Simplified Scala Monads And Transformation - Harmeet Singh (Knoldus Inc.)
PDF
Micro Frontends Architecture - Jitendra kumawat (Guavus)
PDF
Apache CarbonData+Spark to realize data convergence and Unified high performa...
UI Dev in Big data world using open source
Why should a Java programmer shifts towards Functional Programming Paradigm
Reactive - Is it really a Magic Pill?
Tackling Asynchrony with Kotlin Coroutines
Programmatic Ad Tracking: Let the power of Reactive Microservices do talking
Let's refine your Scala Code
Supercharged imperative programming with Haskell and Functional Programming
Observability at scale with Neural Networks: A more proactive approach
Semi-Supervised Insight Generation from Petabyte Scale Text Data
Finding the best solution for Image Processing
Proximity Targeting at Scale using Big Data Platforms
Effecting Pure Change - How anything ever gets done in functional programming...
Becoming a Functional Programmer - Harit Himanshu (Nomis Solutions)
Live coding session on AI / ML using Google Tensorflow (Python) - Tanmoy Deb ...
Distributing the SMACK stack - Kubernetes VS DCOS - Sahil Sawhney (Knoldus Inc.)
Blue Pill / Red Pill : The Matrix of thousands of data streams - Himanshu Gup...
UX in Big Data Analytics - Paramjit Jolly (Guavus)
Simplified Scala Monads And Transformation - Harmeet Singh (Knoldus Inc.)
Micro Frontends Architecture - Jitendra kumawat (Guavus)
Apache CarbonData+Spark to realize data convergence and Unified high performa...

Recently uploaded (20)

PDF
KodekX | Application Modernization Development
PDF
Machine learning based COVID-19 study performance prediction
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MYSQL Presentation for SQL database connectivity
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Spectroscopy.pptx food analysis technology
KodekX | Application Modernization Development
Machine learning based COVID-19 study performance prediction
Spectral efficient network and resource selection model in 5G networks
Mobile App Security Testing_ A Comprehensive Guide.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Programs and apps: productivity, graphics, security and other tools
MYSQL Presentation for SQL database connectivity
The Rise and Fall of 3GPP – Time for a Sabbatical?
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Building Integrated photovoltaic BIPV_UPV.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Diabetes mellitus diagnosis method based random forest with bat algorithm
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Dropbox Q2 2025 Financial Results & Investor Presentation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation theory and applications.pdf
Spectroscopy.pptx food analysis technology

Let’s go reactive with JAVA