Using Spring WebFlux and Kotlin Coroutines, methods in controllers are usually (if they invoke other suspending functions) marked with the suspend
modifier. That means that Spring implicitly creates coroutines to call them, and it does that with some coroutine context . Is there a way to have control over that coroutine context? In particular, I'd like to add MDCContext to every coroutine context that Spring creates.
Asked
Active
Viewed 348 times
2

WildWind03
- 301
- 3
- 14
-
For WebMvc it can be done [this way](https://stackoverflow.com/questions/68437892/configure-default-kotlin-coroutine-context-in-spring-mvc) I do not know if it's transferable. – Lukas Jul 20 '21 at 18:17