
Explore reactive programming with Java and Project Reactor, learning non-blocking techniques, asynchronous dataflows, and error handling to build fast, scalable, responsive applications.
Explore the difference between a reactive system and reactive programming, and how synchronous, asynchronous, and non-blocking flows enable event-driven, scalable, fault-tolerant microservice payment architectures.
Explore how Reactive Manifesto shapes robust, scalable systems by embracing responsive, elastic, resilient, and message-driven architectures for asynchronous flows that handle large data and traffic.
Explore reactive programming with Java and Project Reactor, focusing on asynchronous, non-blocking data flows, event loops, and backpressure, illustrated by order-service and video-analyzer examples.
Explore how reactive streams define publisher, subscriber, subscription, and processor. See how Project Reactor implements this model, including onSubscribe, request, onNext, and onComplete in a hybrid push-pull flow.
Create a Java reactive streams publisher by building a YouTubeChannel with a video list, a YouTubeSubscription, and wiring onSubscribe to connect the subscriber using the reactive-streams library.
Explore implementing a Project Reactor subscriber in Java by building a User class, wiring the Subscriber interface methods, logging on subscribe, onNext, onError, and onComplete, and requesting elements with Long.MAX_VALUE.
Implement the subscription to emit items via onNext, handle an unbounded request, verify the list size to avoid NullPointerException, and finalize with onComplete.
Run the example by creating a YouTubeChannel publisher, adding Reactive Programming with Java videos, subscribing a User, and verifying onSubscribe, request, onNext, and onComplete through the Subscription.
Discover Project Reactor, a reactive, non-blocking JVM library based on ReactiveStreams and the foundation of the Spring Reactive Stack, with Flux for many items and Mono for a single result.
Set up a Spring Initializr project for reactive programming with Java and Project Reactor, including reactor-core. Create video entity, YouTubeChannel publisher, and expose a Flux of videos via Flux.fromIterable.
Create a test class for a reactor publisher, subscribe to a flux to emit video data, observe onSubscribe, onNext, and onComplete events, and explore logging and automatic subscription options.
Explore creation operators in reactive programming with reactor core, including fromIterable, and learn how operators manipulate and transform data streams using signals like onNext, onComplete, and onError.
Learn basic creation operators in reactive programming with Java and Project Reactor by testing Flux.just, Flux.fromIterable, Flux.fromArray, Flux.fromStream, Flux.range, and Mono.just with StepVerifier and delayElements.
Use Flux.create() to emit elements synchronously or asynchronously with FluxSync; wrap file reading with BufferedReader, emit each line, and complete, enabling parallel processing of multiple files.
Demonstrates building a Flux with Flux.create to read a file line by line using a FluxSync emitter. Includes error handling, signaling completion, refactoring into readFileFluxSync, and exploring processing with CompletableFuture.allOf.
Explore the Flux().generate() operator, which emits elements synchronously using a three-function pattern: initialize state, emit or end per iteration with SynchronousSync, and clean up after completion.
use flux.generate to read a file line by line with a buffered reader, emitting lines and completing at end of file, verified with StepVerifier.
Explore creation operators in reactive programming with Java and Project Reactor, including just, fromIterable, fromArray, fromStream, range, create, and generate to produce Flux and Mono streams synchronously or asynchronously.
Explore how the take operator limits upstream requests in a reactive stream, triggering cancellation once the limit is reached, and observe downstream and upstream effects through log placement.
Test take and takeWhile operators in reactive streams with Java and Project Reactor. Subscribe, log, and see how videos are requested, emitted, and canceled under a condition based on likes.
Explore the map operator in reactive programming with Java and Project Reactor, transforming a stream of videos into a stream of description lengths and into a stream of video names.
Learn how flatMap unifies multiple channels' video titles into a single Flux by transforming inner publishers, contrasting with map when handling a function that returns a Publisher.
Demonstrate the flatMap() operator by updating video likes through a Mono and returning the updated video, then map to like counts for StepVerifier validation.
Explore the filter operator by creating getVideosByRating to filter a Flux of videos based on a likes threshold, then print which videos have more than 100 likes.
Explore how the delayElements operator simulates emission delays in a Flux within Project Reactor, using a 2-second interval, StepVerifier testing, and non-blocking event loop concepts.
Explore the transform operator in reactor streams by extracting doOnNext and map into a reusable function, then apply it to filter even and odd number pipelines.
Explore side effects operators in reactor, including doFirst, doOnSubscribe, doOnRequest, doOnNext, doOnCancel, doOnComplete, doAfterTerminate, doFinally, and take cancellation behavior.
Master the concat operator to sequentially combine two Flux streams, preserving order by waiting for the first to finish before starting the second, with a practical Java example.
Explore the merge operator by merging two flux streams of video names as they emit. See how emission speed, shaped by delays, determines order, not how one stream finishes.
Explore the zip operator, which combines video names and monetization values from multiple publishers into tuples. Learn how delays affect pairing, access via getT1/getT2, map results, and test with Flux.zip.
Apply the onErrorReturn operator to emit a fallback value, such as zero, when an error occurs (for example, in the third element) and end the stream gracefully.
Explore the onErrorResume operator by supplying a fallback Flux publisher to handle errors, demonstrated during getAllVideos processing with a two-element fallback.
Explore the onErrorContinue operator that discards faulty elements and continues processing. See a Monetization example fetching videos, applying flatMap to square values, and logging error-causing videos while proceeding.
Apply the onErrorComplete operator to replace the onError signal with onComplete, ending the sequence without an error, as shown with getAllVideos, flatMap, and doFinally logging.
Demonstrate how the onErrorMap operator transforms one error into another, using a MonetizationException to standardize exceptions when an error occurs on the third element.
Explore defaultIfEmpty and switchIfEmpty to provide defaults or fallback publishers when a stream emits no elements, with Mono and Flux examples.
Use the retry operator to reprocess a flux after an error, and retryWhen for retries with a two-second delay; place retry after the map and test counts 1 and 2.
Explore how schedulers shape a reactive stream, with quick filter and map on the main thread while a heavy final map causes blocking.
Explore how schedulers control thread execution to avoid blocking the main thread in reactive Java. Learn bounded elastic, parallel, and single schedulers, and apply publishOn and subscribeOn to video analysis.
Explore how publishOn and subscribeOn schedulers partition work between the main worker thread and boundedElastic threads, showing parallel blocking operations for multiple subscriptions and sequential execution for a single subscription.
Explore parallel processing with schedulers in Project Reactor by applying the parallel.runOn operator to dedicate a separate thread per item, creating three parallel threads and accepting out-of-order results.
Learn to manage blocking operations alongside non-blocking streams in reactive Java with Project Reactor by applying publishOn with the Parallel Scheduler and BoundedElastic Scheduler, including Mono.fromCallable and flatMap.
Explore backpressure in reactive streams by observing how a publisher and subscriber negotiate requests, buffering excess items with onBackpressureBuffer and managing buffer size with maxSize.
Demonstrate backpressure handling with flux.interval producing items every millisecond and a slow consumer, using publishOn and onBackpressureBuffer to buffer requests under maxSize limits.
The onBackpressureError strategy throws an error when downstream cannot keep up, canceling flow after unconsumed items. Tests show a 16-item first request triggers an error, unchanged by adding operator.
Explore the onBackpressureDrop strategy, where excess items are dropped when downstream can't keep up, as the example shows interval emissions and 500 ms consumption causing thousands of drops.
Explore the onBackpressureLatest strategy in reactive programming with Java and Project Reactor, using a one-element buffer that retains only latest unconsumed item and processes it on the next downstream request.
Explore backpressure with Flux.create and FluxSink, emitting 0 to 100 elements, and compare buffering, error, drop, and latest strategies.
In this practical and focused course, you'll learn about Reactive Programming with a focus on Project Reactor, a widely recognized Java library that simplifies building reactive, non-blocking systems.
This course is designed for software developers who want to enhance their skills in reactive programming and explore Project Reactor as a powerful tool. It's ideal for Java developers and anyone interested in creating highly responsive and efficient systems.
You'll learn about reactive data streams, handling concurrency, error management, and more. By the end of the course, you’ll have a solid understanding of reactive programming.
What You Will Learn:
Core Concepts: Explore the essential principles of reactive programming, including reactive systems, synchronous and asynchronous flows, non-blocking operations, and event propagation in data streams.
Reactive Streams: Dive into Reactive Streams, which provide the foundation for reactive programming, enabling applications to dynamically react to events and data flows.
Introduction to Project Reactor: Discover Project Reactor, getting to know its key components like Flux and Mono, and learn how to use them to create reactive applications.
Creation Operators: Explore Project Reactor's creation operators, which let you generate reactive data streams from various sources, such as collections, expanding your options for building reactive applications.
Operators: Learn how to apply transformation and filter operators to shape reactive data streams to fit your needs.
Combining Streams: Understand how to combine, merge, and aggregate data streams efficiently.
Error Handling: Learn effective strategies for error handling and recovery in reactive environments.
Schedulers: Understand the importance of Schedulers in reactive programming and learn how to manage concurrency and optimize task execution for efficient systems.
Backpressure: Learn to manage backpressure, a key technique to ensure data streams are processed efficiently, preventing overload.