SlideShare una empresa de Scribd logo
1 de 16
Flamingo+ Team
Reactive
programming
By Spring WebFlux
► What is reactive programming?
► Introduction to Spring WebFlux.
► Features of Spring WebFlux.
► Reactive stack demo.
► Q&A.
Agenda
What is reactive programming?
- Reactive Programming is a programming paradigm.
- Meets today’s demands.
- Lays the foundation of Reactive Systems.
- Makes systems more flexible, scalable.
What is reactive programming?
- Four key attributes:
1. Responsive.
2. Resilient.
3. Elastic.
4. Message Driven.
more related to
the architecture choices
What is reactive programming?
- Message Driven
1. Failures as Messages.
2. Back Pressure.
3. Non-Blocking.
What is reactive programming?
- Use cases
1. External Service Calls.
2. Highly Concurrent Message Consumers.
3. Spreadsheets.
4. ...
Introduction to Spring WebFlux
- New framework of Spring 5.
- A part of Reactive stack.
- Embraces Reactive Streams and Reactor.
Introduction to Spring WebFlux
+ A standard and specification for Stream-oriented libraries.
+ Consists of four API components:
- Reactive Streams.
1. Publisher.
2. Subscriber.
3. Subscription.
4. Processor.
public interface Publisher<T> {
public void subscribe(Subscriber<? Super T> s);
}
public interface Subscriber<T> {
public void onSubscribe(Subscription s);
public void onNext(T t);
public void onError(Throwable t);
public void onComplete();
}
public interface Subscription<T> {
public void request(long n);
public void cancel();
}
public interface Processor<T, R> extends Subscriber<T>, Publisher<R> {
}
Publisher Subscriber
On Subscribe:
Request N items
Pushes N items
End
Publisher
End
Subscriber
Request
N items
Pushes
N items
Processor
(Subscriber
+
Publisher)
Request
N items
Pushes
N items
Introduction to Spring WebFlux
- Uses Reactor internally.
+ A Reactive Streams implementation.
+ A fully non-blocking foundation.
Features of Spring WebFlux
- Comparison:
Spring MVC Spring WebFlux
Annotations
Reactive client support
Blocking API support
Runtime server
Base HTTP API
Servlet container Servlet 3.1+ & non-servlet
Servlet / Filter classes Servlet 3.1+ API & HTTP
abstractions
Features of Spring WebFlux
- Comparison:
Spring MVC Spring WebFlux
Asynchronous web API
Non-blocking web API
Functional endpoints
Reactive web client
Reactive streams
No built-in Built-in
No built-in Built-in
No built-in
No built-in
No built-in
Built-in
Built-in
Built-in
Features of Spring WebFlux
- Comparison:
Spring MVC Spring WebFlux
Concurrency model
Thread usage
Memory usage
Processing time
At large scale
Slightly less Slightly more (less in parallel)
Quickly much degraded
performance
Slightly degraded performance
More blocked & slow request
process threads
Bigger data queues
Blocking
More non-blocking & fast
request process threads
Smaller data queues
Event-based loop workers
Features of Spring WebFlux
- Supports two distinct programming models:
+ Annotation-based.
+ Functional, Java 8 lambda style.
Reactive stack demo
- Stack:
Let's vote
Q&A
Spring
WebFlux
THANK YOU!

Más contenido relacionado

La actualidad más candente

Understanding Reactive Programming
Understanding Reactive ProgrammingUnderstanding Reactive Programming
Understanding Reactive ProgrammingAndres Almiray
 
Practical non blocking microservices in java 8
Practical non blocking microservices in java 8Practical non blocking microservices in java 8
Practical non blocking microservices in java 8Michal Balinski
 
Microservices with Spring 5 Webflux - jProfessionals
Microservices  with Spring 5 Webflux - jProfessionalsMicroservices  with Spring 5 Webflux - jProfessionals
Microservices with Spring 5 Webflux - jProfessionalsTrayan Iliev
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVCIndicThreads
 
Project Reactor Now and Tomorrow
Project Reactor Now and TomorrowProject Reactor Now and Tomorrow
Project Reactor Now and TomorrowVMware Tanzu
 
Servlet vs Reactive Stacks in 5 Use Cases
Servlet vs Reactive Stacks in 5 Use CasesServlet vs Reactive Stacks in 5 Use Cases
Servlet vs Reactive Stacks in 5 Use CasesVMware Tanzu
 
Intro to Reactive Programming
Intro to Reactive ProgrammingIntro to Reactive Programming
Intro to Reactive ProgrammingStéphane Maldini
 
Being Functional on Reactive Streams with Spring Reactor
Being Functional on Reactive Streams with Spring ReactorBeing Functional on Reactive Streams with Spring Reactor
Being Functional on Reactive Streams with Spring ReactorMax Huang
 
