Asynchronous programming with Kotlin coroutines in Spring
summary
Shows exactly what changes let synchronous Spring apps become nonblocking: add suspend to methods, flip dependency from Spring MVC to Spring WebFlux, and use the spring-kotlin-coroutine support library (add enableCoroutine). Explains argument/return-value resolvers for the compiler-added Continuation, using CoroutineWebClient instead of WebClient, coroutine repositories, coroutine-aware caching, suspending event listeners and custom CoroutineContext/dispatchers for dedicated thread pools. Notes limits: no reactive SQL support yet, thread‑locals and transactions don’t work and stack traces span threads.
AI-written summary · about
chapters (13)
- 0:00Asynchronous programming with coroutines
- 3:22Synchronous blocking problems
- 10:27Spring needs coroutine handling
- 15:41Kotlin coroutines library for Spring
- 16:25Blocking code to coroutines
- 21:16CoroutineContext for threads
- 24:45Annotations for CoroutineContext
- 29:00Non-blocking I/O with WebFlux
- 31:49RestTemplate to WebClient
- 36:08Reactive repositories
- 40:17Caching for suspending functions
- 42:28Migrating to async Spring
- 44:36Q&A
related talks
44mAsynchronous Programming with Kotlin Coroutines in Spring
01h 03mUsing Kotlin Coroutines for Asynchronous and Concurrent Programming
40mConcurrency made easy with Kotlin Coroutines
51mServer-side Kotlin with Coroutines
43mCoroutines for Java Developers
02h 10mDeepdive into Reactive Spring with Coroutines and Kotlin Flow
47mSpring Boot with Kotlin, Kofu and Coroutines
52mSpring Boot with Kotlin, Kofu and Coroutines
