Skip to content

Add a JDK HttpClient WebSocket client for WebFlux - #37260

Open
goutamadwant wants to merge 1 commit into
spring-projects:mainfrom
goutamadwant:gh-21016
Open

Add a JDK HttpClient WebSocket client for WebFlux#37260
goutamadwant wants to merge 1 commit into
spring-projects:mainfrom
goutamadwant:gh-21016

Conversation

@goutamadwant

Copy link
Copy Markdown

Closes #21016.

Add JdkWebSocketClient and its session adapter so WebFlux applications can
use the JDK HttpClient without an additional WebSocket client library.

The adapter maps reactive demand to native callbacks, bounds incoming fragment
aggregation, and serializes outgoing messages. Tests cover handshake ordering,
cancellation, close and error handling, and pooled-buffer ownership. The existing
client/server integration matrix now includes the JDK client and binary echo.

Document configuration and JDK API constraints, including unavailable successful
handshake response headers and demand-driven remote close notifications.

Validation: :spring-webflux:check and :spring-webflux:javadoc passed with
--no-build-cache --rerun-tasks. The module suite reported 2,596 passed,
9 skipped, and no failures, including all 147 focused client, session, and
integration tests. ./gradlew antora also passed, with the updated local
documentation verified in the rendered output.

Implement reactive JDK WebSocket sessions with bounded incoming
messages, demand-driven callbacks, and cancellation cleanup.

Cover client and session lifecycle behavior and extend the shared
WebSocket integration tests and reference documentation.

Closes spring-projectsgh-21016

Signed-off-by: Goutam Adwant <workwithgoutam@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Sep 9, 2026
@bclozel bclozel added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: web Issues in web modules (web, webmvc, webflux, websocket) status: waiting-for-triage An issue we've not yet triaged or decided on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JDK HttpClient WebSocket integration with WebSocketClient [SPR-16471]

3 participants