Migrating from Imperative to Reactive
summary
Migrates a Spring Boot REST app stepwise: annotation-based spring-webmvc to spring-webmvc -> functional routes -> spring-webflux, swapping blocking JPA/Hibernate for R2DBC replacing JPA/Hibernate against H2, and replacing the auto cache with an async Hazelcast proxy. Adds BlockHound so BlockHound caught blocking cache calls during the demo, then fixes it by using Hazelcast’s async API and Reactor’s fromCompletionStage — Hazelcast async cache with fromCompletionStage. Demo compiles and serves correct 200/404 responses after the fixes.
AI-written summary · about
chapters (18)
- 0:00Migrating to reactive intro
- 1:19What makes reactive
- 3:49Reactive streams non-blocking
- 5:15Reasons to adopt reactive
- 7:44Reactive programming challenges
- 10:13Reactive Streams API
- 11:57Project Reactor basics
- 13:45WebFlux vs Spring MVC
- 15:52Migration path to WebFlux
- 16:15Migration demo setup
- 20:14Switching to functional API
- 23:23Routes to handler classes
- 25:09Making app reactive
- 28:48Replacing JDBC with R2DBC
- 32:49Blocking calls with BlockHound
- 34:55Handling missing entities
- 37:03Reactive caching with Hazelcast
- 41:20Key takeaways








