- Environment: Java 17, Spring Boot 3.1
- SDK:
genesys-cloud-platform-client-javav210.1.0 - Target: GC API /api/v2/interactions/callbacks
- Issue:
java.net.SocketTimeoutExceptionafter ~5k concurrent requests
I cannot figure out why the default RestClient in the Java SDK is exhausting the connection pool despite configuring a custom OkHttpClient.Builder with maxIdleConnections(100) and a ConnectionPool(100, 5, TimeUnit.MINUTES). I’ve injected this builder into the ApiClient via setHttpClient(), and I can see the pool size staying steady in logs during low load. However, once I spin up 50 threads hitting the callback creation endpoint simultaneously, the requests start timing out with 504 Gateway Timeout from the load balancer, not GC. The SDK seems to be holding connections open longer than expected, or perhaps the thread pool backing the async calls is misconfigured. I’ve tried increasing the readTimeout to 30s, but that just delays the failure. Is there a specific configuration flag in ApiClient.Builder for connection reuse that I’m missing, or do I need to bypass the SDK’s internal OkHttpClient entirely for high-volume batch jobs?