NICE CXone Java SDK HttpClient connection pooling exhaustion under high concurrency

Does anyone know the recommended pattern for managing HttpClient lifecycle within the NICE CXone Java Platform SDK when running in a high-throughput environment? I am refactoring a legacy integration that uses the SDK to push real-time conversation transcripts to our internal data lake via a custom webhook proxy. The application runs on a Kubernetes cluster with multiple pods, each handling roughly 500 concurrent WebSocket streams. We are seeing intermittent java.net.SocketTimeoutException: Connect timed out errors specifically when polling /api/v2/webmessaging/messages for delta updates. The current implementation initializes a new PlatformClient instance per request thread, which seems to be bypassing any underlying connection pooling mechanisms. I have attempted to configure the underlying Apache HttpClient via the Configuration builder, but the SDK appears to wrap or override these settings. Here is the current initialization block:

Configuration config = Configuration.builder()
 .clientId("client-id")
 .clientSecret("secret")
 .environment(Environment.Production)
 .build();

// Attempting to inject custom connection pool
PoolingHttpClientConnectionManager pool = new PoolingHttpClientConnectionManager();
pool.setMaxTotal(200);
pool.setDefaultMaxPerRoute(50);

// How do I attach this to the PlatformClient?
PlatformClient client = PlatformClientFactory.createClient(config);

The SDK does not expose a direct method to set the connection manager. I suspect the default client is using a single-threaded or low-limit pool that exhausts quickly under load. Is there a documented way to inject a custom HttpClient or PoolingHttpClientConnectionManager into the PlatformClient instance? Alternatively, should I be using the raw REST endpoints directly for this specific high-frequency polling use case to avoid SDK overhead? Any insights on thread-safe client sharing patterns for the Java SDK would be appreciated. We are currently on SDK version 11.x.

This looks like a standard resource leak issue in the CXone SDK. The default PlatformClient constructor creates a new HttpClient instance per call if not explicitly managed, causing thread pool exhaustion under high concurrency. You need to instantiate a single static PlatformClient with a pre-configured ApacheHttpClient that uses PoolingHttpClientConnectionManager and share it across your WebSocket handlers.

// Initialize once at application startup
PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager();
connManager.setMaxTotal(200); // Adjust based on pod capacity
connManager.setDefaultMaxPerRoute(50);

CloseableHttpClient httpClient = HttpClients.custom()
 .setConnectionManager(connManager)
 .build();

// Inject the shared client into the SDK builder
PlatformClient platformClient = PlatformClientBuilder.create()
 .setHttpClient(httpClient)
 .build();