Skip to content

Add warn logging when WebSocket message receive fails#4134

Open
fru1tworld wants to merge 1 commit intospring-cloud:mainfrom
fru1tworld:fix/1048-websocket-frame-logging
Open

Add warn logging when WebSocket message receive fails#4134
fru1tworld wants to merge 1 commit intospring-cloud:mainfrom
fru1tworld:fix/1048-websocket-frame-logging

Conversation

@fru1tworld
Copy link
Copy Markdown
Contributor

Problem

When the gateway proxies WebSocket connections and a message exceeds the max frame payload length, the connection is dropped silently with no logging even at TRACE level. This makes it difficult to diagnose WebSocket connectivity issues.

Changes

  • Added doOnError handlers to both client-to-backend and backend-to-client WebSocket message flows in WebsocketRoutingFilter
  • Logs a WARN level message with session IDs and the error cause when a receive error occurs

Fixes gh-1048

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds WARN-level logging to surface otherwise-silent WebSocket receive failures in the gateway’s WebSocket proxying path, improving diagnosability of disconnects such as oversized frames (gh-1048).

Changes:

  • Added doOnError hooks on the client→backend and backend→client receive() streams in WebsocketRoutingFilter.
  • Logs WARN with both session IDs and the exception when a receive error occurs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

When gateway proxies WebSocket connections and a message exceeds the
max frame payload length, the connection is dropped silently. Add
doOnError handlers to log a warning with session details, making it
easier to diagnose frame size issues.

Fixes spring-cloudgh-1048

Signed-off-by: fru1tworld <fruitworld.planet@gmail.com>
@fru1tworld fru1tworld force-pushed the fix/1048-websocket-frame-logging branch from 27df98f to b6feead Compare April 2, 2026 23:25
@fru1tworld
Copy link
Copy Markdown
Contributor Author

Fixed — removed the frame-size hint and left the cause to the throwable itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add logging when max frame size is exceeded

3 participants