webflux
13 article(s) with this tag
-
26 May 2026
💊 #24: The Java Pills website rewritten from scratch in «vibe coding» with Claude Code
The pill that launches javapills.com by telling the story of the site itself: built from scratch in «vibe coding» with Claude Code – architecture, tests, security, deploy.
-
24 Apr 2026
💊 #22: That time repeat() + empty() melted my CPU
A Mono.empty() put inside a repeat() becomes a silent hot loop: millions of subscriptions per second, CPU at 100% and zero elements emitted. A test to reproduce it and a few ideas to avoid it.
-
29 Jul 2025
💊 #18: Optimising your code with WebFlux, p. 2 – the share method
The .share() method turns a cold Flux into a hot one: the source runs only once and concurrent subscribers receive the same stream.
-
21 Jul 2025
💊 #17: Optimising your code with WebFlux, p. 1 – the cache method
Flux's .cache() method stores the values emitted on the first subscription and reuses them for the following ones, avoiding recomputation on the source.
-
03 Jul 2025
💊 #15: Orchestrator + Strategy = fallback with style!
Combining the orchestrator pattern and the strategy pattern to handle dynamic fallbacks (e.g. audio transcription): decoupled, extensible and testable code.
-
21 Jun 2025
💊 #14: Is Mono a lazybones? It depends!
Mono.just() evaluates its argument immediately (eager), Mono.fromCallable() defers execution until subscription (lazy): handy for potentially blocking operations.
-
17 Jun 2025
💊 #13: Where does the Mono run?
A Mono's execution thread changes when you use subscribeOn(): by default it's the subscriber's thread, with boundedElastic() it moves to the pool dedicated to blocking I/O operations.
-
24 Mar 2025
💊 #12: The zip methods with a combinator
Using the combinator variants of Mono.zip, zipWith and zipWhen to get a well-typed object directly instead of a Tuple2, plus a custom helper for the N-Mono case (with N > 2).
-
06 Nov 2024
💊 #8: Eager and lazy strategies compared with Optional and Mono (WebFlux)
Differences between orElse and orElseGet on Optional, switchIfEmpty with and without defer on Mono: eager vs lazy strategies and when to pick each one to avoid side-effects.
-
28 Oct 2024
💊 #7: Backpressure with WebFlux – the hookOnSubscribe and hookOnNext methods
How to control the flow of data between publisher and subscriber with BaseSubscriber, hookOnSubscribe and hookOnNext: batched requests to avoid overloads.