Synchronous API with Shared HttpClient vs AsyncClient with Executor Service: Which mitigates latency under concurrent 3DS requests?
0 reputation · 26 Apr 2020, 10:01 UTC
The goal is to determine whether employing a single shared HttpClient instance with the synchronous threedsmax API or leveraging the documented AsyncClient interface with an executor service results in lower latency spikes when issuing concurrent 3DS authentication requests.
Constraints include the lack of an explicit thread‑safety guarantee for the shared HttpClient, potential contention on the same connection manager, and the risk of executor thread exhaustion when many requests are dispatched asynchronously.
Uncertainty remains about whether the library internally synchronizes access to the HttpClient during concurrent usage, and how the AsyncClient’s executor behaves under load.
- Does the threedsmax library internally synchronize access to the shared HttpClient when multiple threads issue requests?
- What is the observed impact on average response time and latency spikes when using the AsyncClient with a fixed thread pool compared to a shared HttpClient?
- Are there documented limits or recommended configurations for the AsyncClient’s executor to avoid thread exhaustion?