Spring启动 - Websocket缓冲区大小限制

时间:2017-08-21 13:31:24

标签: java spring websocket

我试图增加我的WebSocket的缓冲区大小,但我无法做到这一点。当我通过65536发送消息时,我得到了:

org.springframework.messaging.simp.stomp.StompConversionException:' content-length'标头447721超出配置的消息缓冲区大小限制65536

这是我的WebSocekt配置文件:

@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {



    @Override
    public void configureMessageBroker(MessageBrokerRegistry config) {
        config.enableSimpleBroker("/queue", "/topic");
        config.setApplicationDestinationPrefixes("/app");
    }

    @Override
    public void registerStompEndpoints(StompEndpointRegistry registry) {
        registry.addEndpoint("/gs-guide-websocket").setAllowedOrigins("*").withSockJS();
    }

}

我应该在代码中添加什么?

0 个答案:

没有答案