Skip to content

Add symphony-bdk-http-jdk: a java.net.http.HttpClient-based ApiClient transport - #894

Merged
thibauult merged 4 commits into
finos:nextfrom
thibauult:jdk-httpclient-transport
Aug 12, 2026
Merged

Add symphony-bdk-http-jdk: a java.net.http.HttpClient-based ApiClient transport#894
thibauult merged 4 commits into
finos:nextfrom
thibauult:jdk-httpclient-transport

Conversation

@thibauult

Copy link
Copy Markdown
Member

Summary

Implements the OpenSpec change jdk-httpclient-transport:

  • New module symphony-bdk-http/symphony-bdk-http-jdk, an ApiClient/ApiClientBuilder/ApiClientBuilderProvider implementation built directly on java.net.http.HttpClient (JDK 11+), with zero third-party HTTP dependencies.
  • Full behavioral parity with symphony-bdk-http-jersey where the shared contract requires it: query/form/multipart encoding (hand-rolled multipart, since HttpClient has no built-in support), JSON serialization parity, X-Trace-Id propagation, file-download responses, TLS client certs, HTTP proxy + proxy auth, outgoing request logging, and exception translation into the root-cause types RetryWithRecoveryBuilder's retry predicate already recognizes (ConnectException, SocketTimeoutException).
  • Two documented, deliberate semantic gaps vs. jersey2: read-timeout is approximated via the per-request total timeout (no distinct socket/read timeout in HttpClient), and addFilter only accepts request-mutating Function<HttpRequest.Builder, HttpRequest.Builder> (no response-filter chain).
  • SPI registration via the same ServiceLoader mechanism (META-INF/services/...ApiClientBuilderProvider).
  • symphony-bdk-http-jdk becomes the new documented default for symphony-bdk-core (docs/getting-started.md, docs/tech/architecture.md, docs/migration-4.x.md), shipped @API(EXPERIMENTAL) given the hand-rolled multipart encoder is the highest-risk, least battle-tested piece.
  • symphony-bdk-http-jersey's public classes (ApiClientJersey2, ApiClientBuilderJersey2, ApiClientBuilderProviderJersey2) move from @API(STABLE)/@API(INTERNAL) to @API(DEPRECATED) — a soft, non-removing signal with javadoc pointing at the replacement. The module keeps shipping, keeps its ServiceLoader registration, and gets no functional changes.
  • OpenSpec change archived to openspec/changes/archive/2026-08-12-jdk-httpclient-transport, capability spec promoted to openspec/specs/jdk-http-transport/spec.md.

Not breaking: additive module + soft deprecation only. No changes to symphony-bdk-http-api's contract, generated code, or existing published artifacts.

Test plan

  • ./gradlew :symphony-bdk-http:symphony-bdk-http-jdk:build — unit + MockServer-backed integration tests (multipart round-trip, mTLS, proxy, proxy auth, exception translation, trace-id propagation, JSON parity, file download)
  • ./gradlew :symphony-bdk-http:symphony-bdk-http-jdk:spiConflictTest — dedicated source set asserting ServiceLookup.lookupSingleService throws IllegalStateException when jersey2 is also present
  • ./gradlew :symphony-bdk-http:symphony-bdk-http-jdk:jacocoTestCoverageVerification — passes at the same 90% per-class bar symphony-bdk-http-webclient enforces
  • ./gradlew :symphony-bdk-http:symphony-bdk-http-jersey:build — confirms the deprecation annotation change is source-compatible, no behavioral change
  • ./gradlew build (full repo) — no regressions
  • ./gradlew :symphony-bdk-http:symphony-bdk-http-jdk:dependencies — confirmed no Jersey/Apache-HttpClient/Reactor-Netty/jjwt/BouncyCastle transitive dependency

thibauult and others added 4 commits August 12, 2026 11:54
…nos#893)

* Propose OpenSpec change: JDK HttpClient-based ApiClient transport

Adds a third symphony-bdk-http implementation on top of java.net.http.HttpClient,
giving consumers a zero-third-party-dependency alternative to jersey2/webclient.

* Deprecate jersey2's default status in favor of symphony-bdk-http-jdk (D12)

symphony-bdk-http-jersey2 carries the largest dependency/CVE surface for a
filter-chain benefit nothing in the codebase uses. Make the new jdk module
the documented default for symphony-bdk-core and mark jersey2's public
classes @API(DEPRECATED) as a soft, non-removing signal — no functional
change, no forced migration.
…iClient

Implements the OpenSpec change jdk-httpclient-transport: a third ApiClient
implementation with zero third-party HTTP dependencies, becoming the new
documented default for symphony-bdk-core. symphony-bdk-http-jersey is
deprecated (soft, non-removing @API status change) in that role but keeps
shipping unchanged.
- Document ClassCastException risk in addFilter due to generics erasure
- Wrap InvalidPathException from file.toPath() in ApiException for multipart uploads
- Normalize slashes between basePath and path when building request URIs
@thibauult
thibauult merged commit 88bc14d into finos:next Aug 12, 2026
2 checks passed
@thibauult
thibauult deleted the jdk-httpclient-transport branch August 12, 2026 11:15
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