-
Notifications
You must be signed in to change notification settings - Fork 41.8k
Conditions to auto-configure RestClient-based HTTP service clients are outdated with the modularization #48274
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
Conditions to auto-configure RestClient-based HTTP service clients are outdated with the modularization #48274
Conversation
Previously, HttpServiceClientAutoConfiguration used NotReactiveWebApplicationCondition, which prevented activation in reactive apps even when virtual threads were enabled. This commit updates the condition to NotReactiveWebApplicationOrVirtualThreadsExecutorEnabledCondition, allowing HTTP Service Clients to work in reactive apps when virtual threads are enabled, matching the behavior of RestClientAutoConfiguration. Closes spring-projectsgh-48273 Signed-off-by: Nhahan <kisy324@naver.com>
a599e74 to
871f4a9
Compare
Signed-off-by: Nhahan <kisy324@naver.com>
…client-virtual-threads
|
See #44952 where we relaxed things in 3.5 for |
Previously, HttpServiceClientAutoConfiguration used NotReactiveWebApplicationCondition, which prevented activation in reactive apps even when virtual threads were enabled. This commit removes the condition to follow suite with what was done in gh-48308 See gh-48274 Signed-off-by: Nhahan <kisy324@naver.com>
|
@Nhahan thanks for the PR. Looking at the duplication of the condition this made us brainstorm if it was needed at all following the modularization. We concluded that it wasn't now that the module has to be added explicitly on the classpath. I've therefore polished by removing the condition altogether. We did the same for the base RestClient auto-config in #48308. |
Fixes gh-48273
Summary
REST_CLIENT-based HTTP Service clients do not apply
spring.http.serviceclient.*properties in WebFlux applications, even whenspring.threads.virtual.enabled=true, because the current condition strictly excludes all reactive applications.Changes
HttpServiceClientAutoConfigurationto use a condition that permits reactive applications when virtual threads andapplicationTaskExecutorare enabled.NotReactiveWebApplicationOrVirtualThreadsExecutorEnabledConditionin the service package (kept in sync with the existing one inautoconfigurepackage).restClientServiceClientsApplyPropertiesWhenReactiveWithVirtualThreads().Testing
./gradlew :module:spring-boot-restclient:check./gradlew :module:spring-boot-restclient:checkFormatMain