Skip to content

Manage HttpClient 5 versions in the root pom; close SSE responses immediately in ApacheHc5Transport - #432

Merged
jamesbognar merged 1 commit into
masterfrom
hc5-dependency-management-and-sse-close
Oct 12, 2026
Merged

jamesbognar merged 1 commit into
masterfrom
hc5-dependency-management-and-sse-close

Conversation

@jamesbognar

Copy link
Copy Markdown
Contributor

Salvages the independent, non-breaking pieces of #425 without changing the HttpClient 4.5 modules.

Changes

Root-pom management of HttpComponents 5 versions

  • Adds httpclient5.version (5.6.4) and httpcore5.version (5.4.3) properties.
  • Adds a root <dependencyManagement> block for httpclient5, httpclient5-cache, httpcore5 and httpcore5-h2.
  • Removes the duplicate override in juneau-integration-tests and the inline version in juneau-rest-client-apache-httpclient-50.
  • Resolved versions are unchanged. httpcore5 stays at 5.4.3, the version httpclient5 5.6.4 is built against.

ApacheHc5Transport: close SSE responses immediately

  • A graceful close() drains the entity before releasing the connection. On an open-ended text/event-stream response that drain never finishes, so TransportResponse.close() blocked until the server ended the stream.
  • SSE responses now close with CloseMode.IMMEDIATE. The failed-wiring cleanup path also uses IMMEDIATE, because a connection we're abandoning shouldn't be reused.
  • New regression test ApacheHc5Transport_Test.a04_sse_closeDoesNotWaitForStreamEnd. It fails on master, where close() blocks until the server ends the stream (about 40s), and passes with this change.

Not included from #425

  • The juneau-rest-client-apache-httpclient-45 transport stays on HttpClient 4.5. HttpClient 5 support for the NG client is already provided by juneau-rest-client-apache-httpclient-50.
  • juneau-rest-client-classic and juneau-rest-common-classic stay on HttpClient 4.5 / HttpCore 4.4, so 9.x users keep source compatibility.

Testing

  • juneau-rest-client-apache-httpclient-50: 29 tests, 0 failures.
  • Reactor mvn validate passes. juneau-integration-tests resolves the same HttpComponents 5 versions as before.

🤖 Generated with Claude Code

…SSE responses immediately in the Apache HttpClient 5 transport.

- Root pom: add httpclient5.version / httpcore5.version properties and a dependencyManagement block for httpclient5,
  httpclient5-cache, httpcore5 and httpcore5-h2. Drop the duplicate override in juneau-integration-tests and the
  inline version in juneau-rest-client-apache-httpclient-50. Resolved versions are unchanged (5.6.4 / 5.4.3).
- ApacheHc5Transport: a graceful close drains the entity before releasing the connection, which never completes on an
  open-ended text/event-stream response, so close() blocked until the server ended the stream. Close SSE responses
  with CloseMode.IMMEDIATE, and use IMMEDIATE on the failed-wiring cleanup path. Adds a regression test.

Salvaged from #425.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
68.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@jamesbognar
jamesbognar merged commit c85f1e6 into master Oct 12, 2026
8 of 9 checks passed
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