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: [email protected]
For additional commands, e-mail: [email protected]