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

Add configuration for WebSocket MaxFrameSize and MaxMessageSize #43435

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@ public class HttpConfiguration {
@ConfigDocSection
public ProxyConfig proxy;

/**
* WebSocket Server configuration.
*/
@ConfigDocSection
public WebsocketServerConfig websocketServer;

public int determinePort(LaunchMode launchMode) {
return launchMode == LaunchMode.TEST ? testPort : port;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,9 @@ private static HttpServerOptions createHttpServerOptions(

HttpServerOptionsUtils.applyCommonOptions(options, buildTimeConfig, httpConfiguration, websocketSubProtocols);

httpConfiguration.websocketServer.maxFrameSize.ifPresent(s -> options.setMaxWebSocketFrameSize(s));
httpConfiguration.websocketServer.maxMessageSize.ifPresent(s -> options.setMaxWebSocketMessageSize(s));

return options;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package io.quarkus.vertx.http.runtime;

import java.util.Optional;

import io.quarkus.runtime.annotations.ConfigGroup;
import io.quarkus.runtime.annotations.ConfigItem;

/**
* Configure the Vert.X HTTP Server for WebSocker Server connection.
*/
@ConfigGroup
public class WebsocketServerConfig {

/**
* The maximum amount of data that can be sent in a single frame.
*
* Messages larger than this must be broken up into continuation frames.
*
* Default 65536 (from HttpServerOptions of Vert.X HttpServerOptions)
*/
@ConfigItem
public Optional<Integer> maxFrameSize;

/**
* The maximum WebSocket message size.
*
* Default 262144 (from HttpServerOptions of Vert.X HttpServerOptions)
*/
@ConfigItem
public Optional<Integer> maxMessageSize;

}
Loading