Running into a weird issue with the com.genesyscloud:platform-client-java SDK (v13.2.0). We’re using it to batch-process Data Action results and inject OTel spans.
The setup looks standard. We init the API client once at startup and reuse it across threads.
ApiClient apiClient = ApiClientBuilder.builder()
.withClientId(clientId)
.withClientSecret(clientSecret)
.withEnvironment(Environment.Production)
.build();
DataActionsApi dataActionsApi = new DataActionsApi(apiClient);
When load hits ~200 concurrent requests, we start seeing java.util.concurrent.RejectedExecutionException and HTTP 502s. The underlying Apache HttpClient seems to be choking. I checked the default pool settings in the SDK source. It defaults to setMaxTotal(20) and setDefaultMaxPerRoute(20).
Increasing the pool size via apiClient.getHttpClient().getConnectionPool() doesn’t seem to stick or is not the right place to hook in. Is there a recommended way to configure a custom PoolingHttpClientConnectionManager with higher limits (like 200 total) before building the API client? Or are we hitting a rate limit on the GC side that mimics pool exhaustion?
Here’s the stack trace snippet:
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@... rejected from java.util.concurrent.ThreadPoolExecutor@...
Feels like the SDK’s internal thread pool is too small for our batch processing needs. Any pointers on tuning this?