
Learn reactive programming from scratch with hands-on practice. Understand theory first, explore non-blocking pillars, and apply it to Java microservices, Spring Web Flux, Kafka, and Redis.
Learn how a Java program forms a process with isolated memory, how threads share RAM within a process, and how the OS scheduler performs context switches across CPUs.
Explore IO models from synchronous blocking to asynchronous and non-blocking patterns, and see how reactive programming simplifies non-blocking communication in Java.
Explore how reactive programming enables four communication patterns: request-response, streaming response, streaming request, and bidirectional streaming, often combined with virtual threads and structured concurrency.
Discover the reactive stream specification and reactive programming as a paradigm for asynchronous, non-blocking stream processing with back pressure, driven by the observer design pattern.
Explain how reactive programming uses the observer pattern to observe and react to data streams, with publishers, subscribers, and processors defined by the reactive streams specification.
Explore publisher and subscriber interactions in reactive programming, including subscribe, subscription object, on next, on complete, and on error, and how the publisher emits only the requested items.
Master reactive programming to process streams non-blockingly and asynchronously, using a publisher-subscriber model with back pressure and streaming capabilities, minimizing threads with non-blocking io.
Set up a reactive learning project with Maven or Gradle, Java 17+, and Project Reactor, configuring dependencies, logback, and testing to practice reactive streams with publishers and subscribers.
Implement a custom publisher and subscriber for reactive streams to demonstrate request, cancel, and message flow, printing email addresses to the console.
Demonstrates a publisher-subscriber pattern in Java, handling requests and cancellations, generating up to ten items with Faker email addresses, and signaling completion when data runs out.
Demonstrate validation of publisher/subscriber rules in reactive programming by emitting items only on request, with cancellation and error signaling and zero-item cases.
Explore mono and flux in reactor, showing how mono emits zero or one item with onComplete or onError, while flux emits multiple items and supports backpressure via subscriber requests.
Discover why mono is convenient for single-item queries, such as querying by customer ID. Compare mono and flux for single versus multiple results, noting non-blocking behavior and back pressure.
Learn that java streams are lazy by default and run only after connecting a terminal operator. Contrast this with reactive programming, where subscribing triggers execution for mono or flux.
Explore how mono emits 0 or 1 item in reactive programming using the just factory method, and learn how subscribe and request trigger emission and completion.
Explore mono subscribe overloads using a simple mono publisher, handling on next, on complete, and on error with optional parameters, and observe auto request and error handling via map.
Create a generic default subscriber for reactive streams to simplify demos, print each received item with a subscriber name, and request long max value to manage backpressure.
Demonstrates creating Mono publishers that emit data with just, or signal no data with empty, and emit errors with onError, using a get username example for user id.
Demonstrate why omitting an error handler in a reactive stream leads to default on error dropped, and show how to supply an error handler while using a string consumer.
Explore lazy execution in reactive programming with Mono from supplier, delaying compute-intensive sums until subscription, and publish integers using map, reduce, and subscribe.
Explore how Mono from Supplier and Mono from Callable differ in handling checked exceptions, with Callable declaring throws while Supplier does not, and learn to prefer Callable for wrapping tasks.
Explore how to create a mono from runnable in Project Reactor, compare with just, supplier, and empty signals, and learn when to invoke side effects before emitting a signal.
Convert a completable future to a mono publisher with reactor's from future, and explore using supplier, callable, and runnable. Demonstrate lazy execution by subscribing to see value only when needed.
Learn why publisher creation is lightweight and execution is deferred until subscription; use a supplier to delay a time-consuming operation, clarifying creation versus execution in reactive streams.
Use mono.defer to delay publisher creation with a supplier until a subscriber subscribes, letting time consuming work run only when needed.
Explore fetching data from remote services with reactive mono patterns, enable non-blocking http calls via spring web flux, and review reactive drivers for databases and messaging.
Run a Spring Boot jar on port 7070 to explore Swagger APIs for a product service and practice non-blocking, reactive HTTP requests with a reactor network.
Learn to build a non-blocking http client with reactor netty, configure loop resources, and fetch product information from localhost:7070 using mono and flux.
See how non-blocking IO handles multiple concurrent HTTP requests with a single thread, using a publisher-subscriber model to retrieve product names.
Explore how non-blocking I/O and the event loop manage hundreds of concurrent requests with outbound and inbound queues, showing how responses arrive out of order due to latency.
Explains why blocking with the block statement undermines reactive programming, showing how blocking a Mono or streaming data prevents concurrency and is unsuitable for production, except tests.
Explore why reactor net simplifies non-blocking io by replacing complex asynchronous socket callbacks with a reactive model that uses subscribers and onNext, onComplete, and onError.
Develop a reactive file service interface and implementation to read, write, and delete small files. The read method takes a file name and mono string; work runs with a subscriber.
Implement a reactive file service in Java by reading, writing, and deleting files under the section zero two path using Mono from callable and Mono from runnable, with error handling.
Discover why unit testing in reactive programming requires mastering all concepts first, and how this course builds testing skills only after understanding core ideas.
Explore reactive programming concepts with mono and flex publishers, learn how reactor implements reactive streams, and see how mono handles single requests while flex supports multiple messages.
Explore how flux emits zero to many elements with on complete or on error signals, including never ending streams, and understand publisher and subscriber interactions using the just method.
create a flux with the just method to emit items and show multiple subscribers receiving all items; apply filter and map for even numbers and appended transformations.
Learn how to create a Flux from an iterable or array using a utility, converting a list or array to Flux and observing item emission and completion via a subscriber.
Learn to create a Flux from a Java stream and why streams are one time use. Use a stream supplier to enable multiple subscribers, including method references.
Learn to use flux range to emit ten numbers from a starting point, then map to Faker first names and subscribe to see the results.
Discover how the log operator in Java reactive programming debugs data flow between producer and subscriber by logging subscriptions, requests, and onNext events with Flux.range.
Compare traditional list generation with reactive flux for generating names, showing non-blocking streaming, backpressure support through subscriber requests, and early cancellation.
Compare Gemini and ChatGPT to illustrate reactive programming as a non-blocking, asynchronous stream. Highlight streaming responses, responsiveness, and the contrast between upfront lists and flex-like data delivery.
Discover how mono and flux act as data transfer pipes in Java reactive programming, contrasting them with finite memory structures like lists and maps and highlighting publisher and subscriber dynamics.
Consume a stream of messages over http with reactor network, using a streaming service that emits random names every 500 ms as a flux of strings for reactive programming.
Explore the interval in flux to emit a message every 500 milliseconds from zero on a separate thread, with cancellation and map operator to generate names with faker.
Explore how flux emits items only when available, using empty to complete and error to signal exceptions; implement with flux dot empty and flux dot error and subscribe util subscriber.
Explore how to defer Flux execution using defer with a supplier, create Flux from a list via from iterable, and compare with Mono's from supplier and from callable.
Convert between mono and flux to satisfy libraries; use Flux.from for mono-to-flux and next for flux-to-mono, handling empty and error cases.
Learn reactive programming by building a stock price observer that subscribes with $1,000, buys below 90, sells above 110, and prints profit after 500 ms price stream for 20 s.
Explore a reactive stock trading scenario by implementing a stock price observer that subscribes to a price changes stream, buys below 90 when affordable, sells above 110, and tracks profit.
This section covers creating a flux with factory methods, including from memory, iterable, array, stream, and range, plus converting between flux and mono and delaying execution with defer.
Master flux creation with the create method, emit items via a flux sink using next, and signal completion; explore programmatic emission with a country-name loop ending at Canada.
Refactor flux create by introducing a name generator helper that implements consumer of flux create, emitting strings through the sink and optionally signaling completion after a set count.
Demonstrate flux sync thread safety by contrasting an unsafely updated array list with a thread-safe flux sync, showing safe, sequential item transfer.
Observe how flux create emits all items upfront into an unbounded queue before the subscriber requests data. Request two items, then cancel, showing that after cancellation no data is delivered.
Switch the flux create behavior to emit on demand using the on request callback in flux sync, emitting items only when the subscriber requests and checking is canceled.
Explore flux sink use cases for a single-subscriber, thread-safe data flow that emits user and product ids non-blockingly. Separate subscriber handles database inserts, keeping product information retrieval fast and scalable.
Explore the take operator in reactive programming as a processor that limits values from a range, and compare take while and take until with practical examples.
Explore the flux generate method in reactor, comparing it with create and using a synchronous sink to emit one item per invocation based on downstream demand.
Utilize flux.generate to emit country names synchronously until Canada is encountered, then complete the sequence. Learn to apply takeUntil with a predicate to stop when the condition is met.
Explore flux generate and why an outside counter fails. Learn how to stop after ten emissions or at Canada without external mutation, and preview the solution.
Explore flux generate with state to maintain resources like a database connection, using an initial value and a sink to emit values under downstream demand, and close resources on completion.
Implement a file reader service publisher that reads a file line by line and emits each line as a flux only when subscribed, respecting downstream demand and cancellation.
Develop a Java reactive programming file reader service that reads a file line by line on demand, managing open, read, and close lifecycle via a subscriber.
Compare flex create and flex generate, showing create emitting items thread-safely for single subscriber, while generate respects demand. Illustrate building a file reader utility that reads lines on demand.
Explore how operators act as decorators on publishers like flux or mono, adding filter and map stages to build a declarative reactive pipeline.
Explore the handle operator, which combines ideas from filter and map to conditionally emit, modify, or error items in a flux, illustrated with a 1 to 10 example.
Demonstrate the handle assignment operator by generating sync events, emitting items as strings, and performing a case-insensitive comparison to Canada, then completing and subscribing to the stream.
Explore do hooks and callbacks in reactor flux, including do first, do on next, and do on complete. See how downstream demand and the take operator affect execution.
Explains doOnNext in reactive programming, clarifying that mutation is not inherently bad, and how mutable entities can be updated safely in a non-blocking mono pipeline.
Explore the delay elements operator, delaying each item by a duration using a separate thread, and observe per-second requests controlling when values are produced.
Explore using the subscribe method with util.subscribe or separate callback handlers, such as the consumer and the error handler, to print outputs and improve readability.
Learn to handle errors in reactive programming by using on_error_return to supply fallback values, handle specific exceptions like arithmetic or illegal argument exceptions, and control error propagation.
Explore error handling in a reactive pipeline with on error resume and a fallback service to supply a response when the product service fails, including multiple fallbacks for different exceptions.
Explore error handling in a reactive pipeline, using error complete to emit a complete signal instead of a value or exception, and implement onerror complete.
Skip faulty items in a reactive pipeline with Project Reactor’s on error continue, and log the exception and triggering object to keep streaming toward completion.
Explore the default if empty operator in reactive streams and learn to apply a fallback value when mono yields nothing.
SwitchIfEmpty routes to a fallback publisher when a reactive stream is empty, replacing a default with a fallback stream. Redis cache misses and database queries illustrate with on error resume.
Learn to use the timeout operator in reactive Java to cap wait times for remote service calls and provide fallbacks when responses exceed the limit, ensuring robust, responsive apps.
Apply multiple timeouts to a publisher and handle timeout errors without changing library code. A 200 ms producer timeout dominates, so timeouts like 5000 ms will not extend wait time.
Learn how the transform operator simplifies reactive pipelines by creating reusable steps that convert a flux into another flux. Build a debug operator that conditionally logs based on a flag.
Implement a resilient product lookup for four IDs using a Java reactive client with a two-second timeout, timeout fallbacks, and empty response handling, all abstracted behind the service client.
Implement a single external service client with configurable endpoints (default, timeout, empty), showing product name retrieval and fallback logic for simulated timeouts and empty responses in a three-microservice setup.
Treat operators as data-flow processors, producers and subscribers, guiding data from the UI through filter and map to the database or back to the UI for display and error handling.
Explore hot and cold publishers, showing how cold publishers deliver independent data streams per subscriber, while hot publishers share one data producer and can emit items without a subscriber.
Explain why Flux create with Flux sync works for a single subscriber. Show how outside state and a shared Flux generator cause data to vary for multiple subscribers.
analyze the heart publisher that emits movie scenes via a flux and see how share makes it a hot publisher for concurrent subscribers.
Explore hot publisher behavior with ref count, showing how the share alias requires at least one subscriber to start emitting and how re subscription restarts from the beginning.
Explore auto connect in reactive streams with publish auto connect, which keeps producing data even with zero subscribers. Contrast it with publish ref count and min subscriber behavior, heart publisher.
Discover how hot publisher with replay and cache lets late subscribers see the current stock price and receive updates without missing past data.
Learn how to turn a flux into a hot publisher to support multiple subscribers using share or auto connect, contrasting cold and hot behavior.
Understand cold versus hot publishers: per-user data streams versus broadcasting the same data to many subscribers, with features like share, auto connect, and replay auto connect.
Build a simple reactive setup that consumes a colon-delimited order stream from an HTTP endpoint, updates revenue by category, tracks inventory, and emits two-second summaries.
Build a reactive assignment solution that converts string messages to order objects, then update revenue and inventory streams for two subscribers every two seconds.
Explore threading and schedulers in reactive programming with the reactor library. Learn how default current-thread execution of flux publishers and operators can cause blocking.
Explore the default threading behavior of Flux publishers and subscribers, observe generation and emission on the main thread, and introduce separate threads with runnables.
Discover how reactor schedulers use thread pools to optimize CPU and I/O. Learn when to apply bounded elastic, parallel, single, immediate schedulers, and subscribeOn or publishOn.
Learn how subscribe on offloads upstream work to a scheduler while publish on handles downstream, and how a reactive flux delegates execution to a thread pool for the subscriber.
Demonstrate the subscribeOn operator in reactive streams using bounded elastic schedulers, showing main-thread work versus thread-pool execution across two subscribers.
Explore how multiple subscribe on operators shape work in a reactive pipeline, using bounded elastic and other schedulers, and why the closest to the producer determines task handling.
Understand the immediate scheduler, which runs on the current thread and avoids thread pools, and see how it handles multiple subscribers without changing the scheduler.
Enable virtual threads in project reactor to handle blocking io and network calls within the bounded elastic pool, while cpu tasks stay on parallel pools.
Schedulers do not automatically enable parallel execution; in a cold publisher with multiple subscribers, each subscriber borrows a thread from the pool and processes items sequentially.
Explore how subscribe on and publish on control threading in a reactive pipeline, switching between producer and consumer schedulers to optimize data flow with bounded elastic and parallel options.
Demonstrate how publish on and subscribe on control threading in reactive streams, showing upstream versus downstream execution with current thread, bounded elastic, and parallel schedulers.
Explain a blocking event loop problem and fix it by offloading time-consuming processing to Reactor's bounded elastic scheduler, keeping IO on the event loop for parallel product retrieval.
Explore how subscribe on handles upstream and publish on downstream in a reactive pipeline, using bounded elastic and parallel thread pools to coordinate a producer, operators, and a subscriber.
Explore parallel execution in reactive programming by using parallel operators and schedulers to run tasks concurrently, control parallelism, and merge back to sequential processing when needed.
Explore reactor threading and schedulers to offload blocking tasks asynchronously with bounded elastic, parallel, single, and immediate schedulers. Understand subscribe on and publish on for controlling execution flow and processing.
Explore back pressure in reactive streams by examining how non-blocking, asynchronous pipelines balance producer and subscriber speeds, and learn strategies used by reactor to automatically adjust data flow.
Explore how reactor automatically handles back pressure between a fast producer and slow consumer, using internal queues and bounded elastic thread pools to regulate emission and consumption.
Learn how to use the limit rate operator to throttle a producer in a reactor setting, ensuring the producer slows to match a slow consumer and manages back pressure.
Demonstrate how a single producer adjusts its emission rate to match slower and faster subscribers, illustrating back pressure with multiple subscribers and the take operator to cap output.
Examine back pressure in flux create, where a fast producer outruns a slow consumer, overloads the internal queue, and explore strategies to manage rate and prevent memory issues.
Apply the buffer strategy to handle back pressure by inserting a buffer operator between producer and subscriber, storing items in memory to accommodate occasional spikes and steady processing.
The error strategy introduces an operator to monitor back pressure, emit an error when the producer outpaces the subscriber, and cancel upstream to stop data production.
Demonstrates a fixed-size on backpressure buffer of ten items. When the eleventh item is stored, the buffer fills; the twelfth item triggers an error and stops the producer.
Master the drop strategy in Java reactive programming by balancing downstream requests with upstream production; the drop operator passes only requested items, dropping the rest to maintain backpressure.
Explore the latest operator and how it holds one latest item, drops older ones, and delivers the most recent value to the downstream subscriber on request.
Choose an overflow strategy for Flux create to control backpressure, selecting from drop, buffer, error, latest, or ignore, and decide whether a single global strategy or per-subscriber strategies apply.
Explore back pressure strategies in reactive pipelines with multiple schedulers, and learn how reactor uses an internal queue to buffer, drop, or deliver latest items to prevent overload.
Learn to combine multiple publishers with reactor using mono and flux operators to perform ordered IO requests, aggregate data from multiple back-end services, and deliver enriched product views.
Explore the start with operator in java reactive programming, which connects two publishers into a single stream, prepends optional values, and manages downstream requests and completion.
Demonstrate the start with use case by simulating a time-consuming name generator with a cache layer; multiple subscribers receive cached names, and on cache misses the generator emits new results.
Discover the concatenate with operator in Project Reactor, which subscribes to a first producer, then appends another after completion, and supports multiple publishers via a factory method.
Understand how concatenate handles errors in Java reactive streams by chaining producer one, producer three, and producer two, and how delaying errors works until after data items are emitted.
merge multiple publishers into a single flux, subscribe to the merged stream, and see that order is not guaranteed; take cancels upstream, completing after two items.
Use zip with mono.zip to aggregate product name, review, and price from three endpoints into a single product object by product ID.
Explore flatMap in Java reactive programming to handle sequential, dependent calls across microservices, such as retrieving a user ID from a username, then fetching user orders and balances.
Learn how mono.flatMap flattens an inner mono when chaining user service and payment service calls to retrieve a single user balance, avoiding mono of mono.
Demonstrate how flatMapMany handles inner publishers that emit multiple items, converting a mono into a flux to fetch all user orders from the user and order services.
Learn how to use Flux flatMap to fetch all user orders by mapping users to their orders, converting inner monos to a Flux of orders, and observing multi-user subscription behavior.
Explore how flatMap subscribes to multiple inner fluxes as items arrive. Learn to set a custom concurrency limit and the implications for TCP connections and HTTP/2.
Implement the flatMap assignment by converting a range 1 to 10 into a flex that maps each number to a product and subscribes, illustrating three calls at the same time.
Explore concatMap as a sequential alternative to flatMap in reactive programming, waiting for each inner flux to complete before starting the next, demonstrated with sequential IO requests.
Explore the collect list operator, which gathers all items from a finite flux into a mono of a list, turning a flux of integers into a list.
Master the then operator in reactive programming: ignore on next values, wait for completion, and chain publishers so that actions like saving records finish before sending a notification.
Learn to build a single user information object for all users by combining user data, balances, and orders from the user service using mono, zip, and collect list.
Learn how to orchestrate microservice calls with reactive operators such as start with, concatenate, merge, zip, flatMap, and concatenate map, choosing parallel or sequential flows.
Explore batching in reactive programming to efficiently process streaming data from Kafka, RabbitMQ, Pulsar, or any never-ending flux. Learn operators that enable efficient processing for topic messages and continuous streams.
Use the buffer operator to batch fast-emitting user events into lists for batched database inserts. Learn count-based and time-based buffering with buffer timeout to avoid stalling on incomplete item streams.
Create a self-contained stream that emits a book order object every 200 ms and reports five-second revenue as a Java object, focusing on science fiction, fantasy, suspense, and thriller.
Create an assignment package with a book order record and a revenue report, streaming random orders every 200 ms, buffering every five seconds to generate a revenue summary by genre.
Explore the window operator in reactive programming, contrast it with buffer, and learn to emit items to subscribers as they arrive while opening new windows at intervals, like log files.
Demonstrates windowing with flux of string, opening a new inner flux every five items or after a duration, and subscribing to each inner flux.
Demonstrates a reactive file writer that consumes a flux of strings, writes to sequential log files with a counter-based name, and manages open, write, newline, and close operations.
Group by routes items into color-based inner fluxes for independent per-group processing with custom operators, while windows open one flux; group by keeps many fluxes, so use low cardinality.
Experiment with the group by operator to split a stream into odd and even groups, observe inner fluxes keyed by group, and process each group with map and subscribe.
Process a stream of purchase order events, group by category, and apply rules: automotive adds 100 to price; kit orders trigger buy-one-get-one-free; emit updated events to the subscriber.
Explore group by in reactive Java by building an order processing service for automotive and kids orders, applying per-category rules like price adjustment and buy-one-get-one offers.
Master reactive operators for streaming data, including buffer to collect items, windowing, and group by color, to process sub streams, subscribe, drain, and manage resources.
Unleash the Power of Reactive Programming & enable stream based communication in your Microservices architecture.
It is a Hands-On Course. You should be willing to write code.
This course equips you with the skills to build modern, scalable, and responsive applications. Master the art of handling asynchronous data streams with Reactive Programming, a game-changing development paradigm.
Key Benefits:
Build Efficient Systems: Escape the limitations of blocking operations and write code that's non-blocking and resource-saving.
Enhance Scalability: Create applications that can handle increasing loads with ease.
Embrace Asynchronous Operations: React swiftly to data changes and deliver a smooth user experience.
Craft Resilient Code: Develop robust systems that can handle errors gracefully and recover quickly.
Unlock Advanced Techniques: Learn powerful operators for manipulating data streams, managing backpressure, and more.
Course Highlights:
Reactive Programming Fundamentals: Grasp core concepts, publishers (Mono & Flux), and understand hot vs. cold streams.
Asynchronous Mastery: Perform operations without blocking threads, freeing up resources for other tasks.
Operator Exploration: Discover the power of various operators for transforming, filtering, and combining data streams.
Backpressure Control: Learn strategies to prevent overwhelming your system with data.
Threading and Schedulers: Optimize thread usage and ensure efficient execution.
Sinks: Unicast, Multicast, Replay: Understand different mechanisms for delivering data to subscribers.
Advanced Techniques: Explore concatenation, merging, zipping, combination operators, and more.
Batching with Buffer, Window & GroupBy: Process data in chunks for efficient handling.
Error Handling & Retry Mechanisms: Build robust systems that can recover from failures.
Testing with Step Verifier: Write unit tests specifically for reactive code.
Declarative Programming: Express your business logic clearly and concisely.
Context Management: Manage application context within reactive streams.
Reactive Hooks & Callbacks: Leverage additional control mechanisms for reactive operations.
Parallel Stream Processing: Unlock the potential of multicore processors for faster execution.
By the end of this course, you'll be able to:
Confidently write reactive applications that are:
Highly Scalable: Handle increasing workloads efficiently.
Resilient: Recover from errors gracefully.
Responsive: Deliver a smooth user experience.
This course provides a solid foundation for anyone seeking to excel in the world of reactive programming.