Skip to content

Prevent WebSocket buffer overflow through application-level flow control [SPR-16089] #20638

@spring-projects-issues

Description

@spring-projects-issues

ChenYang opened SPR-16089 and commented

Class ConcurrentWebSocketSessionDecorator in Spring Websocket contains

private final Queue<WebSocketMessage<?>> buffer = new LinkedBlockingQueue<>();
that represent bunch of messages that for a queue to be sent towards clients. If the field

private final int bufferSizeLimit;
exceeded, an exception is thrown and client is disconnected. I would like to be able to check this buffer size from my application in order to execute flow control and be able to prevent buffer overflow.

How I could possibly peek into this buffer?


Affects: 4.3.12

Reference URL: https://stackoverflow.com/questions/39709409/how-to-peek-into-concurrentwebsocketsessiondecorator-buffer-in-spring-websocket

Issue Links:

Referenced from: commits 268ccb6, 5809f5b, a4537b1

Backported to: 4.3.13

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions