-
Notifications
You must be signed in to change notification settings - Fork 38.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagate CoroutineContext
to the CoExchangeFilterFunction
#34555
Conversation
...src/main/kotlin/org/springframework/web/reactive/function/client/CoExchangeFilterFunction.kt
Show resolved
Hide resolved
...webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nicely done
...flux/src/main/kotlin/org/springframework/web/reactive/function/client/WebClientExtensions.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for refining the PR, please check my latest additional feedback.
...flux/src/main/kotlin/org/springframework/web/reactive/function/client/WebClientExtensions.kt
Outdated
Show resolved
Hide resolved
...flux/src/main/kotlin/org/springframework/web/reactive/function/client/WebClientExtensions.kt
Outdated
Show resolved
Hide resolved
...flux/src/main/kotlin/org/springframework/web/reactive/function/client/WebClientExtensions.kt
Outdated
Show resolved
Hide resolved
This commit introduces a new ResponseSpec.awaitEntityOrNull() extension function to replace ResponseSpec.toEntity(...).awaitFirstOrNull() and pass the CoroutineContext to the CoExchangeFilterFunction. CoroutineContext propagation is implemented via ReactorContext and ClientRequest attribute. See spring-projectsgh-32148 Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for taking in account the feedback, I will merge it shortly.
@sdeleuze Thanks for your feedback and guidance, I really appreciate it. |
This PR introduces a new
WebClient.ResponseSpec.awaitEntityOrNull()
extension function to replaceWebClient.ResponseSpec.toEntity(...).awaitFirstOrNull()
and pass theCoroutineContext
from the outer scope to theCoExchangeFilterFunction#filter
method.CoroutineContext
propagation is implemented viaReactorContext
andClientRequest
attribute.Any feedback is more than welcome.
Fixes #32148