3 days
Online / Zoom
English
Certificate
15 people max
Victor Rentea
€11200
14000
This training is for you if your project uses Spring 5 WebFlux, you need to optimize a high-load API or batch workflow, or you've encountered bugs and challenges when working with Reactor. It’s also for you if you simply want to master one of the most complex programming paradigms in the world.
Introduction
The first challenge when approaching reactive programming is understanding why and when not to use it. Starting with ‘classic’ blocking web endpoints, we’ll benchmark the bottlenecks that occur under heavy load and then explore the various historical alternatives to Reactor. While we’ll examine dozens of operators, the focus will remain on understanding the signals that drive all reactive flows—this is key to unlocking the mysteries of backpressure, hot publishers, and avoiding common pitfalls when beginning to work with Reactor. We will then use this knowledge to approach several typical reactive flows, drawing conclusions about the best ways to write code that is maintainable and safe. After a comprehensive tour of Spring WebFlux features and quirks, we’ll move on to two tough tasks: testing reactive flows and progressively migrating blocking code to reactive flows. If time permits, we’ll also discuss performance tuning.
Agenda
Introduction
[optional, basics] Recap: functional pipelines with Java8 Streams
Blocking REST Endpoints: trace a thread pool starvation issue
Alternatives to Reactive: CompletableFuture, coroutines(kt), Virtual Threads (Project Loom)
Challenges of distributed systems under heavy load - brainstorming
Testing
StepVerifier vs .block()
TestPublisher
PublisherProbe + custom extension
Detecting blocking code with BlockHound
Controlling Virtual Time [optional]
Debugging, Monitoring and Tuning
Propagating metadata via Reactor Context
Checkpoints and Hooks.onOperatorDebug
Monitoring using .metrics, .elapsed, .timed
Common Pitfalls and Workarounds
Not subscribing / Resubscribing to Cold Publisher
Loosing Data Signals (empty)
.subscribe()
Blocking in non-blocking threads
Unexpected Cancelation
Review of Code
Sample from the audience
Victor Rentea
Victor is a Java Champion, Java Enterprise Architect, and Independent Trainer, delivering intense masterclasses for companies worldwide since 2014. He is passionate about software architecture, clean code, refactoring, and unit testing. He is a regular speaker at top international conferences. He's also the founder of the Bucharest Software Craftsmanship Community with 4000 members.