Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set max frame length in ReactorNettyWebSocketClient #22268

Closed
benitocm opened this issue Jan 16, 2019 · 4 comments
Closed

Ability to set max frame length in ReactorNettyWebSocketClient #22268

benitocm opened this issue Jan 16, 2019 · 4 comments
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: superseded An issue that has been superseded by another type: enhancement A general enhancement

Comments

@benitocm
Copy link

Hi,

We are obtaining this exception Max frame length of 65536 has been exceeded in a ReactorNettyWebSocketClient that receive a big payload. Having a look to the code, it seems that all is ready for having this feature in the client side but the websocket method without the additional params is being called instead of the one that provides a parameter for the max frame length is provided. In summary, currently this is being used https://github.com/spring-projects/spring-framework/blob/master/spring-webflux/src/main/java/org/springframework/web/reactive/socket/client/ReactorNettyWebSocketClient.java#L84
but this should be used:
https://github.com/reactor/reactor-netty/blob/master/src/main/java/reactor/netty/http/client/HttpClient.java#L888

The versions that we are using are the following:
Spring Boot 2.1.1 with Netty
Reactor Netty 0.8.3

@philwebb philwebb transferred this issue from spring-projects/spring-boot Jan 16, 2019
@bclozel bclozel added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 17, 2019
@sdeleuze sdeleuze self-assigned this Jan 18, 2019
@sdeleuze
Copy link
Contributor

@rstoyanchev What do you think of adding default int getMaxFramePayloadLength() to WebSocketHandler that would return 65536 and allow customization if needed?

@sdeleuze sdeleuze removed their assignment Jan 18, 2019
@rstoyanchev
Copy link
Contributor

This is already supported on the server side:

return reactorResponse.sendWebsocket(subProtocol, this.maxFramePayloadLength,
(in, out) -> {
ReactorNettyWebSocketSession session =
new ReactorNettyWebSocketSession(
in, out, handshakeInfo, bufferFactory, this.maxFramePayloadLength);
return handler.handle(session);
});

A similar property on ReactorNettyWebSocketClient makes sense. Notice that it's also passed into the session which uses it for frame aggregation, so it should be passed there too, in addition to the sendWebSocket method call.

@rstoyanchev rstoyanchev added this to the 5.2 RC1 milestone Jan 18, 2019
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 18, 2019
@rstoyanchev rstoyanchev changed the title Max frame length of 65536 has been exceeded in ReactorNettyWebSocketClient (client side) Ability to set max frame length in ReactorNettyWebSocketClient Jan 31, 2019
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Feb 8, 2019

This is superseded by #22367.

@rstoyanchev rstoyanchev removed this from the 5.2 M1 milestone Feb 8, 2019
@rstoyanchev rstoyanchev added the status: superseded An issue that has been superseded by another label Feb 8, 2019
@philsttr
Copy link

#22367

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: superseded An issue that has been superseded by another type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

5 participants