Conditions to auto-configure RestClient-based HTTP service clients are outdated with the modularization#48274
Closed
Nhahan wants to merge 3 commits intospring-projects:mainfrom
Closed
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
Member
|
See #44952 where we relaxed things in 3.5 for |
snicoll
pushed a commit
that referenced
this pull request
Nov 27, 2025
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>
snicoll
added a commit
that referenced
this pull request
Nov 27, 2025
Member
|
@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. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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