How to Avoid Common Mistakes When Using Reactor Netty
How to Avoid Common Mistakes When Using Reactor NettyHow to Avoid Common Mistakes When Using Reactor Netty
How to Avoid Common Mistakes When Using Reactor NettyVMware Tanzu
 
Introduction to Reactive programming
Introduction to Reactive programmingIntroduction to Reactive programming
Introduction to Reactive programmingDwi Randy Herdinanto
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOPDzmitry Naskou
 
Reactive Microservices with Spring 5: WebFlux
Reactive Microservices with Spring 5: WebFlux Reactive Microservices with Spring 5: WebFlux
Reactive Microservices with Spring 5: WebFlux Trayan Iliev
 
Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Hermann Hueck
 

La actualidad más candente (20)

Understanding Reactive Programming
Understanding Reactive ProgrammingUnderstanding Reactive Programming
Understanding Reactive Programming
 
Practical non blocking microservices in java 8
Practical non blocking microservices in java 8Practical non blocking microservices in java 8
Practical non blocking microservices in java 8
 
Microservices with Spring 5 Webflux - jProfessionals
Microservices  with Spring 5 Webflux - jProfessionalsMicroservices  with Spring 5 Webflux - jProfessionals
Microservices with Spring 5 Webflux - jProfessionals
 
Building RESTful applications using Spring MVC
Building RESTful applications using Spring MVCBuilding RESTful applications using Spring MVC
Building RESTful applications using Spring MVC
 
Project Reactor Now and Tomorrow
Project Reactor Now and TomorrowProject Reactor Now and Tomorrow
Project Reactor Now and Tomorrow
 
Servlet vs Reactive Stacks in 5 Use Cases
Servlet vs Reactive Stacks in 5 Use CasesServlet vs Reactive Stacks in 5 Use Cases
Servlet vs Reactive Stacks in 5 Use Cases
 
Intro to Reactive Programming
Intro to Reactive ProgrammingIntro to Reactive Programming
Intro to Reactive Programming
 
Project Reactor By Example
Project Reactor By ExampleProject Reactor By Example
Project Reactor By Example
 
Being Functional on Reactive Streams with Spring Reactor
Being Functional on Reactive Streams with Spring ReactorBeing Functional on Reactive Streams with Spring Reactor
Being Functional on Reactive Streams with Spring Reactor
 
Reactive Spring Framework 5
Reactive Spring Framework 5Reactive Spring Framework 5
Reactive Spring Framework 5
 
How to Avoid Common Mistakes When Using Reactor Netty
How to Avoid Common Mistakes When Using Reactor NettyHow to Avoid Common Mistakes When Using Reactor Netty
How to Avoid Common Mistakes When Using Reactor Netty
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Introduction to Reactive programming
Introduction to Reactive programmingIntroduction to Reactive programming
Introduction to Reactive programming
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOP
 
Java Spring
Java SpringJava Spring
Java Spring
 
Reactive Microservices with Spring 5: WebFlux
Reactive Microservices with Spring 5: WebFlux Reactive Microservices with Spring 5: WebFlux
Reactive Microservices with Spring 5: WebFlux
 
What's new in Java 11
What's new in Java 11What's new in Java 11
What's new in Java 11
 
Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8
 

Similar a Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018

Guide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxGuide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxInexture Solutions
 
Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2Mike Melusky
 
tc server - vfabric hyperic
tc server - vfabric hyperictc server - vfabric hyperic
tc server - vfabric hypericNadia Boumaza
 
OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)Folio3 Software
 
Swift at IBM: Mobile, open source and the drive to the cloud
Swift at IBM: Mobile, open source and the drive to the cloudSwift at IBM: Mobile, open source and the drive to the cloud
Swift at IBM: Mobile, open source and the drive to the cloudDev_Events
 
React gsg presentation with ryan jung &amp; elias malik
React   gsg presentation with ryan jung &amp; elias malikReact   gsg presentation with ryan jung &amp; elias malik
React gsg presentation with ryan jung &amp; elias malikLama K Banna
 
Spring Cloud: Why? How? What?
Spring Cloud: Why? How? What?Spring Cloud: Why? How? What?
Spring Cloud: Why? How? What?Orkhan Gasimov
 
Laravel : A Fastest Growing Kid
Laravel : A Fastest Growing KidLaravel : A Fastest Growing Kid
Laravel : A Fastest Growing KidEndive Software
 
Building RESTFUL APIs with Spring Webflux
Building RESTFUL APIs with Spring WebfluxBuilding RESTFUL APIs with Spring Webflux
Building RESTFUL APIs with Spring WebfluxKnoldus Inc.
 
2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portionmnriem
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework tola99
 
Rails request & middlewares
Rails request & middlewaresRails request & middlewares
Rails request & middlewaresSantosh Wadghule
 
Learn Advanced JAVA at ASIT
Learn Advanced JAVA at ASITLearn Advanced JAVA at ASIT
Learn Advanced JAVA at ASITASIT
 
Declarative Clients in Spring
Declarative Clients in SpringDeclarative Clients in Spring
Declarative Clients in SpringVMware Tanzu
 
NCUG 2019: Super charge your API’s with Reactive streams
NCUG 2019: Super charge your API’s with Reactive streamsNCUG 2019: Super charge your API’s with Reactive streams
NCUG 2019: Super charge your API’s with Reactive streamsFrank van der Linden
 
[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li
[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li
[QCon London 2020] The Future of Cloud Native API Gateways - Richard LiAmbassador Labs
 

Similar a Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018 (20)

Spring reactor
Spring reactorSpring reactor
Spring reactor
 
Guide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFluxGuide to Spring Reactive Programming using WebFlux
Guide to Spring Reactive Programming using WebFlux
 
Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2Reactive Web Development with Spring Boot 2
Reactive Web Development with Spring Boot 2
 
tc server - vfabric hyperic
tc server - vfabric hyperictc server - vfabric hyperic
tc server - vfabric hyperic
 
Reactive Applications in Java
Reactive Applications in JavaReactive Applications in Java
Reactive Applications in Java
 
OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)OWIN (Open Web Interface for .NET)
OWIN (Open Web Interface for .NET)
 
Swift at IBM: Mobile, open source and the drive to the cloud
Swift at IBM: Mobile, open source and the drive to the cloudSwift at IBM: Mobile, open source and the drive to the cloud
Swift at IBM: Mobile, open source and the drive to the cloud
 
React gsg presentation with ryan jung &amp; elias malik
React   gsg presentation with ryan jung &amp; elias malikReact   gsg presentation with ryan jung &amp; elias malik
React gsg presentation with ryan jung &amp; elias malik
 
Spring Cloud: Why? How? What?
Spring Cloud: Why? How? What?Spring Cloud: Why? How? What?
Spring Cloud: Why? How? What?
 
Laravel : A Fastest Growing Kid
Laravel : A Fastest Growing KidLaravel : A Fastest Growing Kid
Laravel : A Fastest Growing Kid
 
Building RESTFUL APIs with Spring Webflux
Building RESTFUL APIs with Spring WebfluxBuilding RESTFUL APIs with Spring Webflux
Building RESTFUL APIs with Spring Webflux
 
2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion2015 UJUG, Servlet 4.0 portion
2015 UJUG, Servlet 4.0 portion
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
 
Servlet by Rj
Servlet by RjServlet by Rj
Servlet by Rj
 
Rails request & middlewares
Rails request & middlewaresRails request & middlewares
Rails request & middlewares
 
Learn Advanced JAVA at ASIT
Learn Advanced JAVA at ASITLearn Advanced JAVA at ASIT
Learn Advanced JAVA at ASIT
 
Declarative Clients in Spring
Declarative Clients in SpringDeclarative Clients in Spring
Declarative Clients in Spring
 
Icws 2016 v1
Icws 2016 v1Icws 2016 v1
Icws 2016 v1
 
NCUG 2019: Super charge your API’s with Reactive streams
NCUG 2019: Super charge your API’s with Reactive streamsNCUG 2019: Super charge your API’s with Reactive streams
NCUG 2019: Super charge your API’s with Reactive streams
 
[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li
[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li
[QCon London 2020] The Future of Cloud Native API Gateways - Richard Li
 

Más de Scrum Breakfast Vietnam

[Scrum Breakfast DN] Is it possible to make 100% Unit Test coverage for your ...
[Scrum Breakfast DN] Is it possible to make 100% Unit Test coverage for your ...[Scrum Breakfast DN] Is it possible to make 100% Unit Test coverage for your ...
[Scrum Breakfast DN] Is it possible to make 100% Unit Test coverage for your ...Scrum Breakfast Vietnam
 
Zero to hero in agile automation testing
Zero to hero in agile automation testingZero to hero in agile automation testing
Zero to hero in agile automation testingScrum Breakfast Vietnam
 
Retrospective Toolbox - HCMC Scrum Breakfast - 30/11/2019
Retrospective Toolbox - HCMC Scrum Breakfast - 30/11/2019Retrospective Toolbox - HCMC Scrum Breakfast - 30/11/2019
Retrospective Toolbox - HCMC Scrum Breakfast - 30/11/2019Scrum Breakfast Vietnam
 
Team building in the Infinite game - HCMC Scrum Breakfast - 28/09/2019
Team building in the Infinite game - HCMC Scrum Breakfast - 28/09/2019Team building in the Infinite game - HCMC Scrum Breakfast - 28/09/2019
Team building in the Infinite game - HCMC Scrum Breakfast - 28/09/2019Scrum Breakfast Vietnam
 
Design Thinking in Solving Problem - HCMC Scrum Breakfast - July 27, 2019
Design Thinking in Solving Problem - HCMC Scrum Breakfast - July 27, 2019Design Thinking in Solving Problem - HCMC Scrum Breakfast - July 27, 2019
Design Thinking in Solving Problem - HCMC Scrum Breakfast - July 27, 2019Scrum Breakfast Vietnam
 
Make your Scrum team great again - DN Scrum Breakfast - June 21, 2019
Make your Scrum team great again - DN Scrum Breakfast - June 21, 2019Make your Scrum team great again - DN Scrum Breakfast - June 21, 2019
Make your Scrum team great again - DN Scrum Breakfast - June 21, 2019Scrum Breakfast Vietnam
 
Working as a remote team - HCM Scrum Breakfast - May 25, 2019
Working as a remote team - HCM Scrum Breakfast - May 25, 2019Working as a remote team - HCM Scrum Breakfast - May 25, 2019
Working as a remote team - HCM Scrum Breakfast - May 25, 2019Scrum Breakfast Vietnam
 
Benefits of BPMN in Software Development - DN Scrum Breakfast - September 29,...
Benefits of BPMN in Software Development - DN Scrum Breakfast - September 29,...Benefits of BPMN in Software Development - DN Scrum Breakfast - September 29,...
Benefits of BPMN in Software Development - DN Scrum Breakfast - September 29,...Scrum Breakfast Vietnam
 
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...Scrum Breakfast Vietnam
 
Automation Testing in Agile - HCM Scrum Breakfast - July 2018
Automation Testing in Agile - HCM Scrum Breakfast - July 2018Automation Testing in Agile - HCM Scrum Breakfast - July 2018
Automation Testing in Agile - HCM Scrum Breakfast - July 2018Scrum Breakfast Vietnam
 
[DN Scrum Breakfast] API Automation Testing Using Retrofit & Cucumber
[DN Scrum Breakfast] API Automation Testing Using Retrofit & Cucumber[DN Scrum Breakfast] API Automation Testing Using Retrofit & Cucumber
[DN Scrum Breakfast] API Automation Testing Using Retrofit & CucumberScrum Breakfast Vietnam
 
[HCM Scrum Breakfast - April 2018] Teamwork: The Leader Job (Pt.1)
[HCM Scrum Breakfast - April 2018] Teamwork: The Leader Job (Pt.1)[HCM Scrum Breakfast - April 2018] Teamwork: The Leader Job (Pt.1)
[HCM Scrum Breakfast - April 2018] Teamwork: The Leader Job (Pt.1)Scrum Breakfast Vietnam
 
[DN Scrum Breakfast] Effective Cloud Computing
[DN Scrum Breakfast] Effective Cloud Computing[DN Scrum Breakfast] Effective Cloud Computing
[DN Scrum Breakfast] Effective Cloud ComputingScrum Breakfast Vietnam
 
[HCM Scrum Breakfast - January 2018] ElasticSearch In Action
[HCM Scrum Breakfast - January 2018] ElasticSearch In Action[HCM Scrum Breakfast - January 2018] ElasticSearch In Action
[HCM Scrum Breakfast - January 2018] ElasticSearch In ActionScrum Breakfast Vietnam
 
[DN Scrum Breakfast] Automation E2E Testing with Chimp Framework and WebdriverIO
[DN Scrum Breakfast] Automation E2E Testing with Chimp Framework and WebdriverIO[DN Scrum Breakfast] Automation E2E Testing with Chimp Framework and WebdriverIO
[DN Scrum Breakfast] Automation E2E Testing with Chimp Framework and WebdriverIOScrum Breakfast Vietnam
 
[DN Scrum Breakfast] Scrum Master, do we really need one_by Nam Dang_Mar2016
[DN Scrum Breakfast] Scrum Master, do we really need one_by Nam Dang_Mar2016[DN Scrum Breakfast] Scrum Master, do we really need one_by Nam Dang_Mar2016
[DN Scrum Breakfast] Scrum Master, do we really need one_by Nam Dang_Mar2016Scrum Breakfast Vietnam
 
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)Scrum Breakfast Vietnam
 
[HCM Scrum Breakfast - June 2017] Distributed Team
[HCM Scrum Breakfast - June 2017] Distributed Team[HCM Scrum Breakfast - June 2017] Distributed Team
[HCM Scrum Breakfast - June 2017] Distributed TeamScrum Breakfast Vietnam
 

Más de Scrum Breakfast Vietnam (20)

[Scrum Breakfast DN] Is it possible to make 100% Unit Test coverage for your ...
[Scrum Breakfast DN] Is it possible to make 100% Unit Test coverage for your ...[Scrum Breakfast DN] Is it possible to make 100% Unit Test coverage for your ...
[Scrum Breakfast DN] Is it possible to make 100% Unit Test coverage for your ...
 
Zero to hero in agile automation testing
Zero to hero in agile automation testingZero to hero in agile automation testing
Zero to hero in agile automation testing
 
Retrospective Toolbox - HCMC Scrum Breakfast - 30/11/2019
Retrospective Toolbox - HCMC Scrum Breakfast - 30/11/2019Retrospective Toolbox - HCMC Scrum Breakfast - 30/11/2019
Retrospective Toolbox - HCMC Scrum Breakfast - 30/11/2019
 
UI/UX Design in Agile process
UI/UX Design in Agile process  UI/UX Design in Agile process
UI/UX Design in Agile process
 
Team building in the Infinite game - HCMC Scrum Breakfast - 28/09/2019
Team building in the Infinite game - HCMC Scrum Breakfast - 28/09/2019Team building in the Infinite game - HCMC Scrum Breakfast - 28/09/2019
Team building in the Infinite game - HCMC Scrum Breakfast - 28/09/2019
 
Design Thinking in Solving Problem - HCMC Scrum Breakfast - July 27, 2019
Design Thinking in Solving Problem - HCMC Scrum Breakfast - July 27, 2019Design Thinking in Solving Problem - HCMC Scrum Breakfast - July 27, 2019
Design Thinking in Solving Problem - HCMC Scrum Breakfast - July 27, 2019
 
Make your Scrum team great again - DN Scrum Breakfast - June 21, 2019
Make your Scrum team great again - DN Scrum Breakfast - June 21, 2019Make your Scrum team great again - DN Scrum Breakfast - June 21, 2019
Make your Scrum team great again - DN Scrum Breakfast - June 21, 2019
 
Working as a remote team - HCM Scrum Breakfast - May 25, 2019
Working as a remote team - HCM Scrum Breakfast - May 25, 2019Working as a remote team - HCM Scrum Breakfast - May 25, 2019
Working as a remote team - HCM Scrum Breakfast - May 25, 2019
 
Benefits of BPMN in Software Development - DN Scrum Breakfast - September 29,...
Benefits of BPMN in Software Development - DN Scrum Breakfast - September 29,...Benefits of BPMN in Software Development - DN Scrum Breakfast - September 29,...
Benefits of BPMN in Software Development - DN Scrum Breakfast - September 29,...
 
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...
CSS Flexbox and Grid: The future of website layouts - DN Scrum Breakfast - Au...
 
Automation Testing in Agile - HCM Scrum Breakfast - July 2018
Automation Testing in Agile - HCM Scrum Breakfast - July 2018Automation Testing in Agile - HCM Scrum Breakfast - July 2018
Automation Testing in Agile - HCM Scrum Breakfast - July 2018
 
[DN Scrum Breakfast] API Automation Testing Using Retrofit & Cucumber
[DN Scrum Breakfast] API Automation Testing Using Retrofit & Cucumber[DN Scrum Breakfast] API Automation Testing Using Retrofit & Cucumber
[DN Scrum Breakfast] API Automation Testing Using Retrofit & Cucumber
 
[HCM Scrum Breakfast - April 2018] Teamwork: The Leader Job (Pt.1)
[HCM Scrum Breakfast - April 2018] Teamwork: The Leader Job (Pt.1)[HCM Scrum Breakfast - April 2018] Teamwork: The Leader Job (Pt.1)
[HCM Scrum Breakfast - April 2018] Teamwork: The Leader Job (Pt.1)
 
[DN Scrum Breakfast] Effective Cloud Computing
[DN Scrum Breakfast] Effective Cloud Computing[DN Scrum Breakfast] Effective Cloud Computing
[DN Scrum Breakfast] Effective Cloud Computing
 
[HCM Scrum Breakfast - January 2018] ElasticSearch In Action
[HCM Scrum Breakfast - January 2018] ElasticSearch In Action[HCM Scrum Breakfast - January 2018] ElasticSearch In Action
[HCM Scrum Breakfast - January 2018] ElasticSearch In Action
 
[DN Scrum Breakfast] Automation E2E Testing with Chimp Framework and WebdriverIO
[DN Scrum Breakfast] Automation E2E Testing with Chimp Framework and WebdriverIO[DN Scrum Breakfast] Automation E2E Testing with Chimp Framework and WebdriverIO
[DN Scrum Breakfast] Automation E2E Testing with Chimp Framework and WebdriverIO
 
[DN Scrum Breakfast] Scrum Master, do we really need one_by Nam Dang_Mar2016
[DN Scrum Breakfast] Scrum Master, do we really need one_by Nam Dang_Mar2016[DN Scrum Breakfast] Scrum Master, do we really need one_by Nam Dang_Mar2016
[DN Scrum Breakfast] Scrum Master, do we really need one_by Nam Dang_Mar2016
 
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
[DN Scrum Breakfast] Protractor: E2E Testing for AngularJS (by Thuy Nguyen)
 
[Da Nang Scrum Breakfast] Angular Tour
[Da Nang Scrum Breakfast] Angular Tour[Da Nang Scrum Breakfast] Angular Tour
[Da Nang Scrum Breakfast] Angular Tour
 
[HCM Scrum Breakfast - June 2017] Distributed Team
[HCM Scrum Breakfast - June 2017] Distributed Team[HCM Scrum Breakfast - June 2017] Distributed Team
[HCM Scrum Breakfast - June 2017] Distributed Team
 

Último

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...kalichargn70th171
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfryanfarris8
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 

Último (20)

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 

Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018

  • 2. ► What is reactive programming? ► Introduction to Spring WebFlux. ► Features of Spring WebFlux. ► Reactive stack demo. ► Q&A. Agenda
  • 3. What is reactive programming? - Reactive Programming is a programming paradigm. - Meets today’s demands. - Lays the foundation of Reactive Systems. - Makes systems more flexible, scalable.
  • 4. What is reactive programming? - Four key attributes: 1. Responsive. 2. Resilient. 3. Elastic. 4. Message Driven. more related to the architecture choices
  • 5. What is reactive programming? - Message Driven 1. Failures as Messages. 2. Back Pressure. 3. Non-Blocking.
  • 6. What is reactive programming? - Use cases 1. External Service Calls. 2. Highly Concurrent Message Consumers. 3. Spreadsheets. 4. ...
  • 7. Introduction to Spring WebFlux - New framework of Spring 5. - A part of Reactive stack. - Embraces Reactive Streams and Reactor.
  • 8. Introduction to Spring WebFlux + A standard and specification for Stream-oriented libraries. + Consists of four API components: - Reactive Streams. 1. Publisher. 2. Subscriber. 3. Subscription. 4. Processor. public interface Publisher<T> { public void subscribe(Subscriber<? Super T> s); } public interface Subscriber<T> { public void onSubscribe(Subscription s); public void onNext(T t); public void onError(Throwable t); public void onComplete(); } public interface Subscription<T> { public void request(long n); public void cancel(); } public interface Processor<T, R> extends Subscriber<T>, Publisher<R> { } Publisher Subscriber On Subscribe: Request N items Pushes N items End Publisher End Subscriber Request N items Pushes N items Processor (Subscriber + Publisher) Request N items Pushes N items
  • 9. Introduction to Spring WebFlux - Uses Reactor internally. + A Reactive Streams implementation. + A fully non-blocking foundation.
  • 10. Features of Spring WebFlux - Comparison: Spring MVC Spring WebFlux Annotations Reactive client support Blocking API support Runtime server Base HTTP API Servlet container Servlet 3.1+ & non-servlet Servlet / Filter classes Servlet 3.1+ API & HTTP abstractions
  • 11. Features of Spring WebFlux - Comparison: Spring MVC Spring WebFlux Asynchronous web API Non-blocking web API Functional endpoints Reactive web client Reactive streams No built-in Built-in No built-in Built-in No built-in No built-in No built-in Built-in Built-in Built-in
  • 12. Features of Spring WebFlux - Comparison: Spring MVC Spring WebFlux Concurrency model Thread usage Memory usage Processing time At large scale Slightly less Slightly more (less in parallel) Quickly much degraded performance Slightly degraded performance More blocked & slow request process threads Bigger data queues Blocking More non-blocking & fast request process threads Smaller data queues Event-based loop workers
  • 13. Features of Spring WebFlux - Supports two distinct programming models: + Annotation-based. + Functional, Java 8 lambda style.
  • 14. Reactive stack demo - Stack: Let's vote

Notas del editor

  1. Let’s start The November Scrum breakfast – Reactive programming by Spring WebFlux
  2. About the agenda The first section is what is reactive programming? We will answer this question and clarify some point around it. The second one is introduction to Spring WebFlux? In the third section, we will discuss the features of Spring WebFlux. Then, we will show you a demo application with reactive stack. The final section is Q&A. Okay, let’s jump to the first part
  3. What is reactive programming? The simplest answer is it is a programming paradigm. Reactive Programming is a programming paradigm concerned with data streams and the propagation of change. Just like object oriented programming, functional programming, or procedural programming. It isn’t new, it’s actually been around for awhile, is traced to the 1970s or even earlier. Which is its benefit? With this paradigm it is possible to express static (e.g., arrays) or dynamic (e.g., event emitters) data streams with ease, and also communicate that an inferred dependency (sự phụ thuộc được đoán trước) within the associated execution model exists, which facilitates the automatic propagation of the changed data flow. Compare today’s demands and yesterday’s. Only a few years ago a large application had tens of servers, seconds of response time, hours of offline maintenance and gigabytes of data. Today applications are deployed on everything from mobile devices to cloud-based clusters running thousands of multi-core processors. Users expect millisecond response times and 100% uptime. Data is measured in Petabytes.
  4. Responsive: The system responds in a timely manner if at all possible. Responsiveness is the cornerstone of usability and utility, but more than that, responsiveness means that problems may be detected quickly and dealt with effectively. Responsive systems focus on providing rapid and consistent response times, establishing reliable upper bounds so they deliver a consistent quality of service. This consistent behavior in turn simplifies error handling, builds end user confidence, and encourages further interaction. Resilient: The system stays responsive in the face of failure. This applies not only to highly-available, mission-critical systems — any system that is not resilient will be unresponsive after a failure. Resilience is achieved by replication, containment, isolation and delegation. Failures are contained within each component, isolating components from each other and thereby ensuring that parts of the system can fail and recover without compromising the system as a whole. Recovery of each component is delegated to another (external) component and high-availability is ensured by replication where necessary. The client of a component is not burdened with handling its failures. Elastic: The system stays responsive under varying workload. Reactive Systems can react to changes in the input rate by increasing or decreasing the resources allocated to service these inputs. This implies designs that have no contention points or central bottlenecks, resulting in the ability to shard or replicate components and distribute inputs among them. Reactive Systems support predictive, as well as Reactive, scaling algorithms by providing relevant live performance measures. They achieve elasticity in a cost-effective way on commodity hardware and software platforms.
  5. Message Driven: Reactive Systems rely on asynchronous message-passing to establish a boundary between components that ensures loose coupling, isolation and location transparency. This boundary also provides the means to delegate failures as messages. Employing explicit message-passing enables load management, elasticity, and flow control by shaping and monitoring the message queues in the system and applying back-pressure when necessary. Location transparent messaging as a means of communication makes it possible for the management of failure to work with the same constructs and semantics across a cluster or within a single host. Non-blocking communication allows recipients to only consume resources while active, leading to less system overhead.
  6. Nhiều dịch vụ phụ trợ trong những ngày này là REST-ful (tức là chúng hoạt động trên HTTP) để giao tiếp về cơ bản là blocking và đồng bộ. Việc thực hiện các dịch vụ như vậy thường liên quan đến việc gọi các dịch vụ khác, và sau đó nhiều dịch vụ hơn tùy thuộc vào kết quả từ các cuộc gọi đầu tiên. Với quá nhiều IO đang diễn ra nếu bạn chờ một request hoàn thành trước khi gửi yêu cầu tiếp theo, điều này có thể dẫn đến sự chậm trễ. Vì vậy, các cuộc gọi dịch vụ bên ngoài, đặc biệt là sự phối hợp phức tạp của các phụ thuộc giữa các cuộc gọi, là một điều tốt để tối ưu hóa. FRP cung cấp lời hứa về "khả năng tổng hợp" của logic thúc đẩy các hoạt động đó, để dễ viết hơn cho nhà phát triển dịch vụ gọi điện. Xử lý tin nhắn, đặc biệt khi nó yêu cầu đồng thời cao, là một trường hợp sử dụng chung của doanh nghiệp. Perhaps not really an enterprise use case, but one that everyone in the enterprise can easily relate to, and it nicely captures the philosophy of, and difficulty of implementing RP. If cell B depends on cell A, and cell C depends on both cells A and B, then how do you propagate changes in A, ensuring that C is updated before any change events are sent to B? If you have a truly reactive framework to build on, then the answer is "you don’t care, you just declare the dependencies," and that is really the power of a spreadsheet in a nutshell. It also highlights the difference between FRP and simple event-driven programming — it puts the "intelligent" in "intelligent routing".
  7. Webflux là gì? Bắt đầu JAVA 8 Java 8 có Stream collection và biểu thức Lambda Java 9, Reactive stream là 1 chuẩn chính thống. Spring webflux ra đời cùng phiên bản mới nhất của Spring 5 Thuộc Reactive-stack Áp dụng chuẩn Reactive Streams thông qua implementation Reactor (sẽ nói sau) Dùng chung với Spring MVC
  8. Reactive Streams là gì? Java 8 ⇒ chưa công nhận là chuẩn chính thống Java 9 ⇒ tích hợp và là 1 phần suorce code của JAVA (không cần import thêm) Có 4 interface: Publisher, Subscriber, Subscription, Processor Publisher: Nhà cung cấp không giới hạn (phụ thuộc người nhận) Ví dụ yêu cầu 10 gói data Người nhận là Subscriber Subscriber: Lắng nghe liên tục Quyết định hành động sẽ thực hiện (onNext, onComplete, onError) onSubscribe() Thông báo cho Publisher muốn bắt đầu nhận dữ liệu Hàm subscribe() của Publisher để đăng ký và ghi danh Subscriber vào hồ sơ để truyền nhận dữ liệu Subscription: Là 1 tham số trong onSubscribe() request(n) thông báo bắt đầu nhận data và số lượng nhận cancel() kết thúc lắng nghe. Processor: Với 3 interface hoàn toàn có thể thực hiện truyền/nhận/xử lý dữ liệu Là sự pha trộn của Publisher và Subscriber Optional Ví dụ có 3 Services A, B và C
  9. Để có thể sử dụng Reactive Streams thì cần implement nó Có thể sử dụng thư viện implementation Webflux sử dụng implementation Reactor Tích hợp sẵn trong Webflux Ngoài Reactor, vẫn còn nhiều thư viện implementation như RxJava, Akka Streams Support non-blocking mạnh mẽ ⇒ Giảm số lượng thread, Tiết kiệm resource server ⇒ Tăng tốc ứng dụng Tổng kết Webflux: là 1 Framework ra mắt cùng với phiên bản Spring 5, xây dựng ứng dụng reactive web Webflux sử dụng chuẩn Reactive Streams Reactor là implementation của Reactive Streams được cài đặt mặc định và được sử dụng bới Webflux
  10. Mình xin tiếp tục buổi chia sẻ với phần demo reactive stack. Team mình xây dựng một ứng dụng giúp người sử dụng có thể thực hiện việc bầu chọn và theo dõi kết quả trực tiếp, không thông qua bất kỳ hành động tải lại dữ liệu nào.Stack team mình chọn bao gồm: Angular, Spring boot, MongoDB, Heroku. Ở phía database, team sử dụng một non-blocking database khá thân thiện với nhiều thành viên trong team, MongoDB. Ngoài ra, còn có nhiều cơ sở dữ liệu non-blocking khác có thể được lựa chọn như Redis, Cassandra,... Về phía back-end, team lựa chọn sử dụng Spring Boot, sử dụng việc truy vấn dữ liệu thông qua Repository và sử lý Request với Controller trả về response với content-type: text/event-stream. Phần client giao tiếp trực tiếp với người dùng được xây dựng bằng Angular, một framework nổi tiếng và phổ biến hiện nay. WebFlux hỗ trợ cả hai giao thức Websocket và HTTP, tuy nhiên team đã lựa chọn sử dụng HTTP nên ở client sẽ sử dụng EventSource, một đối tượng mới được giới thiệu trong HTML5, để mở kết nối và nhận dữ liệu event-steam từ phía server. Ứng dụng được deploy trên Heroku, một cloud platform với các services được hosted trên Amazon's EC2. Trên đây là phần giới thiệu tổng quan về ứng dụng. Tiếp đến mình sẽ thử tương tác với ứng dụng. Các anh chị có thể quét mã QR để truy cập và đường dẫn. Để đơn giản và thuận tiện, ứng dụng có 2 phần riêng biệt để có thể bình chọn và theo dõi kết quả. Câu hỏi hiện tại là ... với 4 câu trả lời lần lượt như trên. Các giá trị hiện tại lần lượt là ... Mình sẽ thực hiện thao tác chọn với câu trả lời ... bằng qua điện thoại. Ngay lập tức kết quả đã được cập nhật. Mọi người có thể trực tiếp thao tác để trải nghiệm.
  11. Nó không phải là chỉ là một mốt công nghệ. Với nó tài nguyên được sử dụng hiệu quả hơn, hay nói cách khác, chi tiêu ít tiền hơn cho các máy chủ và trung tâm dữ liệu. Lời hứa của Reactive là bạn có thể làm được nhiều hơn với ít chi phí hơn, cụ thể là bạn có thể xử lý các tải cao hơn với ít chuỗi hơn. Reactive không giải quyết được vấn đề cho bạn, nó chỉ cung cấp cho bạn một hộp công cụ mà bạn có thể sử dụng để thực hiện các giải pháp.