You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Arturo Bernal (Jira)" <ji...@apache.org> on 2025/09/01 06:47:00 UTC
[jira] [Created] (HTTPCLIENT-2394) Virtual Thread (JDK 21) support for classic CloseableHttpClient — disabled by default
Arturo Bernal created HTTPCLIENT-2394:
-----------------------------------------
Summary: Virtual Thread (JDK 21) support for classic CloseableHttpClient — disabled by default
Key: HTTPCLIENT-2394
URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2394
Project: HttpComponents HttpClient
Issue Type: New Feature
Reporter: Arturo Bernal
Add support to run the classic (blocking) HTTP transport on *JDK 21 Virtual Threads* while preserving the existing public API and error semantics. The feature is *disabled by default* and can be enabled via builder settings. An additional toggle allows running the response handler on a virtual thread as well.
*Motivation*
* Reduce platform thread usage and memory footprint under high concurrency.
* Keep the blocking I/O programming model; no migration to the async API required.
* Provide a simpler path than the Classic→Async adapter.
*Scope*
* Builder settings to enable virtual-thread execution and configure the executor.
* Optional setting to execute {{HttpClientResponseHandler}} on a virtual thread.
* Preserve current behavior for errors and closing:
** Task rejection → {{IOException("client closed", cause)}}
** Interruption → cancel task, restore interrupt flag, throw {{InterruptedIOException}}
** Execution errors → unwrap {{IOException}} / {{RuntimeException}} / {{{}Error{}}}, otherwise wrap in {{IOException}}
* Runtime activation on *JDK 21+* (feature remains inactive on older JDKs).
* Mark feature as *experimental* for one minor cycle.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org