You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow SDK consumers to supply their own java.net.http.HttpClient instance to MontonioHttpClient, enabling shared connection pools, custom proxy/TLS configuration, and other HttpClient customizations.
Background
During the design of #11, consumer-supplied HttpClient was explicitly deferred (design decision #1) to keep the initial implementation simple. The package-private constructor already accepts an HttpClient parameter for testability — this issue is about making that capability part of the public API.
Requirements
Make the MontonioHttpClient(MontonioSdkConfiguration, HttpClient) constructor public
When a consumer supplies their own HttpClient, connectTimeout from configuration is not applied (the consumer's HttpClient settings take precedence)
The single-arg constructor remains the default path, creating an internal HttpClient with configuration-based timeouts
Summary
Allow SDK consumers to supply their own
java.net.http.HttpClientinstance toMontonioHttpClient, enabling shared connection pools, custom proxy/TLS configuration, and other HttpClient customizations.Background
During the design of #11, consumer-supplied HttpClient was explicitly deferred (design decision #1) to keep the initial implementation simple. The package-private constructor already accepts an
HttpClientparameter for testability — this issue is about making that capability part of the public API.Requirements
MontonioHttpClient(MontonioSdkConfiguration, HttpClient)constructor publicHttpClient,connectTimeoutfrom configuration is not applied (the consumer's HttpClient settings take precedence)HttpClientwith configuration-based timeoutsRefs
docs/plans/2026-04-10-http-client-design.md— design decision Initial setup #1initial-docs/project2.md— "The SDK must allow the consumer to supply their own HTTP client or provide a default"Testing
HttpClientis used for requestsHttpClientwithconnectTimeout