Pickup coroutineContext saved by CoWebFilter in coRouter #31793
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
theme: kotlin
An issue related to Kotlin support
type: bug
A general bug
Milestone
This was problem initially brought up here: micrometer-metrics/tracing#174 (comment) by @meberhard.
Problem: Currently the only place in Spring Framework that is picking up
CoWebFilter.COROUTINE_CONTEXT_ATTRIBUTE
is this: https://github.com/spring-projects/spring-framework/blob/main/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/InvocableHandlerMethod.java#L296but this code does not get executed for
coRouter
handlers. This means that the handlers installed bycoRouter
won't inherit the coroutineContext from CoWebFilter(s).Known workarounds: you can add the look up into each instance of
coRouter
DSL manually:To show case it, I have the following example:
The text was updated successfully, but these errors were encountered: