Skip to content

Conversation

smartandhandsome
Copy link
Contributor

@smartandhandsome smartandhandsome commented Jul 11, 2025

Previously, even when setting spring.threads.virtual.enabled=true, HttpClient in RestClient continued to create platform threads. This meant that enabling virtual threads via configuration did not actually switch the executor as users would expect.

What has changed

  • The configuration for the ClientHttpRequestFactoryBuilder bean has been split based on the threading mode.
  • When Threading.VIRTUAL is active and the builder is a JdkClientHttpRequestFactoryBuilder, the builder is explicitly configured to use a virtual thread executor.
  • For platform threads, the previous behavior is preserved.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 11, 2025
… thread support

Signed-off-by: Sangmin Park <sangmins930@gmail.com>
…ation

Signed-off-by: Sangmin Park <sangmins930@gmail.com>
@philwebb philwebb self-assigned this Jul 21, 2025
@philwebb philwebb added the for: team-attention An issue we'd like other members of the team to review label Jul 21, 2025
@philwebb
Copy link
Member

Flagging for team attention to see if we consider this a bug or enhancement. I lean towards enhancement.

@smartandhandsome
Copy link
Contributor Author

While checking, I noticed that there is an existing related issue. I’ll attach it here so it can be referenced.

#45348

@philwebb philwebb added type: enhancement A general enhancement and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Jul 23, 2025
@philwebb philwebb added this to the 4.0.x milestone Jul 23, 2025
philwebb pushed a commit that referenced this pull request Aug 20, 2025
See gh-46404

Signed-off-by: Sangmin Park <sangmins930@gmail.com>
philwebb pushed a commit that referenced this pull request Aug 20, 2025
Update JDK HTTP Clients so that the use virtual threads when
`Threading.VIRTUAL` is active.

See gh-46404

Signed-off-by: Sangmin Park <sangmins930@gmail.com>
@philwebb philwebb closed this in dbd8ab8 Aug 20, 2025
@philwebb philwebb modified the milestones: 4.0.x, 4.0.0-M2 Aug 20, 2025
@philwebb
Copy link
Member

Thanks @smartandhandsome!

@smartandhandsome
Copy link
Contributor Author

@philwebb

Thank you so much for adding me as an author and supporting my contribution to Spring Boot! It is such an honor for me as a Spring user. Thank you again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants