Java SDK connection pool exhaustion on high-throughput webchat

How come this setting causes the pool to blow up? i’m using genesys-cloud-java v3.0.142 in a web messaging proxy that handles ~500 rps. the PoolingHttpClientConnectionManager maxTotal is set to 200, but thread dumps show hundreds of threads stuck on ConnectionPoolTimeoutException even when the API isn’t throttled.

PoolingHttpClientConnectionManager pool = new PoolingHttpClientConnectionManager();
pool.setMaxTotal(200);
pool.setDefaultMaxPerRoute(100);

is the SDK not respecting the route limits or am i missing a config flag for keep-alive?

Make sure you’re not creating a new connection manager for every request, that’s the usual culprit. The default Java SDK client initializes its own pool, so you need to inject a shared one.

Config config = new Config();
config.setHttpClientBuilder(HttpClientBuilder.create().setConnectionManager(sharedManager));
PlatformClient.setConfig(config);

Check your thread dumps for duplicate manager instances.