From Java WebFlux to Kotlin Coroutines, the Journey...?
summary
A team migrates a Spring Boot REST application from Java WebFlux/Reactor to Kotlin using coroutines and Flow while keeping Spring WebFlux, WebClient, reactive Spring Data and Mongo. They must rebuild mappers, routing and validation, replace Mono/Flux with suspend functions and Flow, handle Reactor pitfalls (Mono.defer vs Mono.just, reading response bodies to close WebClient connections), adapt models for Kotlin null-safety via data classes/extensions, and update about 3,000 Mockito tests; the mapping and test rewrites are the main effort.
AI-written summary · about
chapters (23)
- 0:00Introduction
- 1:05Application overview
- 2:52Kotlin migration and deps
- 3:56WebFlux and reactivity
- 6:02Functional validation and filters
- 7:31Database and cache
- 8:13REST calls and Mono defer
- 9:56Kotlin basics
- 12:42Kotlin routing
- 15:29Modeling issues
- 16:53Java to Kotlin
- 17:35Null safety and data classes
- 18:39Safe mapping
- 19:40Extensions for readability
- 20:23Reified validation
- 21:48Generic types
- 22:09Coroutines intro
- 22:50Flow and coroutines
- 23:55Coroutine validation
- 25:00Unit tests with Mockito
- 26:23Complex types and casting
- 27:06WebFlux vs coroutines tests
- 27:47Conclusion and key differences
related talks
43mSpring Boot with Kotlin, Kofu and Coroutines
01h 05mWhy Spring Loves Kotlin
01h 12mA-Z of Kotlin Flow
49mAsynchronous programming with Kotlin coroutines in Spring
01h 00mMigrating from Imperative to Reactive
46mMoving from Imperative to Reactive
42mGo with the Flow
45mHow we buid and mitigated our Spring Boot applications to Kotlin
