Java Platform SDK connection pool exhaustion with high-throughput bulk operations

We are experiencing intermittent 503 Service Unavailable errors when executing bulk user provisioning scripts using the Genesys Cloud Java SDK. The environment is a standard Kubernetes deployment running a Spring Boot service that handles large-scale org imports via the CX-as-Code pipeline. The issue appears when the script attempts to create or update more than 500 users in parallel threads.

The configuration uses the default GenesysApi initialization, but we have explicitly set the connection pool size using the ApiClient builder. Here is the relevant initialization code:

ApiClient client = ApiClientBuilder.createApiClient()
 .setBasePath("https://api.mypurecloud.com")
 .setApiKey("our-client-id")
 .setApiSecret("our-client-secret")
 .setHttpClientConnectionTimeout(30000)
 .setHttpClientReadTimeout(60000)
 .setHttpClientMaxConnectionsPerRoute(20)
 .build();

GenesysApi api = new GenesysApi(client);

The error manifests as java.net.SocketTimeoutException: Read timed out followed by a 503 from the platform. We’ve verified that the rate limits are not being hit by checking the X-RateLimit-Reset headers, which remain healthy. The suspicion is that the internal Apache HttpClient pool is saturating or not releasing connections fast enough due to the blocking nature of the SDK calls within the parallel stream.

Has anyone successfully tuned the ApiClient for high-concurrency workloads? We are considering moving to a non-blocking async approach or manually managing an OkHttpClient instance and injecting it into the SDK, but the documentation is sparse on overriding the default HTTP client implementation. The current setup works fine for sequential runs but degrades rapidly under load.