-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)theme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin supporttype: enhancementA general enhancementA general enhancement
Milestone
Description
Affects: spring-webflux 5.3.7
I write my filter, pass some parameters to coroutine context via witchContext
and want to be able use it later in the child coroutines and handlers. The problem is that CoroutineContext
is lost in filter chain.
For example something like this
@Bean
fun testRouter(tracingFilter: ITracingFilter) = coRouter {
GET("/test") { request ->
val span = coroutineContext[SpanContext] // is null
someHandler.processRequest()
}
filter{ serverRequest, suspendFunction ->
withContext(SpanContext()) {
suspendFunction.invoke(serverRequest)
}
}
}
cenkakin, karljohansson, limayekaiwalya, nburkley, evgenynacu and 13 more
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)theme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin supporttype: enhancementA general enhancementA general enhancement