Hi!

I have a question regarding the use of Virtual Threads.
I understand that migrating to Java 21 is impossible due to the many clients 
using older versions of Java.
I saw that in previous discussions it was mentioned that Virtual Threads can be 
useful for HTTP/2.
But what about HTTP/1.1?

We use Async Http Client in cases where it is necessary to interact with 
thousands of unstable partner systems.
Such systems can respond slowly and thus exhaust the pools of the standard http 
client and engage a huge number of threads.
Using the asynchronous http client solved our problems.

Now there is a task to switch all such interactions throughout the system to 
the asynchronous http client.
Due to the fact that the API of the synchronous and asynchronous clients is 
different, the task seems extensive.

Therefore, I would prefer not to migrate all interactions to the asynchronous 
http client,
but instead configure the standard Http client to use Virtual Threads in a 
special way.

I am not very familiar with the internal architecture of the Http Client,
but are there any extension points where Executors.newVirtualThreadExecutor 
could be used,
or some other way to benefit from virtual threads?
If this is possible, would this approach become an alternative to the 
asynchronous http client in the future?

Reply via email to