
Introduction to the course Reactive Programming with Spring Framework 5
Maximize learning in this Spring reactive programming course by time-blocking study, forking GitHub repos, following hands-on lessons with branch comparisons, joining the Slack community, and using Maven with any IDE.
Set up your environment with Java 11 JDK and Maven 3.6+ on any major OS, and use an IDE such as IntelliJ, Eclipse, or NetBeans.
Learn about the recommended GitHub workflow for the course.
See how you can get access to the Slack Channel exclusive to this course.
Compare free and paid IDEs, emphasizing IntelliJ community edition versus IntelliJ Ultimate, and show how enterprise Java developers benefit from reliable JetBrains support and time savings.
See how to create a Spring Boot project using the dependencies required to support Reactive Programming.
Explore flux operations in reactive programming with Spring Framework 5, comparing flux and mono, and using blockFirst, subscribe, and collectList to convert a flux to a list.
Filter a flux of person objects in Spring Framework 5, compare next versus single for matches, and handle not found or multiple results with onErrorReturn and doOnError.
Use StepVerifier to inspect monos and fluxes, validate reactive stream behavior with expectNextCount, verifyComplete, and not found scenarios in Project Reactor tests.
Netflux is an example originally created by Josh Long of Pivotal. It's a great example to work through to learn concepts related to Reactive Programming with Spring Framework 5.
Create a new Spring Boot project
Create the initial movie service layer that uses the MongoDB repository, and exposes getMovieById (mono) and getAllMovies (flux) via a MovieService interface.
Implement a Spring MVC rest controller for movies, mapping /movies, with get all movies returning a flux and get by id returning a mono, using path variable binding.
build a flux that emits a new movie event every second for a specific movie id and expose it as a text/event-stream streaming endpoint.
Spring Web Client is the new non-blocking client used to consume RESTful APIs.
Compare imperative, declarative, and functional programming, emphasizing immutable data and thread safety. Discover Java 8 functional interfaces, including Function, Predicate, Supplier, and Consumer, and streaming pipelines in reactive Spring code.
Set up a WebClient-based beer client with a WebClientConfig and a base URL. Write lean tests that instantiate BeerClientImpl directly to mimic Spring wiring without the full context.
Implement optional query parameters for beer listings using a URI builder, covering page size, page number, beer name, style, and inventory, with tests to verify results.
Configure Netty-based WebClient logging by enabling wiretap on the reactor http client, setting log levels to debug or trace, and viewing detailed request and response bodies.
Use uriBuilder to bind url parameters (uuid, upc) in the V1 path, replacing string concatenation, and update WebClientProperties and BeerClient build method to pass parameters, and ensure tests pass.
Implement a post operation to create a new beer by sending a BeerDto with beerName, beerStyle, upc, and price, and validate a 201 created response.
Explore reactive threading and reactive API, refactor the get inventory by id test from blocking to a functional mono pipeline using map and flatMap, and manage race conditions with countdownLatch.
Introduction to Spring WebFlux - the new Reactive replacement for Spring MVC.
Update maven dependencies to spring-boot-starter-webflux, switch from spring mvc to webflux, and enable the Netty server, while removing mock MVC tests and preparing for reactive controller methods.
Learn about using the WebTestClient, a replacement for Spring MockMVC.
Introduction to using R2DBC with Spring Boot and Spring Data.
Discover Spring Data R2DBC as a reactive alternative to JPA and Hibernate, with non blocking drivers, learn to convert Hibernate JPA to R2DBC, updating datasource and dependencies for reactive CRUD.
Migrate an app to the R2DBC reactive framework for MySQL, update Maven dependencies, remove JPA and Hibernate, and convert repositories to a reactive CRUD repository with R2DBC and H2.
Refactor the list beers API to use reactive types via R2DBC fluent API, returning a Mono of beer paged list by mapping beer to beerDto and preserving the API.
Refactor the save new beer to return a mono of beerDto, enabling reactive flow across service and controller, and adjust tests for http 201 and id-based location.
Demonstrates refactoring the update beer operation to return 404 not found when the id is missing, using WebClient tests, AtomicBoolean logic, and reactive patterns in Spring Framework 5.
Explore functional endpoints and the functional programming paradigm in Spring Web Flux to rapidly build RESTful APIs, shifting from Spring MVC style controllers.
Implements server-side validation for BeerDto by wiring a Spring validator into the WebFlux flow, using doOnNext to apply validation and throwing ServerWebInputException on errors to return a bad request.
Explore handling update beer by id responses, implementing 404 not found and 204 statuses in a Spring reactive flow, with validation errors 400 and robust logging for path variables.
Implement a reactive delete by id in a Spring app, using findById and deleteById, with NotFoundException and 404 handling, and tests verify success and not-found.
Explore reactive streams by modeling continuous data flows, such as stock quotes and location information. Compare flux with earlier mono approaches and learn how streaming data enhances reactive programming.
Create a new streaming-stock-quote service project in IntelliJ using Spring Initializr, add WebFlux and Lombok, configure a reactive streaming service with no persistence, and commit to GitHub.
Develop a WebFlux quote handler with two methods: fetchQuotes returning JSON and streamQuotes delivering ndjson, using a quote generator service with a default size of 10.
Build a reactive quote router in Spring WebFlux, supporting json fetch and ndjson streaming. Implement router config and tests, configure a web test client, and validate with curl streaming demonstrations.
Explore reactive programming with Spring Framework 5 by streaming data from a stock quotes service and persisting it to MongoDB using Spring Data MongoDB's reactive capabilities.
Explore reactive MongoDB in a Spring context, covering NoSQL documents, JSON-like structures, and optional schemas, and learn to persist stock quotes to a local MongoDB using Spring Data reactive repositories.
Implement a quote runner that streams stock quotes, throttles to a cap, and persists them to Mongo via a reactive Spring Boot pipeline using a command line runner.
Explore reactive programming with Spring Framework 5 by using RabbitMQ as a scalable messaging broker to stream stock quote data with a reactive stock quote service.
Explore a reactive RabbitMQ application with Spring Reactor to send and read messages from queues, including configuring RabbitMQ and streaming stock quotes end to end.
Add and integrate a stock quote generation service in a Spring application, including the quote model, a services package, and the interface and implementation to stream stock quotes via RabbitMQ.
Configure a RabbitConfig class to define a queue name and create a connection mono with a caching connection factory, then build a RabbitFlux sender from it.
Set up a reactive RabbitMQ receiver in Spring, subscribe to a delivery flux, and log and count each received stock quote from a queue.
NOTE: This course was completely recreated in May 2021 using Java 11 and Spring Boot 2.4.x.
One of the most interesting new features in Spring Framework 5 is Reactive Programming.
Reactive Programming is an important paradigm shift from the traditional object oriented programming commonly used with Java.
Reactive Programming adopts an immutable / functional style (which is fully explained in the course!).
While Reactive Programming may not be an automatic way of making your code faster, it can help your code scale up better. Especially if you are dealing with streams of data.
In side this course, you will first learn the fundamental concepts of Reactive Programming. You'll learn why immutability and functional programming are important to Reactive Programming.
Next, you'll get hands on experience with building a Reactive application to stream 'movie events' leveraging the Reactive data types and WebFlux - both new to Spring Framework 5.
These exercises help get you comfortable using the Reactive Programming APIs and functional programing style.
Following is a whole section on using Spring Web Client. This is the reactive web client introduced in Spring Framework 5. Spring Web Client is the reactive equivalent of Spring RestTemplate.
While Spring Web Client is the equivalent of Spring RestTemplate, Spring Web Flux is the equivalent of Spring MVC. You will learn how to use Spring Web Flux to create a RESTful API.
The JDBC API for accessing relational databases is blocking, and therefore not compatible with Reactive Programming. R2DBC is the reactive equivalent of JDBC. You will see how to use Spring Data R2DBC and reactive types to perform CRUD operations against a Relational Database.
Spring Webflux also introduces a new functional style API for defining endpoints. You will see how to use this functional API to configure a RESTful API. Hello functional programming, good by Spring MVC annotated controller classes!
Where Reactive Programming really excels is dealing streams of data. You will see how to build a stock quote streaming service. Then how to stream those stock quotes into a MongoDB document store. And how to stream stock quotes to RabbitMQ Messages.
Course Extra - IntelliJ IDEA Ultimate
Students enrolling in the course can receive a free 120 day trial license to IntelliJ IDEA Ultimate! Get hands on experience using the Java IDE preferred by Spring Framework professionals!
Course Extra - Access to a Private Slack Community
You're not just enrolling in a course --> You are joining a community learning about Reactive Programming.
With your enrollment to the course, you can access an exclusive Slack community. Get help from the instructor and other Spring Framework Gurus from around the world - in real time! This community is only available to students enrolled in this course.
With your enrollment, you can join this community of awesome gurus!
Closed Captioning / Subtitles
Closed captioning in English is available for all course videos!
PDF Downloads
All keynote presentations are available for you to download as PDFs.
Lifetime Access
When you purchase this course, you will receive lifetime access! You can login anytime from anywhere to access the course content.
No Risk - Money Back Guarantee
You can buy this course with no risk. If you are unhappy with the course, for any reason, you can get a complete refund. The course has a 30 day Money Back Guarantee.
After you complete this course, you will be comfortable in using the Reactive Programming features in your existing or new Spring Framework Applications.
Enroll today and start learning Reactive Programming with Spring Framework 5!