SlideShare a Scribd company logo
-Bhargav
 Introduction to Reactive Programming
 Spring Boot 2.0 (Reactive Stack vs Servlet
Stack)
 Spring Web Flux Approaches with Demo
What is reactiveness?
It must react to its users (responsive).
It must react to failure and stay available (resilient).
It must react to variable load conditions (elastic/scalable).
It must react to inputs (message-driven).
What is reactive programming
Reactive Programming manages asynchronous
data flows between producers of data and
consumers that need to react to that data in a
non-blocking manner.
So, Reactive Programming is all about non-
blocking applications that are asynchronous and
event-driven and require a small number of
threads to scale.
Features of Reactive
Programming
 Asynchronous
 Message Driven
 Back Pressure
 Non-Blocking I/O
Back Pressure - Mechanism to ensure
producers don’t overwhelm consumers.
Blocking I/O
Non-Blocking I/O
Benefits of Reactive
Programming
 More Flexible
 Scalable/resilient
 Efficient Use of resources
 Less Latency
 More tolerance of failures
 Highly Responsive
Spring Reactive Stack
Spring Framework 5 embraces Reactive Streams as the contract
for communicating backpressure across async components and
libraries.
Reactive Streams is a specification created through industry
collaboration that has also been adopted in Java 9
as java.util.concurrent.Flow.
Mono: implements Publisher and returns 0 or 1 elements.
Flux: implements Publisher and returns N elements.
Spring Web Flux
Spring Framework 5 includes a new spring-webflux module.
The module contains support for reactive HTTP and
WebSocket clients as well as for reactive server web
applications including REST, HTML browser, and WebSocket
style interactions.
Important to know is that there are two ways to use Spring
Web flux.
One using annotations, which is quite similar to Spring MVC,
and one using a functional way.
Annotation Based
Programming Model
The annotation based model correlates most to what we have
been doing for years using Spring MVC.
We are able to use all the things we know, but in a reactive
manner. On the outside there is little difference. The biggest
change is on the inside. The underlying implementation is based
on a reactive implementation
of HttpServletRequest and HttpServletResponse
 JDK 1.8+
 Spring 5.0
 Spring Boot 2.0
 Reactive-Streams
 Netty/Jetty/Tomcat/Servlet 3.1+ Container
Server name Server API used Reactive Streams support
Netty Netty API Reactor Netty
Undertow Undertow API spring-web: Undertow to
Reactive Streams bridge
Tomcat Servlet 3.1 non-blocking
I/O; Tomcat API to read and
write ByteBuffers vs byte[]
spring-web: Servlet 3.1 non-
blocking I/O to Reactive
Streams bridge
Jetty Servlet 3.1 non-blocking
I/O; Jetty API to write
ByteBuffers vs byte[]
spring-web: Servlet 3.1 non-
blocking I/O to Reactive
Streams bridge
Servlet 3.1 container Servlet 3.1 non-blocking I/O spring-web: Servlet 3.1 non-
blocking I/O to Reactive
Streams bridge
https://docs.spring.io/spring/docs/current/spring-framework-
reference/web-reactive.html
http://www.reactive-streams.org/
https://spring.io/
http://projectreactor.io/

More Related Content

What's hot

Project Report
Project ReportProject Report
Project Report
OpatileKelobang
 
Deploying mule applications
Deploying mule applicationsDeploying mule applications
Deploying mule applications
Bhargav Ranjit
 
SOAP To REST API Proxy
SOAP To REST API ProxySOAP To REST API Proxy
SOAP To REST API Proxy
Vince Soliza
 
Mule esb–api layer
Mule esb–api layerMule esb–api layer
Mule esb–api layer
himajareddys
 
Mule -solutions for data integration
Mule -solutions for data integrationMule -solutions for data integration
Mule -solutions for data integration
D.Rajesh Kumar
 
