Improve docs on STOMP / WebSocket frame max size
Issue: SPR-17514
This commit is contained in:
@@ -1133,6 +1133,42 @@ application.
|
||||
|
||||
|
||||
|
||||
[[websocket-stomp-server-config]]
|
||||
=== WebSocket Server
|
||||
|
||||
To configure the underlying WebSocket server, the information in
|
||||
<<websocket-server-runtime-configuration>> applies. For Jetty, however you need to set
|
||||
the `HandshakeHandler` and `WebSocketPolicy` through the `StompEndpointRegistry`:
|
||||
|
||||
====
|
||||
[source,java,indent=0]
|
||||
[subs="verbatim,quotes"]
|
||||
----
|
||||
@Configuration
|
||||
@EnableWebSocketMessageBroker
|
||||
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
||||
|
||||
@Override
|
||||
public void registerStompEndpoints(StompEndpointRegistry registry) {
|
||||
registry.addEndpoint("/portfolio").setHandshakeHandler(handshakeHandler());
|
||||
}
|
||||
|
||||
@Bean
|
||||
public DefaultHandshakeHandler handshakeHandler() {
|
||||
|
||||
WebSocketPolicy policy = new WebSocketPolicy(WebSocketBehavior.SERVER);
|
||||
policy.setInputBufferSize(8192);
|
||||
policy.setIdleTimeout(600000);
|
||||
|
||||
return new DefaultHandshakeHandler(
|
||||
new JettyRequestUpgradeStrategy(new WebSocketServerFactory(policy)));
|
||||
}
|
||||
}
|
||||
----
|
||||
====
|
||||
|
||||
|
||||
|
||||
[[websocket-stomp-message-flow]]
|
||||
=== Flow of Messages
|
||||
|
||||
|
||||
Reference in New Issue
Block a user