Java SDK connection pool exhaustion in high-concurrency screen pop handler

running into a wall with the Java Platform SDK. we’ve got a custom desktop app handling screen pops, and under load the HTTP client starts choking. it’s not a timeout issue per se, more like the pool just runs dry.

here’s the setup. we’re using the default PlatformClient config but overriding the HTTP client to use Apache HttpClient 5 for better control. the pool size is set to 50, which should be plenty for our agent count, but the logs show ConnectionPoolTimeoutException spiking during peak shifts.

org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.leaseConnection(PoolingHttpClientConnectionManager.java:302)
	at org.apache.http.impl.conn.CPoolProxy.leaseConnection(CPoolProxy.java:102)

the weird part is that the requests aren’t blocking for long. they’re just failing to get a socket. i’ve checked the keep-alive settings and they match the platform docs.

is there a specific way the Genesys Cloud Java SDK manages thread safety for the underlying RestClient? i’m suspecting the SDK is holding onto connections longer than expected or there’s a race condition in how we’re instantiating the client per thread.

did i miss a config flag for async execution? or do we need to implement a custom ConnectionKeepAliveStrategy? code below for the client init.

Config config = Config.builder()
 .withClientId(clientId)
 .withClientSecret(clientSecret)
 .withHttpClientFactory(() -> {
 // custom pool config
 return HttpClients.custom()
 .setConnectionManager(poolManager)
 .build();
 })
 .build();

anyone else hit this with the Java SDK?