SlideShare a Scribd company logo
Being Reactive with SpringBeing Reactive with Spring
Kris Galea
1
What's all this about?!What's all this about?!
Being Reactive .. huh ?Being Reactive .. huh ?
Nothing to do with Facebook's React Framework!
Face the challenges of popularity
Building robust applications for when it matters most
..with.. Spring?..with.. Spring?
Java framework
better than sliced bread (or ftira)
Java!Java!
What's all this Reactive-ness?!What's all this Reactive-ness?!
This fantastic thing called "The Internet"
Di culties in dealing with growing number of requests
Get to grips with the idea of Reactive Programming
2 . 2
Let's get some things straight!Let's get some things straight!
Publisher-Subscriber Messaging Pattern
Data Streams
Get technical ...Get technical ...
Java 8/9
Spring 5
Super exciting demo of Reactive Spring!Super exciting demo of Reactive Spring!
2 . 3
But rst! A little about us ...But rst! A little about us ...
Hi!Hi!
and something about yours truly...and something about yours truly...
Email: kristiang@ccbill.comEmail: kristiang@ccbill.com
Github: https://github.com/krisgaleaGithub: https://github.com/krisgalea
Slides:Slides:
https://www.slideshare.net/KrisGalea/being-https://www.slideshare.net/KrisGalea/being-
reactive-with-springreactive-with-spring
3 . 2
Where all this began ...Where all this began ...
Welcome to ...Welcome to ... The InternetThe Internet
The internet is growingThe internet is growing
4 . 2
Challenges of a Growing InternetChallenges of a Growing Internet
Number of requests increases
E-Commerce: businesses are now online
Multiple ways of scaling: hardware vs. software
Maintaining consistency come rain or shine
4 . 3
Let's talk ReactiveLet's talk Reactive
A Set of Principles/GuidelinesA Set of Principles/Guidelines
A software oriented approach to robustness
Not, strictly speaking, anything technical
A set of guidelines which motivate design decisions made from the ground
up
A way to ensure that applications are built to withstand the di culties of
modern necessities
5 . 2
One Manifesto to Rule them all ...One Manifesto to Rule them all ...
5 . 3
Technically speaking ...Technically speaking ...
Use of functional approach to allow an application to react to changes in
the environment as they happen
vs
Use of data streams to transmit changes from the source to the
destination
Use of the publisher-subscriber pattern
a:= b + c
a:= changing(b) + changing(c)
5 . 4
Let's try this out ...Let's try this out ...
5 . 5
A word about Backpressure...A word about Backpressure...
Hot vs Cold message emitting
Push vs Pull vs Hybrid-push-pull
5 . 6
Let's Get Down to Basics ...Let's Get Down to Basics ...
6
Publisher-Subscriber MessagingPublisher-Subscriber Messaging
PatternPattern
Messaging Pattern (architectural)
3 main actors: Publisher , Subscriber and Subscription
7 . 2
Subscribers subscribe to changes in the Publisher using a
Subscription
Publisher noti es of changes in its state
Publisher is not aware of the Subscriber's details
7 . 3
loose coupling
Allows for easy scalability using a common Message Bus
Message Broker can be as sophisticated or as dumb as needed
7 . 4
Data StreamsData Streams
A sequence of elements from a collection or data source
Pipes data from a source to a destination
Enforces statelessness (and immutability)
Easily parallellised
Allows chaining of Functional Operators
In Java implemented plainly as Streams
8 . 2
Functional Operator ChainingFunctional Operator Chaining
8 . 3
Functional Operator ChainingFunctional Operator Chaining
8 . 4
Functional Operator ChainingFunctional Operator Chaining
8 . 5
8 . 6
Let's Get Technical!Let's Get Technical!
9
Reactive and Java 8 & 9Reactive and Java 8 & 9
Paradigm shiftParadigm shift
10 . 2
Implementation of Streams as of Java 8Implementation of Streams as of Java 8
Use ofUse of Stream/Functional OperatorsStream/Functional Operators
Intermediate Operators
Terminal Operators
List <Integer> numbers = List.of(2,3,4,5,6);
numbers.stream().filter(number -> number > 4).forEach(num -> System.out.println(num));
10 . 3
PublisherPublisher
10 . 4
SubscriberSubscriber
10 . 5
SubscriptionSubscription
10 . 6
SpringSpring
A Java framework for enterprise quality applications
Dependency Injection and Inversion of Control
Convention over con guration
Annotation based
Provides a large tool set to quickly get up and running e.g. Spring Boot
11 . 2
Spring Reactive Data TypesSpring Reactive Data Types
11 . 3
11 . 4
Let's try all this out !Let's try all this out !
Let's pretend to process feeds from socialLet's pretend to process feeds from social
networks ...networks ...
That's it!That's it!
In this talk we've learned:In this talk we've learned:
What Reactive Programming is and why it's useful
The core concepts used to implement Reactive
Which industry tools are used to develop Reactive applications
13
Questions?Questions?
14
thx! <3thx! <3
Additional ReadingAdditional Reading
Reactive Manifesto
Reactive Spring
Josh Long - Spring Reactive
Intro to Rx
ReactiveX
Reactive Streams Spec
15

More Related Content

Similar to Being Reactive with Spring

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
 
App Mod 03: Monoliths to microservices with java ee and spring boot
App Mod 03: Monoliths to microservices with java ee and spring bootApp Mod 03: Monoliths to microservices with java ee and spring boot
App Mod 03: Monoliths to microservices with java ee and spring boot
Judy Breedlove
 
Real-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsReal-World Pulsar Architectural Patterns
Real-World Pulsar Architectural Patterns
Devin Bost
 
Spring Book – Chapter 1 – Introduction
Spring Book – Chapter 1 – IntroductionSpring Book – Chapter 1 – Introduction
Spring Book – Chapter 1 – Introduction
Tomcy John
 
Why meteor
Why meteorWhy meteor
Why meteor
Jonathan Perl
 
RxJava pour Android : présentation lors du GDG Android Montréal
RxJava pour Android : présentation lors du GDG Android MontréalRxJava pour Android : présentation lors du GDG Android Montréal
RxJava pour Android : présentation lors du GDG Android Montréal
Sidereo
 
Enabling Lean at Enterprise Scale: Lean Engineering in Action
Enabling Lean at Enterprise Scale: Lean Engineering in ActionEnabling Lean at Enterprise Scale: Lean Engineering in Action
Enabling Lean at Enterprise Scale: Lean Engineering in Action
Hyperdrive Agile Leadership (powered by Bratton & Company)
 
Reactive Java Robotics & IoT with Spring Reactor
Reactive Java Robotics & IoT with Spring ReactorReactive Java Robotics & IoT with Spring Reactor
Reactive Java Robotics & IoT with Spring Reactor
Trayan Iliev
 
Client-side Development 2016
Client-side Development 2016Client-side Development 2016
Client-side Development 2016
Huge
 
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
Bill Scott
 
Virtualising Tier 1 Apps
Virtualising Tier 1 AppsVirtualising Tier 1 Apps
Virtualising Tier 1 Apps
Iwan Rahabok
 
Building and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowBuilding and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache Airflow
Kaxil Naik
 
Project Reactor Now and Tomorrow
Project Reactor Now and TomorrowProject Reactor Now and Tomorrow
Project Reactor Now and Tomorrow
VMware Tanzu
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
Dr. Felix Raab
 
Lean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partnerLean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partner
Bill Scott
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arp
Gary Pedretti
 
Framework Engineering 2.1
Framework Engineering 2.1Framework Engineering 2.1
Framework Engineering 2.1
YoungSu Son
 
How to Migrate Applications Off a Mainframe
How to Migrate Applications Off a MainframeHow to Migrate Applications Off a Mainframe
How to Migrate Applications Off a Mainframe
VMware Tanzu
 
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Cωνσtantίnoς Giannoulis
 
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech TalkCloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Red Hat Developers
 

Similar to Being Reactive with Spring (20)

Reactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJavaReactive Programming on Android - RxAndroid - RxJava
Reactive Programming on Android - RxAndroid - RxJava
 
App Mod 03: Monoliths to microservices with java ee and spring boot
App Mod 03: Monoliths to microservices with java ee and spring bootApp Mod 03: Monoliths to microservices with java ee and spring boot
App Mod 03: Monoliths to microservices with java ee and spring boot
 
Real-World Pulsar Architectural Patterns
Real-World Pulsar Architectural PatternsReal-World Pulsar Architectural Patterns
Real-World Pulsar Architectural Patterns
 
Spring Book – Chapter 1 – Introduction
Spring Book – Chapter 1 – IntroductionSpring Book – Chapter 1 – Introduction
Spring Book – Chapter 1 – Introduction
 
Why meteor
Why meteorWhy meteor
Why meteor
 
RxJava pour Android : présentation lors du GDG Android Montréal
RxJava pour Android : présentation lors du GDG Android MontréalRxJava pour Android : présentation lors du GDG Android Montréal
RxJava pour Android : présentation lors du GDG Android Montréal
 
Enabling Lean at Enterprise Scale: Lean Engineering in Action
Enabling Lean at Enterprise Scale: Lean Engineering in ActionEnabling Lean at Enterprise Scale: Lean Engineering in Action
Enabling Lean at Enterprise Scale: Lean Engineering in Action
 
Reactive Java Robotics & IoT with Spring Reactor
Reactive Java Robotics & IoT with Spring ReactorReactive Java Robotics & IoT with Spring Reactor
Reactive Java Robotics & IoT with Spring Reactor
 
Client-side Development 2016
Client-side Development 2016Client-side Development 2016
Client-side Development 2016
 
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
6 Principles for Enabling Build/Measure/Learn: Lean Engineering in Action
 
Virtualising Tier 1 Apps
Virtualising Tier 1 AppsVirtualising Tier 1 Apps
Virtualising Tier 1 Apps
 
Building and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache AirflowBuilding and deploying LLM applications with Apache Airflow
Building and deploying LLM applications with Apache Airflow
 
Project Reactor Now and Tomorrow
Project Reactor Now and TomorrowProject Reactor Now and Tomorrow
Project Reactor Now and Tomorrow
 
Building a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one weekBuilding a full-stack app with Golang and Google Cloud Platform in one week
Building a full-stack app with Golang and Google Cloud Platform in one week
 
Lean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partnerLean Engineering: How to make Engineering a full Lean UX partner
Lean Engineering: How to make Engineering a full Lean UX partner
 
Onion Architecture with S#arp
Onion Architecture with S#arpOnion Architecture with S#arp
Onion Architecture with S#arp
 
Framework Engineering 2.1
Framework Engineering 2.1Framework Engineering 2.1
Framework Engineering 2.1
 
How to Migrate Applications Off a Mainframe
How to Migrate Applications Off a MainframeHow to Migrate Applications Off a Mainframe
How to Migrate Applications Off a Mainframe
 
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
Lessons Learned in Software Development: QA Infrastructure – Maintaining Rob...
 
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech TalkCloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
Cloud-Native Modernization or Death? A false dichotomy. | DevNation Tech Talk
 

Recently uploaded

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
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
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
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
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
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
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
 
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
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
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
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
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
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
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
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 

Recently uploaded (20)

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...
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
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 Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
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
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
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...
 
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
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
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
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
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...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 

Being Reactive with Spring

  • 1. Being Reactive with SpringBeing Reactive with Spring Kris Galea 1
  • 2. What's all this about?!What's all this about?! Being Reactive .. huh ?Being Reactive .. huh ? Nothing to do with Facebook's React Framework! Face the challenges of popularity Building robust applications for when it matters most ..with.. Spring?..with.. Spring? Java framework better than sliced bread (or ftira) Java!Java!
  • 3. What's all this Reactive-ness?!What's all this Reactive-ness?! This fantastic thing called "The Internet" Di culties in dealing with growing number of requests Get to grips with the idea of Reactive Programming 2 . 2
  • 4. Let's get some things straight!Let's get some things straight! Publisher-Subscriber Messaging Pattern Data Streams Get technical ...Get technical ... Java 8/9 Spring 5 Super exciting demo of Reactive Spring!Super exciting demo of Reactive Spring! 2 . 3
  • 5. But rst! A little about us ...But rst! A little about us ... Hi!Hi!
  • 6. and something about yours truly...and something about yours truly... Email: kristiang@ccbill.comEmail: kristiang@ccbill.com Github: https://github.com/krisgaleaGithub: https://github.com/krisgalea Slides:Slides: https://www.slideshare.net/KrisGalea/being-https://www.slideshare.net/KrisGalea/being- reactive-with-springreactive-with-spring 3 . 2
  • 7. Where all this began ...Where all this began ... Welcome to ...Welcome to ... The InternetThe Internet
  • 8. The internet is growingThe internet is growing 4 . 2
  • 9. Challenges of a Growing InternetChallenges of a Growing Internet Number of requests increases E-Commerce: businesses are now online Multiple ways of scaling: hardware vs. software Maintaining consistency come rain or shine 4 . 3
  • 10. Let's talk ReactiveLet's talk Reactive
  • 11. A Set of Principles/GuidelinesA Set of Principles/Guidelines A software oriented approach to robustness Not, strictly speaking, anything technical A set of guidelines which motivate design decisions made from the ground up A way to ensure that applications are built to withstand the di culties of modern necessities 5 . 2
  • 12. One Manifesto to Rule them all ...One Manifesto to Rule them all ... 5 . 3
  • 13. Technically speaking ...Technically speaking ... Use of functional approach to allow an application to react to changes in the environment as they happen vs Use of data streams to transmit changes from the source to the destination Use of the publisher-subscriber pattern a:= b + c a:= changing(b) + changing(c) 5 . 4
  • 14. Let's try this out ...Let's try this out ... 5 . 5
  • 15. A word about Backpressure...A word about Backpressure... Hot vs Cold message emitting Push vs Pull vs Hybrid-push-pull 5 . 6
  • 16. Let's Get Down to Basics ...Let's Get Down to Basics ... 6
  • 18. Messaging Pattern (architectural) 3 main actors: Publisher , Subscriber and Subscription 7 . 2
  • 19. Subscribers subscribe to changes in the Publisher using a Subscription Publisher noti es of changes in its state Publisher is not aware of the Subscriber's details 7 . 3
  • 20. loose coupling Allows for easy scalability using a common Message Bus Message Broker can be as sophisticated or as dumb as needed 7 . 4
  • 22. A sequence of elements from a collection or data source Pipes data from a source to a destination Enforces statelessness (and immutability) Easily parallellised Allows chaining of Functional Operators In Java implemented plainly as Streams 8 . 2
  • 23. Functional Operator ChainingFunctional Operator Chaining 8 . 3
  • 24. Functional Operator ChainingFunctional Operator Chaining 8 . 4
  • 25. Functional Operator ChainingFunctional Operator Chaining 8 . 5
  • 26. 8 . 6
  • 27. Let's Get Technical!Let's Get Technical! 9
  • 28. Reactive and Java 8 & 9Reactive and Java 8 & 9
  • 30. Implementation of Streams as of Java 8Implementation of Streams as of Java 8 Use ofUse of Stream/Functional OperatorsStream/Functional Operators Intermediate Operators Terminal Operators List <Integer> numbers = List.of(2,3,4,5,6); numbers.stream().filter(number -> number > 4).forEach(num -> System.out.println(num)); 10 . 3
  • 35. A Java framework for enterprise quality applications Dependency Injection and Inversion of Control Convention over con guration Annotation based Provides a large tool set to quickly get up and running e.g. Spring Boot 11 . 2
  • 36. Spring Reactive Data TypesSpring Reactive Data Types 11 . 3
  • 38. Let's try all this out !Let's try all this out ! Let's pretend to process feeds from socialLet's pretend to process feeds from social networks ...networks ...
  • 39. That's it!That's it! In this talk we've learned:In this talk we've learned: What Reactive Programming is and why it's useful The core concepts used to implement Reactive Which industry tools are used to develop Reactive applications 13
  • 41. thx! <3thx! <3 Additional ReadingAdditional Reading Reactive Manifesto Reactive Spring Josh Long - Spring Reactive Intro to Rx ReactiveX Reactive Streams Spec 15