pjfanning opened a new pull request, #1909:
URL: https://github.com/apache/pekko-connectors/pull/1909
### Motivation
The default connection-pool-settings builder discarded the `AttributeMap`
entirely (`(c, _) => c`), so SDK options such as `CONNECTION_TIMEOUT` and
`MAX_CONNECTIONS` configured on the SDK client silently did nothing unless the
caller opted in via `withConnectionPoolSettingsBuilderFromAttributeMap()`. That
violates the `SdkAsyncHttpClient.Builder.buildWithDefaults` contract, which
expects the service defaults to be applied.
### Modification
- When neither explicit `ConnectionPoolSettings` nor a custom settings
builder is provided, `buildWithDefaults` now applies the SDK's resolved options
(`CONNECTION_TIMEOUT`, `CONNECTION_MAX_IDLE_TIMEOUT`, `MAX_CONNECTIONS`,
`CONNECTION_TIME_TO_LIVE`) on top of the config-based settings.
- Explicitly provided `ConnectionPoolSettings` are still used untouched, and
a custom builder still wins.
- The default builder function is a shared sentinel value, so the case class
shape (apply/copy signatures) is unchanged for binary compatibility.
- New scaladoc on the builder documents the mapping and notes that
`READ_TIMEOUT`, `WRITE_TIMEOUT` and `CONNECTION_ACQUIRE_TIMEOUT` have no Pekko
HTTP equivalent and are ignored.
### Result
SDK-configured HTTP options take effect by default. Note this is a
deliberate behavior change for clients built without explicit settings:
pekko-http config defaults (e.g. `max-connections=4`, `connecting-timeout=10s`)
are now overridden by the SDK's resolved defaults (e.g. 50 connections, 2s
connect timeout), matching how the SDK's own HTTP clients behave. Users passing
explicit `ConnectionPoolSettings` see no change.
### Tests
- `sbt "aws-spi-pekko-http/Test/testOnly
org.apache.pekko.stream.connectors.awsspi.PekkoHttpClientSpec"` — 13 passed;
the two directional tests ("build() should apply SDK GLOBAL_HTTP_DEFAULTS by
default", "buildWithDefaults() should propagate configuration options without
explicit opt-in") fail without the fix (verified by reverting the main source),
and a new test pins that explicit settings stay untouched
- `sbt "aws-spi-pekko-http/Test/testOnly ...PekkoHttpClientH1TestSuite
...RequestRunnerSpec"` — 8 passed
- `sbt "aws-spi-pekko-http/mimaReportBinaryIssues"` — no issues
- `scalafmt --mode diff-ref=origin/main` — clean; no Java files changed, no
new files (no header changes needed)
### References
None - found during a review of the aws-spi-pekko-http client
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]