Genesys Cloud Java SDK Connection Pool Exhaustion Under Load

Hey everyone, running into a nasty issue with the Java SDK (v4.x) in our custom agent desktop wrapper. We’re seeing java.util.concurrent.RejectedExecutionException or sometimes just silent timeouts when the app is under moderate load-say, 20-30 concurrent agents doing standard API calls for user status updates and queue stats.

The SDK uses an underlying HTTP client, likely OkHttp or Apache HttpClient, but the connection pooling seems to be misconfigured for our use case. I’ve tried to inspect the client instance via PlatformClientFactory.getDefaultPlatformClient().getHttpClient(), but the API is somewhat opaque regarding pool settings.

Here’s the rough setup I’m looking at in my initialization:

PlatformClientFactory.setDefaultClientCredentials(clientId, clientSecret, loginUrl);
PlatformClient platformClient = PlatformClientFactory.getDefaultPlatformClient();
// No explicit client config passed here

When I enable debug logging for the HTTP layer, I see connections being held open for the default keep-alive period (60s?). Under load, the thread pool for the HTTP client seems to saturate. I suspect the default maxIdleConnections or keepAlive settings aren’t aggressive enough for a desktop app that might sit idle but then burst with requests.

I’ve read about creating a custom HttpClient and injecting it, but the Java SDK docs are sparse on the exact implementation details for thread-safe configuration. Is there a recommended way to configure the connection pool size, max idle time, or connection timeout directly through the SDK’s builder pattern? Or am I supposed to bypass the SDK’s internal client entirely for high-throughput scenarios?

Any code examples for a solid, thread-safe HTTP client config that plays nice with the Genesys Cloud SDK would be massively appreciated. The current setup is just too brittle for production.