BufferingStompDecoder message buffer size limit can now be configured
with JavaConfig MessageBrokerRegistry.setMessageBufferSizeLimit() or
with XML <websocket:message-brocker message-buffer-size="">.
Issue: SPR-11527
pull/496/head
Sebastien Deleuze12 years agocommitted byRossen Stoyanchev
@ -57,7 +58,8 @@ public class WebMvcStompEndpointRegistry implements StompEndpointRegistry {
@@ -57,7 +58,8 @@ public class WebMvcStompEndpointRegistry implements StompEndpointRegistry {
@ -67,6 +69,9 @@ public class WebMvcStompEndpointRegistry implements StompEndpointRegistry {
@@ -67,6 +69,9 @@ public class WebMvcStompEndpointRegistry implements StompEndpointRegistry {
@ -42,7 +42,8 @@ public abstract class WebSocketMessageBrokerConfigurationSupport extends Abstrac
@@ -42,7 +42,8 @@ public abstract class WebSocketMessageBrokerConfigurationSupport extends Abstrac
@ -79,16 +79,16 @@ public class StompSubProtocolHandler implements SubProtocolHandler {
@@ -79,16 +79,16 @@ public class StompSubProtocolHandler implements SubProtocolHandler {
@ -104,6 +108,18 @@ public class WebSocketMessageBrokerConfigurationSupportTests {
@@ -104,6 +108,18 @@ public class WebSocketMessageBrokerConfigurationSupportTests {
@ -133,6 +149,11 @@ public class WebSocketMessageBrokerConfigurationSupportTests {
@@ -133,6 +149,11 @@ public class WebSocketMessageBrokerConfigurationSupportTests {
@ -62,6 +62,12 @@ public class TestWebSocketSession implements WebSocketSession {
@@ -62,6 +62,12 @@ public class TestWebSocketSession implements WebSocketSession {
@ -37563,7 +37563,8 @@ The Spring Framework provides support for using STOMP over WebSocket through
@@ -37563,7 +37563,8 @@ The Spring Framework provides support for using STOMP over WebSocket through
the +spring-messaging+ and +spring-websocket+ modules. It's easy to enable it.
Here is an example of configuring a STOMP WebSocket endpoint with SockJS fallback
options. The endpoint is available for clients to connect to at URL path `/portfolio`:
options. The endpoint is available for clients to connect to at URL path `/app/portfolio`.
It is configured with a 1 Mbytes message buffer size limit (64 Kbytes by default):
[source,java,indent=0]
[subs="verbatim,quotes"]
@ -37575,6 +37576,13 @@ options. The endpoint is available for clients to connect to at URL path `/portf
@@ -37575,6 +37576,13 @@ options. The endpoint is available for clients to connect to at URL path `/portf
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.setApplicationDestinationPrefixes("/app")
.setMessageBufferSizeLimit(1024*1024)
.enableSimpleBroker("/queue", "/topic");
}
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/portfolio").withSockJS();
@ -37599,10 +37607,11 @@ XML configuration equivalent:
@@ -37599,10 +37607,11 @@ XML configuration equivalent: