Spring Framework 5.0 and Spring Boot 2.0 contain groundbreaking technologies known as reactive streams, which enable applications to utilize computing resources efficiently.
In this session, James Weaver will discuss the reactive capabilities of Spring, including WebFlux, WebClient, Project Reactor, and functional reactive programming. The session will be centered around a fun demonstration application that illustrates reactive operations in the context of manipulating playing cards.
Presenter : James Weaver, Pivotal
Being Functional on Reactive Streams with Spring ReactorMax Huang
The journey begins with using Java 8 introduced Optional/Stream/CompletableFuture more functional, after which Reactive Streams is introduced with a homemade implementation that is ultimately made functional to increase usability. Finally Spring Reactor (Project Reactor) is presented and used for building a device simulator periodically reporting data to device controller.
An introduction to reactive programming concepts and basics. I aim here to show what's reactive programming, why it's used and show some frameworks and benchmarks that support it.
Being Functional on Reactive Streams with Spring ReactorMax Huang
The journey begins with using Java 8 introduced Optional/Stream/CompletableFuture more functional, after which Reactive Streams is introduced with a homemade implementation that is ultimately made functional to increase usability. Finally Spring Reactor (Project Reactor) is presented and used for building a device simulator periodically reporting data to device controller.
An introduction to reactive programming concepts and basics. I aim here to show what's reactive programming, why it's used and show some frameworks and benchmarks that support it.
Reactive Programming In Java Using: Project ReactorKnoldus Inc.
The session provides details about reactive programming with reactive streams. The purpose of Reactive Streams is to provide a standard for asynchronous stream processing with non-blocking backpressure.”
This concept is explained using Project reactor.
This is your one stop shop introduction to get oriented to the world of reactive programming. There are lots of such intros out there even manifestos. We hope this is the one where you don't get lost and it makes sense. Get a definition of what "reactive" means and why it matters. Learn about Reactive Streams and Reactive Extensions and the emerging ecosystem around them. Get a sense for what going reactive means for the programming model. See lots of hands-on demos introducing the basic concepts in composition libraries using RxJava and Reactor.
Spring Weblfux. I have given this talk several times but in San Antonio JUG is where I think I have explained better this topic. An introduction to the reactive concepts on how Spring and Project Reactor implement them for Reactive web with Spring Webflux.
SpringOne Platform 2017
Stéphane Maldini, Pivotal; Simon Basle, Pivotal
"In 2016, Project Reactor was the foundation before Spring Reactive story, in particular with Reactor Core 3.0 fueling our initial Spring Framework 5 development.
2017 and 2018 are the years Project Reactor empowers the final Spring Framework 5 GA and an entire ecosystem, thus including further refinement, feedbacks and incredible new features. In fact, the new Reactor Core 3.1 and Reactor Netty 0.7 are the very major versions used by the like of Spring Boot 2.0, and they have dramatically consolidated around a simple but yet coherent API.
Discover those changes and the new Reactor capabilities including support for Reactive AOP, Observability, Tracing, Error Strategies for long-running streams, new Netty driver, improved test support, community driven initiatives and much more
Finally, the first java framework & ecosystem gets the reactive library it needs !"
Join Red Hat and Vodafone for an exciting presentation on the benefits of Quarkus over competing technologies. Hear from Vodafone's experts about their successful transition to Quarkus from Spring and discover how Quarkus can help your organization cut cloud costs, improve cluster stability, and achieve better performance.
A live demo will showcase the power of Quarkus through examples of HTTP requests, security approaches, exception handling, logging, and more.
In summary, this informative session will provide you valuable insights into the benefits of using Quarkus while also getting real world performance and development time numbers from Vodafone, information which can and should influence your next decisions on what Server Side Java technology to choose!
React (or React Js) is a declarative, component-based JS library to build SPA(single page applications) which was created by Jordan Walke, a software engineer at Facebook. It is flexible and can be used in a variety of projects.
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018Scrum Breakfast Vietnam
Are you struggling to create a non-blocking REST application or a reactive micro-services? Spring WebFlux, a new module introduced by Spring 5 may help.
This new module introduces:
- Fully non-blocking
- Supports Reactive Streams back pressure
- Runs on such servers as Netty, Undertow, and Servlet 3.1+ containers
- Its support for the reactive programming model
In our next Scrum Breakfast, we will discuss Spring WebFlux, its benefit and how we implement it.
Our workshop will be including the following:
- What is reactive programming
- Introduction to Spring Webflux
- Tea break
- The details in Spring Webflux
- Reactive stack demonstration
- Q&A
20160609 nike techtalks reactive applications tools of the tradeshinolajla
An update to my talk about concurrency abstractions, including event loops (node.js and Vert.x), CSP (Go, Clojure), Futures, CPS/Dataflow (RxJava) and Actors (Erlang, Akka)
Reactive Programming In Java Using: Project ReactorKnoldus Inc.
The session provides details about reactive programming with reactive streams. The purpose of Reactive Streams is to provide a standard for asynchronous stream processing with non-blocking backpressure.”
This concept is explained using Project reactor.
This is your one stop shop introduction to get oriented to the world of reactive programming. There are lots of such intros out there even manifestos. We hope this is the one where you don't get lost and it makes sense. Get a definition of what "reactive" means and why it matters. Learn about Reactive Streams and Reactive Extensions and the emerging ecosystem around them. Get a sense for what going reactive means for the programming model. See lots of hands-on demos introducing the basic concepts in composition libraries using RxJava and Reactor.
Spring Weblfux. I have given this talk several times but in San Antonio JUG is where I think I have explained better this topic. An introduction to the reactive concepts on how Spring and Project Reactor implement them for Reactive web with Spring Webflux.
SpringOne Platform 2017
Stéphane Maldini, Pivotal; Simon Basle, Pivotal
"In 2016, Project Reactor was the foundation before Spring Reactive story, in particular with Reactor Core 3.0 fueling our initial Spring Framework 5 development.
2017 and 2018 are the years Project Reactor empowers the final Spring Framework 5 GA and an entire ecosystem, thus including further refinement, feedbacks and incredible new features. In fact, the new Reactor Core 3.1 and Reactor Netty 0.7 are the very major versions used by the like of Spring Boot 2.0, and they have dramatically consolidated around a simple but yet coherent API.
Discover those changes and the new Reactor capabilities including support for Reactive AOP, Observability, Tracing, Error Strategies for long-running streams, new Netty driver, improved test support, community driven initiatives and much more
Finally, the first java framework & ecosystem gets the reactive library it needs !"
Join Red Hat and Vodafone for an exciting presentation on the benefits of Quarkus over competing technologies. Hear from Vodafone's experts about their successful transition to Quarkus from Spring and discover how Quarkus can help your organization cut cloud costs, improve cluster stability, and achieve better performance.
A live demo will showcase the power of Quarkus through examples of HTTP requests, security approaches, exception handling, logging, and more.
In summary, this informative session will provide you valuable insights into the benefits of using Quarkus while also getting real world performance and development time numbers from Vodafone, information which can and should influence your next decisions on what Server Side Java technology to choose!
React (or React Js) is a declarative, component-based JS library to build SPA(single page applications) which was created by Jordan Walke, a software engineer at Facebook. It is flexible and can be used in a variety of projects.
Reactive programming by spring webflux - DN Scrum Breakfast - Nov 2018Scrum Breakfast Vietnam
Are you struggling to create a non-blocking REST application or a reactive micro-services? Spring WebFlux, a new module introduced by Spring 5 may help.
This new module introduces:
- Fully non-blocking
- Supports Reactive Streams back pressure
- Runs on such servers as Netty, Undertow, and Servlet 3.1+ containers
- Its support for the reactive programming model
In our next Scrum Breakfast, we will discuss Spring WebFlux, its benefit and how we implement it.
Our workshop will be including the following:
- What is reactive programming
- Introduction to Spring Webflux
- Tea break
- The details in Spring Webflux
- Reactive stack demonstration
- Q&A
20160609 nike techtalks reactive applications tools of the tradeshinolajla
An update to my talk about concurrency abstractions, including event loops (node.js and Vert.x), CSP (Go, Clojure), Futures, CPS/Dataflow (RxJava) and Actors (Erlang, Akka)
Mary Grygleski and myself, gave a very successful workshop to 51 attendees in NYC on April 15th - here is the updated presentation
https://www.linkedin.com/in/mary-grygleski/
https://www.linkedin.com/in/grant-steinfeld/
The word "Reactive" can be confusing. As the founder of the Reactive Amsterdam meetup, I can tell there are two main topics here: Functional Reactive Programming (here with reference to Android) and "Reactive" in the sense of the Reactive Manifesto.
It is a time of developers complain about performance. Rebel developers, striking from a hidden base, have won their first victory against the evil blocking applications.
In this session, attendees will learn about an evolution to a reactive system; we will show how to create a Reactive Application covering tips and tricks of an experience of an evolution the Application and how we evolve to a modern reactive modules; Through the session you are going to get tips, tricks, pros, cons and the reasons for being involved on move forward to non-bloking application and present sample code and explain the security concerns on this evolution. We will be using snippets code based on JAVA, JWT, JWS, Auth0, Spring Boot, Reactor and Webflux deployed on Oracle Cloud.
The world is moving from a model where data sits at rest, waiting for people to make requests of it, to where data is constantly moving, streams of data flow to and from devices with or without human interaction. Decisions need to be made based on these streams of data in real time, models need to be updated, intelligence needs to be learned. And our old-fashioned approach of CRUD REST APIs serving CRUD database calls just doesn't cut it, it's trying to fit a square peg into a round hole. It's time we moved to a stream-centric view of the world.
This talk will look at how Reactive Streams is shaping the future of Jakarta EE. I'll talk about some Reactive Streams based specifications that we're currently working on in the JDK, MicroProfile and Jakarta EE communities, as well as some potential big ideas to transform the way developers write their applications, such as event sourcing and CQRS, that Jakarta EE will likely adopt in future. We'll take a look at a hypothetical future Jakarta EE, at what a typical service will look like when streaming is embraced, and get a glimpse of how Jakarta EE can lead the world in standards for Reactive systems.
The world is moving from a model where data sits at rest, waiting for people to make requests of it, to where data is constantly moving and streams of data flow to and from devices with or without human interaction. Decisions need to be made based on these streams of data in real-time, models need to be updated, and intelligence needs to be gathered. In this context, our old-fashioned approach of CRUD REST APIs serving CRUD database calls just doesn't cut it. It's time we moved to a stream-centric view of the world.
Spring 5 Webflux - Advances in Java 2018Trayan Iliev
Brief introduction to distributed stream processing, reactive programming, and novelties in Spring 5, Spring Boot 2, and reactive Spring Data + programming examples in GitHub. More information will be provided during upcoming Spring 5 course: http://iproduct.org/en/courses/spring-mvc-rest/
Microservices with Spring 5 Webflux - jProfessionalsTrayan Iliev
Spring 5 introduces new functional and reactive programming model for building web applications and (micro-)services.
The session @jProfessionals dev conference demonstrates how to build REST microservices using Spring WebFlux and Spring Boot using code examples on GitHub. It includes:
- Introduction to reactive programming, Reactive Streams specification, and project Reactor (as WebFlux infrastructure);
- Comparison between annotation-based and functional reactive ;programming approaches for building REST services with WebFlux;
- Router, handler and filter functions;
- Using reactive repositories and reactive database access with Spring Data;
- Building end-to-end non-blocking reactive web services using Netty-based web runtime;
- Reactive WebClients and integration testing;
- Realtime event streaming to WebClients using JSON Streams, and to JS client using SSE.
In this presentation, Akka Team Lead and author Roland Kuhn presents the freshly released final specification for Reactive Streams on the JVM. This work was done in collaboration with engineers representing Netflix, Red Hat, Pivotal, Oracle, Typesafe and others to define a standard for passing streams of data between threads in an asynchronous and non-blocking fashion. This is a common need in Reactive systems, where handling streams of "live" data whose volume is not predetermined.
The most prominent issue facing the industry today is that resource consumption needs to be controlled such that a fast data source does not overwhelm the stream destination. Asynchrony is needed in order to enable the parallel use of computing resources, on collaborating network hosts or multiple CPU cores within a single machine.
Here we'll review the mechanisms employed by Reactive Streams, discuss the applicability of this technology to a variety of problems encountered in day to day work on the JVM, and give an overview of the tooling ecosystem that is emerging around this young standard.
DevFest Belgium 2016.
Overview on some of the reactive frameworks for Android and Java (RxJava 1.x/2.x, Reactor, Akka, Agera). Examples, comparison and interoperability.
Reactive Programming, Traits and Principles. What is Reactive, where does it come from, and what is it good for? How does it differ from event driven programming? It only functional?
Journey into Reactive Streams and Akka StreamsKevin Webber
Are streams just collections? What's the difference between Java 8 streams and Reactive Streams? How do I implement Reactive Streams with Akka? Pub/sub, dynamic push/pull, non-blocking, non-dropping; these are some of the other concepts covered. We'll also discuss how to leverage streams in a real-world application.
Similar to Reactive Card Magic: Understanding Spring WebFlux and Project Reactor (20)
The Tanzu Developer Connect is a hands-on workshop that dives deep into TAP. Attendees receive a hands on experience. This is a great program to leverage accounts with current TAP opportunities.
The Tanzu Developer Connect is a hands-on workshop that dives deep into TAP. Attendees receive a hands on experience. This is a great program to leverage accounts with current TAP opportunities.
State of ICS and IoT Cyber Threat Landscape Report 2024 previewPrayukth K V
The IoT and OT threat landscape report has been prepared by the Threat Research Team at Sectrio using data from Sectrio, cyber threat intelligence farming facilities spread across over 85 cities around the world. In addition, Sectrio also runs AI-based advanced threat and payload engagement facilities that serve as sinks to attract and engage sophisticated threat actors, and newer malware including new variants and latent threats that are at an earlier stage of development.
The latest edition of the OT/ICS and IoT security Threat Landscape Report 2024 also covers:
State of global ICS asset and network exposure
Sectoral targets and attacks as well as the cost of ransom
Global APT activity, AI usage, actor and tactic profiles, and implications
Rise in volumes of AI-powered cyberattacks
Major cyber events in 2024
Malware and malicious payload trends
Cyberattack types and targets
Vulnerability exploit attempts on CVEs
Attacks on counties – USA
Expansion of bot farms – how, where, and why
In-depth analysis of the cyber threat landscape across North America, South America, Europe, APAC, and the Middle East
Why are attacks on smart factories rising?
Cyber risk predictions
Axis of attacks – Europe
Systemic attacks in the Middle East
Download the full report from here:
https://sectrio.com/resources/ot-threat-landscape-reports/sectrio-releases-ot-ics-and-iot-security-threat-landscape-report-2024/
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
5. Reactive Card Magic
What will we cover?
• Spring WebFlux (what, why, etc.)
• Reactive systems and Reactive programming
• Reactive programming in Java
• Project Reactor
• WebClient reactive client
• Code and concepts walkthrough of Reactive Card Magic application
@JavaFXpert
6. Spring WebFlux
What is it?
@JavaFXpert
A non-blocking, reactive web framework that
supports Reactive Streams back pressure, and
runs on servers such as Netty, Undertow, and
Servlet 3.1+ containers.
See: Web on Reactive Stack by the Spring team
8. Spring WebFlux
Why was it created?
• Because of mobile devices, IoT, and our continuing trend to live online,
some apps today have millions of clients.
• Many apps have Black Friday* style usage patterns, where demand can
spike exponentially.
• Factors such as these drive the need for a non-blocking web stack that:
• handles concurrency with a small number of threads and
• scales with less hardware resources.
@JavaFXpert
* Referring to the busiest shopping day of the year in the US, not the last Friday before Christmas in the UK :-)
12. Spring WebFlux
Other reasons for creating it
• Continuation style APIs enabled by Java 8 lambda
expressions allow declarative composition of
asynchronous logic
• Lambdas also enabled Spring WebFlux to offer
functional web endpoints alongside with annotated
controllers
@JavaFXpert
13. Spring WebFlux
What does reactive mean?
• Reactive refers to programming models (and systems) that
are built around asynchronously reacting to external changes
(such as messages and events)
• An important mechanism in reactive is non-blocking back
pressure (flow control) *
@JavaFXpert
See: Web on Reactive Stack by the Spring team
* In synchronous, imperative code, blocking calls serve as a
natural form of back pressure that forces the caller to wait.
15. Reactive systems vs. Reactive programming
• Reactive systems represent an architectural style
that allows multiple individual applications to coalesce
as a single unit, reacting to its surroundings, while
remaining aware of each other
• Reactive programming is a subset of asynchronous
programming and a paradigm where the availability of
new information drives the logic forward rather than
having control flow driven by a thread-of-execution
@JavaFXpert
From Reactive programming vs. Reactive systems by Jonas Bonér and Viktor Klang
16. Some Reactive programming use cases
• External Service Calls
• Highly Concurrent Message Consumers
• Spreadsheets
• Abstraction Over (A)synchronous Processing
@JavaFXpert
From: Notes on Reactive Programming Part I: The Reactive Landscape by Dave Syer
17. Reactive Programming in Java
A brief and incomplete history
• Reactive programming ideas have been around for a while, appearing
in programming languages (e.g. Erlang) and libraries (e.g. Reactive
Extensions for .NET)
• The open source RxJava (Reactive Extensions for Java) project
helped move reactive programming forward on the Java platform.
• The Reactive Streams initiative provided a standard and specification
for compatibility among reactive implementations in Java. This
initiative is a collaboration between engineers from Kaazing,
Lightbend, Netflix, Pivotal, Red Hat, Twitter and others.
@JavaFXpert
18. Reactive Programming in Java
• Reactive Streams
• RxJava
• Reactor
• Spring Framework 5
• Ratpack
• Akka
• Vert.x
@JavaFXpert
From: Notes on Reactive Programming Part I: The Reactive Landscape by Dave Syer
19. Reactive Streams:
@JavaFXpert
github.com/reactive-streams/reactive-streams-jvm
Is a standard and specification for stream-oriented libraries
that:
• process a potentially unbounded number of elements
• sequentially,
• with the ability to asynchronously pass elements between
components,
• with mandatory non-blocking backpressure.
reactive-streams.org
20. public interface Subscriber<T> {
public void onSubscribe(Subscription s);
public void onNext(T t);
public void onError(Throwable t);
public void onComplete();
}
public interface Subscriber<T> {
public void onSubscribe(Subscription s);
public void onNext(T t);
public void onError(Throwable t);
public void onComplete();
}
Reactive Streams API for Java
@JavaFXpert
enables interoperability between different Reactive implementations
public interface Publisher<T> {
public void subscribe(Subscriber<? super T> s);
}
public interface Subscription {
public void request(long n);
public void cancel();
}
public interface Processor<T, R>
extends Subscriber<T>, Publisher<R> {
}
Adopted by Java 9 in the Flow class
21. Reactive Streams with Spring
@JavaFXpert
From: Servlet and Reactive Stacks in Spring Framework 5 by Rossen Stoyanchev
Streaming to database with non-blocking back pressure
JSON stream
22. Reactive Streams with Spring
@JavaFXpert
From: Servlet and Reactive Stacks in Spring Framework 5 by Rossen Stoyanchev
Streaming from database with non-blocking back pressure
JSON stream
24. Project Reactor
Avoiding callback hell and other asynchronous pitfalls
Reactive libraries such as Reactor aim to address drawbacks of "classic"
asynchronous approaches on the JVM while also focusing on additional aspects:
• Composability and readability
• Data as a flow manipulated with a rich vocabulary of operators
• Nothing happens until you subscribe
• Backpressure or the ability for the consumer to signal the producer that the
rate of emission is too high
• High level but high value abstraction that is concurrency-agnostic
@JavaFXpertSee: From Imperative to Reactive Programming in Project Reactor Guide
41. @RestController
@RequestMapping("/cards/deck")
public class CardDeckController {
private final CardDeckService cardDeckService;
@Autowired
public CardDeckController(
CardDeckService cardDeckService) {
this.cardDeckService = cardDeckService;
}
@GetMapping("/new")
public Mono<CardHand> getCardDeck(@RequestParam(defaultValue = "52")
int numcards) {
return cardDeckService.generate()
.take(numcards)
.collectList()
.map(l -> new CardHand(l, "New Deck"));
}
}
@JavaFXpert
Annotated controller example
42. @RestController
@RequestMapping("/cards/deck")
public class CardDeckController {
private final CardDeckService cardDeckService;
@Autowired
public CardDeckController(
CardDeckService cardDeckService) {
this.cardDeckService = cardDeckService;
}
@GetMapping("/new")
public Mono<CardHand> getCardDeck(@RequestParam(defaultValue = "52")
int numcards) {
return cardDeckService.generate()
.take(numcards)
.collectList()
.map(l -> new CardHand(l, "New Deck"));
}
}
Annotated controller example
@JavaFXpert
43. @Bean
RouterFunction<ServerResponse> newDeckRoutes(CardDeckService cds) {
int defaultNumCards = 52;
return RouterFunctions.route(
RequestPredicates.GET("/newdeck"),
request -> cds.generate()
.take(request.queryParam("numcards")
.map(Integer::parseInt).orElse(defaultNumCards))
.collectList()
.map(l -> new CardHand(l,"New Deck"))
.flatMap(ServerResponse.ok()::syncBody));
}
Functional endpoint example
@JavaFXpert
44. Spring WebFlux
Using WebClient
WebClient is a reactive, non-blocking client for HTTP requests with a
functional-style API client and Reactive Streams support. By comparison to
the RestTemplate, WebClient is:
• non-blocking, reactive, and supports higher concurrency with less
hardware resources.
• provides a functional API that takes advantage of Java 8 lambdas.
• supports both synchronous and asynchronous scenarios.
• supports streaming up or down from a server.
@JavaFXpertFrom Web on Reactive Stack - WebClient
46. WebClient pokerWebClient = WebClient.create("http://127.0.0.1:8080");
Mono<String> pokerHandMono = pokerWebClient.post()
.uri("/poker/idhand")
.body(cardFlux, Card.class)
.retrieve()
.bodyToMono(String.class);
WebClient example
@JavaFXpert
Calling an endpoint to identify a Poker hand
64. Reactive Card Magic
If we have time, walk through more code including:
• Additional shuffling operations such as Riffle Shuffle
• Populating the Card Deck repository
• The /shuffledealrepeat endpoint
• The /handfrequencies endpoint
• Testing with StepVerifier
@JavaFXpert
66. Reactive Card Magic
What have we covered? Any more questions?
• Spring WebFlux (what, why, etc.)
• Reactive systems and Reactive programming
• Reactive programming in Java
• Project Reactor
• WebClient reactive client
• Code and concepts walkthrough of Reactive Card Magic application
@JavaFXpert
67. Web resources
• Spring Framework 5 Web on Reactive Stack:
docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#spring-webflux
• Project Reactor:
projectreactor.io
• The Reactive Manifesto:
reactivemanifesto.org
• Reactive Card Magic app:
github.com/JavaFXpert/card-deck-demo
• James Weaver’s blogs:
• JavaFXpert.com
• CulturedEar.com
@JavaFXpert