Skip to content

Make connection pool configurable#250

Merged
tbarbugli merged 15 commits intomainfrom
codex/configurable-connection-pool
Apr 11, 2026
Merged

Make connection pool configurable#250
tbarbugli merged 15 commits intomainfrom
codex/configurable-connection-pool

Conversation

@tbarbugli
Copy link
Copy Markdown
Member

What changed

  • exposed connection-pool configuration through the public client API with setConnectionPool(int, Duration)
  • added supported property and environment variable knobs for OkHttp pool sizing
  • updated README and DOCS examples to show how library users can configure the pool
  • added tests covering constructor-based and runtime connection-pool configuration

Why

The SDK hardcoded the OkHttp connection pool to 5 idle connections with a 59 second keep-alive. That made it impossible for library users to tune pool capacity through supported SDK options.

Impact

Users can now increase or otherwise tune the SDK client pool size without patching SDK internals.

Supported configuration:

  • io.getstream.chat.connectionPool.maxIdleConnections
  • io.getstream.chat.connectionPool.keepAliveDurationMs
  • STREAM_CHAT_CONNECTION_POOL_MAX_IDLE_CONNECTIONS
  • STREAM_CHAT_CONNECTION_POOL_KEEP_ALIVE_DURATION_MS

Validation

  • ./gradlew test --tests io.getstream.chat.java.DefaultClientConfigurationTest

@tbarbugli tbarbugli marked this pull request as ready for review April 10, 2026 16:21
@tbarbugli tbarbugli changed the title [codex] Make connection pool configurable Make connection pool configurable Apr 10, 2026
@tbarbugli tbarbugli merged commit 31442f3 into main Apr 11, 2026
1 check passed
@tbarbugli tbarbugli deleted the codex/configurable-connection-pool branch April 11, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants