Skip to content

feat: make OkHttp connection pool settings configurable#52

Closed
itsmeadi wants to merge 1 commit intomainfrom
conf
Closed

feat: make OkHttp connection pool settings configurable#52
itsmeadi wants to merge 1 commit intomainfrom
conf

Conversation

@itsmeadi
Copy link
Copy Markdown
Contributor

Summary

  • Make the OkHttp ConnectionPool parameters (max idle connections, keep-alive duration) configurable via environment variables and Java system properties, following the existing SDK configuration pattern.
  • New env vars: STREAM_CONNECTION_POOL_MAX_IDLE (default: 5), STREAM_CONNECTION_POOL_KEEP_ALIVE_SECONDS (default: 59s).
  • Corresponding system properties: io.getstream.connectionPool.maxIdleConnections, io.getstream.connectionPool.keepAliveDuration.
  • Fully backward-compatible — defaults are identical to the previously hardcoded values.

Test plan

  • Verify SDK works with no env vars set (defaults apply, same behavior as before)
  • Set STREAM_CONNECTION_POOL_MAX_IDLE=10 and confirm the pool uses 10 idle connections
  • Set STREAM_CONNECTION_POOL_KEEP_ALIVE_SECONDS=120 and confirm the keep-alive duration changes
  • Set both via Java system properties (-Dio.getstream.connectionPool.maxIdleConnections=10) and confirm they are picked up
  • Confirm env vars take priority over system properties

Made with Cursor

…m properties

Add STREAM_CONNECTION_POOL_MAX_IDLE and STREAM_CONNECTION_POOL_KEEP_ALIVE_SECONDS
env vars (with io.getstream.connectionPool.* system property fallbacks) so the
connection pool can be tuned without code changes. Defaults unchanged (5 / 59s).

Made-with: Cursor
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.

1 participant