Custom connector development using mule DevKit
Custom connector development using mule DevKitCustom connector development using mule DevKit
Custom connector development using mule DevKit
Ramakrishna Narkedamilli
 
Mule Concur Connector
Mule Concur ConnectorMule Concur Connector
Mule Concur Connector
Ankush Sharma
 
Mule data integration
Mule data integrationMule data integration
Mule data integration
keshav Naidu
 
Anypoint connector Roadmap
Anypoint connector RoadmapAnypoint connector Roadmap
Anypoint connector Roadmap
danishsm84
 
Андрій Рева, "How to build reactive java application"
Андрій Рева, "How to build reactive java application"Андрій Рева, "How to build reactive java application"
Андрій Рева, "How to build reactive java application"
Sigma Software
 
GraphQL Introduction with Spring Boot
GraphQL Introduction with Spring BootGraphQL Introduction with Spring Boot
GraphQL Introduction with Spring Boot
vipin kumar
 
Introduction to servlet
Introduction to servletIntroduction to servlet
Introduction to servlet
Yogi Suryadinata
 
Mule anypoint connector dev kit
Mule  anypoint connector dev kitMule  anypoint connector dev kit
Mule anypoint connector dev kit
D.Rajesh Kumar
 
Mule connectors
Mule  connectorsMule  connectors
Mule connectors
D.Rajesh Kumar
 
Using spring task scheduler in java in mule
Using spring task scheduler in java in muleUsing spring task scheduler in java in mule
Using spring task scheduler in java in mule
Anirban Sen Chowdhary
 
Meteor Workshop - Open Sanca
Meteor Workshop - Open SancaMeteor Workshop - Open Sanca
Meteor Workshop - Open Sanca
Paulo Hecht
 
Mule quartz
Mule quartz Mule quartz
Mule quartz
Praneethchampion
 

What's hot (18)

Project Report
Project ReportProject Report
Project Report
 
Deploying mule applications
Deploying mule applicationsDeploying mule applications
Deploying mule applications
 
SOAP To REST API Proxy
SOAP To REST API ProxySOAP To REST API Proxy
SOAP To REST API Proxy
 
Mule esb–api layer
Mule esb–api layerMule esb–api layer
Mule esb–api layer
 
Mule -solutions for data integration
Mule -solutions for data integrationMule -solutions for data integration
Mule -solutions for data integration
 
Custom connector development using mule DevKit
Custom connector development using mule DevKitCustom connector development using mule DevKit
Custom connector development using mule DevKit
 
Mule Concur Connector
Mule Concur ConnectorMule Concur Connector
Mule Concur Connector
 
Mule data integration
Mule data integrationMule data integration
Mule data integration
 
Anypoint connector Roadmap
Anypoint connector RoadmapAnypoint connector Roadmap
Anypoint connector Roadmap
 
Андрій Рева, "How to build reactive java application"
Андрій Рева, "How to build reactive java application"Андрій Рева, "How to build reactive java application"
Андрій Рева, "How to build reactive java application"
 
GraphQL Introduction with Spring Boot
GraphQL Introduction with Spring BootGraphQL Introduction with Spring Boot
GraphQL Introduction with Spring Boot
 
Introduction to servlet
Introduction to servletIntroduction to servlet
Introduction to servlet
 
Mule anypoint connector dev kit
Mule  anypoint connector dev kitMule  anypoint connector dev kit
Mule anypoint connector dev kit
 
Mule connectors
Mule  connectorsMule  connectors
Mule connectors
 
Using spring task scheduler in java in mule
Using spring task scheduler in java in muleUsing spring task scheduler in java in mule
Using spring task scheduler in java in mule
 
Meteor Workshop - Open Sanca
Meteor Workshop - Open SancaMeteor Workshop - Open Sanca
Meteor Workshop - Open Sanca
 
Mule quartz
Mule quartz Mule quartz
Mule quartz
 
Corespring
CorespringCorespring
Corespring
 

Similar to Spring reactor

Spring learning path
Spring learning pathSpring learning path
Spring learning path
SkillPracticalEdTech
 
Spring diy projects
Spring diy projectsSpring diy projects
Spring diy projects
SkillPracticalEdTech
 
Spring interview questions
Spring interview questionsSpring interview questions
Spring interview questions
SkillPracticalEdTech
 
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
Scrum Breakfast Vietnam
 
Reactive programming intro
Reactive programming introReactive programming intro
Reactive programming intro
Ahmed Ehab AbdulAziz
 
Reactive Applications in Java
Reactive Applications in JavaReactive Applications in Java
Reactive Applications in Java
Alexander Mrynskyi
 
Reactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaReactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJava
Ali Muzaffar
 
React js vs react native a comparative analysis
React js vs react native a comparative analysisReact js vs react native a comparative analysis
React js vs react native a comparative analysis
Shelly Megan
 
The Best Guide to Know What, Why, When to Use Is ReactJS
The Best Guide to Know What, Why, When to Use Is ReactJSThe Best Guide to Know What, Why, When to Use Is ReactJS
The Best Guide to Know What, Why, When to Use Is ReactJS
WeblineIndia
 
SERVER SIDE PROGRAMMING
SERVER SIDE PROGRAMMINGSERVER SIDE PROGRAMMING
SERVER SIDE PROGRAMMING
Prabu U
 
learning react
learning reactlearning react
learning react
Eueung Mulyana
 
Reactive programming with spring web flux
Reactive programming with spring web fluxReactive programming with spring web flux
Reactive programming with spring web flux
Ravindra Ranwala
 
React JS Components & Its Importance.docx
React JS Components & Its Importance.docxReact JS Components & Its Importance.docx
React JS Components & Its Importance.docx
React Masters
 
reactive_programming_for_java_developers.pdf
reactive_programming_for_java_developers.pdfreactive_programming_for_java_developers.pdf
reactive_programming_for_java_developers.pdf
Akshitkumar437417
 
Spring 5 Project Reactor
Spring 5 Project ReactorSpring 5 Project Reactor
Spring 5 Project Reactor
Geoffrey Filippi
 
React in Action ( PDFDrive ).pdf
React in Action ( PDFDrive ).pdfReact in Action ( PDFDrive ).pdf
React in Action ( PDFDrive ).pdf
almako2
 
From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reaction
jbandi
 
Skill practical javascript diy projects
Skill practical javascript diy projectsSkill practical javascript diy projects
Skill practical javascript diy projects
SkillPracticalEdTech
 

Similar to Spring reactor (20)

Spring learning path
Spring learning pathSpring learning path
Spring learning path
 
Spring diy projects
Spring diy projectsSpring diy projects
Spring diy projects
 
Spring interview questions
Spring interview questionsSpring interview questions
Spring interview questions
 
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018
 
Reactive programming intro
Reactive programming introReactive programming intro
Reactive programming intro
 
Reactive Applications in Java
Reactive Applications in JavaReactive Applications in Java
Reactive Applications in Java
 
Reactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaReactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJava
 
React js vs react native a comparative analysis
React js vs react native a comparative analysisReact js vs react native a comparative analysis
React js vs react native a comparative analysis
 
The Best Guide to Know What, Why, When to Use Is ReactJS
The Best Guide to Know What, Why, When to Use Is ReactJSThe Best Guide to Know What, Why, When to Use Is ReactJS
The Best Guide to Know What, Why, When to Use Is ReactJS
 
SERVER SIDE PROGRAMMING
SERVER SIDE PROGRAMMINGSERVER SIDE PROGRAMMING
SERVER SIDE PROGRAMMING
 
learning react
learning reactlearning react
learning react
 
Reactive programming with spring web flux
Reactive programming with spring web fluxReactive programming with spring web flux
Reactive programming with spring web flux
 
React JS Components & Its Importance.docx
React JS Components & Its Importance.docxReact JS Components & Its Importance.docx
React JS Components & Its Importance.docx
 
reactive_programming_for_java_developers.pdf
reactive_programming_for_java_developers.pdfreactive_programming_for_java_developers.pdf
reactive_programming_for_java_developers.pdf
 
Spring 5 Project Reactor
Spring 5 Project ReactorSpring 5 Project Reactor
Spring 5 Project Reactor
 
React in Action ( PDFDrive ).pdf
React in Action ( PDFDrive ).pdfReact in Action ( PDFDrive ).pdf
React in Action ( PDFDrive ).pdf
 
Servlet by Rj
Servlet by RjServlet by Rj
Servlet by Rj
 
From User Action to Framework Reaction
From User Action to Framework ReactionFrom User Action to Framework Reaction
From User Action to Framework Reaction
 
Skill practical javascript diy projects
Skill practical javascript diy projectsSkill practical javascript diy projects
Skill practical javascript diy projects
 
Marata
MarataMarata
Marata
 

Recently uploaded

Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 

Recently uploaded (20)

Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 

Spring reactor

  • 2.  Introduction to Reactive Programming  Spring Boot 2.0 (Reactive Stack vs Servlet Stack)  Spring Web Flux Approaches with Demo
  • 3. What is reactiveness? It must react to its users (responsive). It must react to failure and stay available (resilient). It must react to variable load conditions (elastic/scalable). It must react to inputs (message-driven).
  • 4. What is reactive programming Reactive Programming manages asynchronous data flows between producers of data and consumers that need to react to that data in a non-blocking manner. So, Reactive Programming is all about non- blocking applications that are asynchronous and event-driven and require a small number of threads to scale.
  • 5. Features of Reactive Programming  Asynchronous  Message Driven  Back Pressure  Non-Blocking I/O
  • 6.
  • 7. Back Pressure - Mechanism to ensure producers don’t overwhelm consumers.
  • 10. Benefits of Reactive Programming  More Flexible  Scalable/resilient  Efficient Use of resources  Less Latency  More tolerance of failures  Highly Responsive
  • 12. Spring Framework 5 embraces Reactive Streams as the contract for communicating backpressure across async components and libraries. Reactive Streams is a specification created through industry collaboration that has also been adopted in Java 9 as java.util.concurrent.Flow. Mono: implements Publisher and returns 0 or 1 elements. Flux: implements Publisher and returns N elements.
  • 13. Spring Web Flux Spring Framework 5 includes a new spring-webflux module. The module contains support for reactive HTTP and WebSocket clients as well as for reactive server web applications including REST, HTML browser, and WebSocket style interactions. Important to know is that there are two ways to use Spring Web flux. One using annotations, which is quite similar to Spring MVC, and one using a functional way.
  • 14. Annotation Based Programming Model The annotation based model correlates most to what we have been doing for years using Spring MVC. We are able to use all the things we know, but in a reactive manner. On the outside there is little difference. The biggest change is on the inside. The underlying implementation is based on a reactive implementation of HttpServletRequest and HttpServletResponse
  • 15.
  • 16.
  • 17.
  • 18.  JDK 1.8+  Spring 5.0  Spring Boot 2.0  Reactive-Streams  Netty/Jetty/Tomcat/Servlet 3.1+ Container
  • 19. Server name Server API used Reactive Streams support Netty Netty API Reactor Netty Undertow Undertow API spring-web: Undertow to Reactive Streams bridge Tomcat Servlet 3.1 non-blocking I/O; Tomcat API to read and write ByteBuffers vs byte[] spring-web: Servlet 3.1 non- blocking I/O to Reactive Streams bridge Jetty Servlet 3.1 non-blocking I/O; Jetty API to write ByteBuffers vs byte[] spring-web: Servlet 3.1 non- blocking I/O to Reactive Streams bridge Servlet 3.1 container Servlet 3.1 non-blocking I/O spring-web: Servlet 3.1 non- blocking I/O to Reactive Streams bridge
  • 20.