小编典典

Spring Boot Stomp WebSocket

spring-boot

我似乎遇到了一个问题,那就是嵌入式tomcat对脚踩websocket消息的8k大小限制。

从服务器向客户端发送消息时,出现以下错误。根据我阅读的文档,tomcat跨Websocket传递的消息似乎限制为8k,但我也读到Stomp可以发送部分消息,并让客户端重新组合它们,这似乎没有发生。

消息永远不会到达客户端处理程序,因此我很确定问题出在我的WebSocketConfig中,但是无论我尝试使用什么参数,似乎都无法超过A)8k消息和/或B的大小限制)(如果超出缓冲区限制),则以部分消息块的形式发送。

双方都有以下错误代码

[code=1009, reason=The decoded text message was too big for the output buffer and the endpoint does not support partial messages]

我很确定我错过了一些简单的事情,但是似乎无法动弹。任何额外的眼睛将不胜感激。谢谢!

服务器端Stomp WebSocket配置

@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig extends AbstractWebSocketMessageBrokerConfigurer {


private static final Logger logger = LoggerFactory.getLogger(WebSocketConfig.class);



@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
    config.enableSimpleBroker(
            "/resp",
            "/not", 
            "/sub"
        );
    config.setApplicationDestinationPrefixes("/admin");
    config.setUserDestinationPrefix("/admin");

}


@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
    RequestUpgradeStrategy upgradeStrategy = new TomcatRequestUpgradeStrategy();
    registry.addEndpoint("/cmd",
                        "/connect")
                        .setHandshakeHandler(new DefaultHandshakeHandler(upgradeStrategy))
                        .setAllowedOrigins("*")
                        .withSockJS();




}

@Override
public boolean configureMessageConverters(List<MessageConverter> messageConverters) {
    messageConverters.add(new org.springframework.messaging.converter.StringMessageConverter());
    return true;
}


@Override
public void configureWebSocketTransport(WebSocketTransportRegistration registration) {
    registration.setSendTimeLimit(15*1000);
    registration.setMessageSizeLimit(16*1024);
    registration.setSendBufferSizeLimit(16*1024);


}

@Bean
public ServletServerContainerFactoryBean createServletServerContainerFactoryBean() {
    ServletServerContainerFactoryBean container = new ServletServerContainerFactoryBean();

    container.setMaxTextMessageBufferSize(16*1024);
    container.setMaxBinaryMessageBufferSize(16*1024);
    logger.info("Websocket factory returned");
    ContainerProvider.getWebSocketContainer().setDefaultMaxTextMessageBufferSize(20*1024);
    return container;
}

}

服务器端跟踪消息

2016-01-27 18:20:54.342 DEBUG 3358 --- [clientInboundChannel-13] o.s.m.s.b.SimpleBrokerMessageHandler     : Processing MESSAGE destination=/sub/user-user5e1cc9e1c97a450180ed6ad41d575a33 session=5e1cc9e1c97a450180ed6ad41d575a33 user=core payload={"headers":{"deviceSessionId":"67669nys","message-id":"bf8Pcpx"},"payload":"{\"t...(truncated)
2016-01-27 18:20:54.342 DEBUG 3358 --- [clientInboundChannel-13] o.s.m.s.b.SimpleBrokerMessageHandler     : Broadcasting to 1 sessions.
2016-01-27 18:20:54.342  INFO 3358 --- [clientInboundChannel-13] c.l.a.c.AdminProfileController           : Response sent: /channelList
2016-01-27 18:20:54.342 TRACE 3358 --- [clientInboundChannel-13] o.s.m.h.i.InvocableHandlerMethod         : Method [processObject] returned [null]
2016-01-27 18:20:54.342 TRACE 3358 --- [clientOutboundChannel-3] o.s.messaging.simp.stomp.StompEncoder    : Encoding STOMP MESSAGE, headers={apiVersion=[5], message-id=[bf8Pcpx], destination=[/admin/sub/user], content-type=[text/plain;charset=UTF-8], subscription=[0]}
2016-01-27 18:20:54.343 TRACE 3358 --- [clientOutboundChannel-3] s.w.s.s.t.s.WebSocketServerSockJsSession : Cancelling heartbeat in session 5e1cc9e1c97a450180ed6ad41d575a33
2016-01-27 18:20:54.346 TRACE 3358 --- [clientOutboundChannel-3] s.w.s.s.t.s.WebSocketServerSockJsSession : Preparing to write SockJsFrame content='a["MESSAGE\napiVersion:5\nmessage-id:bf8Pcpx\ndestination:/admin/sub/user\nconte...(truncated)'
2016-01-27 18:20:54.347 TRACE 3358 --- [clientOutboundChannel-3] s.w.s.s.t.s.WebSocketServerSockJsSession : Writing SockJsFrame content='a["MESSAGE\napiVersion:5\nmessage-id:bf8Pcpx\ndestination:/admin/sub/user\nconte...(truncated)'
2016-01-27 18:20:54.347 TRACE 3358 --- [clientOutboundChannel-3] o.s.w.s.adapter.NativeWebSocketSession   : Sending TextMessage payload=[a["MESSAGE..], byteCount=20097, last=true], StandardWebSocketSession[id=0, uri=/admin/connect/401/5e1cc9e1c97a450180ed6ad41d575a33/websocket]
2016-01-27 18:20:54.373 TRACE 3358 --- [clientOutboundChannel-3] s.w.s.s.t.s.WebSocketServerSockJsSession : Scheduled heartbeat in session 5e1cc9e1c97a450180ed6ad41d575a33
2016-01-27 18:20:54.373 TRACE 3358 --- [http-nio-8084-exec-6] s.w.s.s.t.s.WebSocketServerSockJsSession : Cancelling heartbeat in session 5e1cc9e1c97a450180ed6ad41d575a33
2016-01-27 18:20:54.373 DEBUG 3358 --- [http-nio-8084-exec-6] s.w.s.h.LoggingWebSocketHandlerDecorator : WebSocketServerSockJsSession[id=5e1cc9e1c97a450180ed6ad41d575a33] closed with CloseStatus[code=1009, reason=The decoded text message was too big for the output buffer and the endpoint does not support partial messages]
2016-01-27 18:20:54.373 DEBUG 3358 --- [http-nio-8084-exec-6] o.s.w.s.m.SubProtocolWebSocketHandler    : Clearing session 5e1cc9e1c97a450180ed6ad41d575a33
2016-01-27 18:20:54.374 TRACE 3358 --- [http-nio-8084-exec-6] ationConfigEmbeddedWebApplicationContext : Publishing event in org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@648c94da: SessionDisconnectEvent[sessionId=5e1cc9e1c97a450180ed6ad41d575a33, CloseStatus[code=1009, reason=The decoded text message was too big for the output buffer and the endpoint does not support partial messages]]
 2016-01-27 18:20:54.374 DEBUG 3358 --- [http-nio-8084-exec-6] o.s.b.f.s.DefaultListableBeanFactory     : Returning cached instance of singleton bean

客户端错误堆栈

2016-01-28 09:33:14.342 ERROR 810 --- [lient-AsyncIO-1] o.s.w.s.s.c.WebSocketClientSockJsSession : Transport error in WebSocketClientSockJsSession[id='c5c680b9a75e488ba7bb129f90b700e6, url=ws://localhost:8084/admin/connect]

java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: Unable to write the complete message as the WebSocket connection has been closed
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:282) ~[tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:584) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:488) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsSession.close(WsSession.java:455) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient.close(WsFrameClient.java:94) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient.access$100(WsFrameClient.java:31) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:134) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:108) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126) [na:1.8.0_45]
at sun.nio.ch.Invoker.invokeDirect(Invoker.java:157) [na:1.8.0_45]
at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553) [na:1.8.0_45]
at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:276) [na:1.8.0_45]
at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:297) [na:1.8.0_45]
at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:420) [na:1.8.0_45]
at org.apache.tomcat.websocket.AsyncChannelWrapperNonSecure.read(AsyncChannelWrapperNonSecure.java:52) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient.processSocketRead(WsFrameClient.java:79) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient.access$300(WsFrameClient.java:31) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:125) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:108) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126) [na:1.8.0_45]
at sun.nio.ch.Invoker$2.run(Invoker.java:218) [na:1.8.0_45]
at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) [na:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Unable to write the complete message as the WebSocket connection has been closed
at org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:102) ~[tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:275) ~[tomcat-embed-websocket-8.0.30.jar:8.0.30]
... 24 common frames omitted
Caused by: java.io.IOException: Unable to write the complete message as the WebSocket connection has been closed
at org.apache.tomcat.websocket.WsSession.registerFuture(WsSession.java:658) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:92) ~[tomcat-embed-websocket-8.0.30.jar:8.0.30]
... 25 common frames omitted

2016-01-28 09:33:14.343  WARN 810 --- [lient-AsyncIO-1] l.e.c.w.CustomDefaultStompSessionHandler : handleTransportError

java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: Unable to write the complete message as the WebSocket connection has been closed
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:282) ~[tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:584) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:488) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsSession.close(WsSession.java:455) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient.close(WsFrameClient.java:94) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient.access$100(WsFrameClient.java:31) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:134) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:108) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126) [na:1.8.0_45]
at sun.nio.ch.Invoker.invokeDirect(Invoker.java:157) [na:1.8.0_45]
at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553) [na:1.8.0_45]
at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:276) [na:1.8.0_45]
at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:297) [na:1.8.0_45]
at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:420) [na:1.8.0_45]
at org.apache.tomcat.websocket.AsyncChannelWrapperNonSecure.read(AsyncChannelWrapperNonSecure.java:52) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient.processSocketRead(WsFrameClient.java:79) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient.access$300(WsFrameClient.java:31) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:125) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:108) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126) [na:1.8.0_45]
at sun.nio.ch.Invoker$2.run(Invoker.java:218) [na:1.8.0_45]
at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112) [na:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_45]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Unable to write the complete message as the WebSocket connection has been closed
at org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:102) ~[tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:275) ~[tomcat-embed-websocket-8.0.30.jar:8.0.30]
... 24 common frames omitted
Caused by: java.io.IOException: Unable to write the complete message as the WebSocket connection has been closed
at org.apache.tomcat.websocket.WsSession.registerFuture(WsSession.java:658) [tomcat-embed-websocket-8.0.30.jar:8.0.30]
at org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:92) ~[tomcat-embed-websocket-8.0.30.jar:8.0.30]
... 25 common frames omitted

java.io.IOException: java.util.concurrent.ExecutionException: java.io.IOException: Unable to write the complete message as the WebSocket connection has been closed
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:282)
at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:584)
at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:488)
at org.apache.tomcat.websocket.WsSession.close(WsSession.java:455)
at org.apache.tomcat.websocket.WsFrameClient.close(WsFrameClient.java:94)
**2016-01-28 09:33:14.345 DEBUG 810 --- [lient-AsyncIO-1] o.s.w.s.s.c.WebSocketClientSockJsSession : Transport closed with CloseStatus[code=1009, reason=The decoded text message was too big for the output buffer and the endpoint does not support partial messages] in WebSocketClientSockJsSession[id='c5c680b9a75e488ba7bb129f90b700e6, url=ws://localhost.local:8084/admin/connect]**
2016-01-28 09:33:14.345 DEBUG 810 --- [lient-AsyncIO-1] o.s.m.simp.stomp.DefaultStompSession     : Connection closed session id=31d8ea85-ff24-ce54-c7cc-72352b88b493
2016-01-28 09:33:14.345  WARN 810 --- [lient-AsyncIO-1] l.e.c.w.CustomDefaultStompSessionHandler : Server disconnect
null
at org.apache.tomcat.websocket.WsFrameClient.access$100(WsFrameClient.java:31)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:134)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:108)
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
at sun.nio.ch.Invoker.invokeDirect(Invoker.java:157)
at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553)
at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:276)
at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:297)
at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:420)
at org.apache.tomcat.websocket.AsyncChannelWrapperNonSecure.read(AsyncChannelWrapperNonSecure.java:52)
at org.apache.tomcat.websocket.WsFrameClient.processSocketRead(WsFrameClient.java:79)
at org.apache.tomcat.websocket.WsFrameClient.access$300(WsFrameClient.java:31)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:125)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:108)
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
at sun.nio.ch.Invoker$2.run(Invoker.java:218)
at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.ExecutionException: java.io.IOException: Unable to write the complete message as the WebSocket connection has been closed
at org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:102)
at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:275)
... 24 more
Caused by: java.io.IOException: Unable to write the complete message as the WebSocket connection has been closed
at org.apache.tomcat.websocket.WsSession.registerFuture(WsSession.java:658)
at org.apache.tomcat.websocket.FutureToSendHandler.get(FutureToSendHandler.java:92)
... 25 more
org.springframework.messaging.simp.stomp.ConnectionLostException: Connection closed
at org.springframework.messaging.simp.stomp.DefaultStompSession.afterConnectionClosed(DefaultStompSession.java:459)
at org.springframework.web.socket.messaging.WebSocketStompClient$WebSocketTcpConnectionHandlerAdapter.afterConnectionClosed(WebSocketStompClient.java:353)
at org.springframework.web.socket.sockjs.client.AbstractClientSockJsSession.afterTransportClosed(AbstractClientSockJsSession.java:321)
at org.springframework.web.socket.sockjs.client.WebSocketTransport$ClientSockJsWebSocketHandler.afterConnectionClosed(WebSocketTransport.java:172)
at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.onClose(StandardWebSocketHandlerAdapter.java:141)
at org.apache.tomcat.websocket.WsSession.fireEndpointOnClose(WsSession.java:538)
at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:489)
at org.apache.tomcat.websocket.WsSession.close(WsSession.java:455)
at org.apache.tomcat.websocket.WsFrameClient.close(WsFrameClient.java:94)
at org.apache.tomcat.websocket.WsFrameClient.access$100(WsFrameClient.java:31)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:134)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:108)
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
at sun.nio.ch.Invoker.invokeDirect(Invoker.java:157)
at sun.nio.ch.UnixAsynchronousSocketChannelImpl.implRead(UnixAsynchronousSocketChannelImpl.java:553)
at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:276)
at sun.nio.ch.AsynchronousSocketChannelImpl.read(AsynchronousSocketChannelImpl.java:297)
at java.nio.channels.AsynchronousSocketChannel.read(AsynchronousSocketChannel.java:420)
at org.apache.tomcat.websocket.AsyncChannelWrapperNonSecure.read(AsyncChannelWrapperNonSecure.java:52)
at org.apache.tomcat.websocket.WsFrameClient.processSocketRead(WsFrameClient.java:79)
at org.apache.tomcat.websocket.WsFrameClient.access$300(WsFrameClient.java:31)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:125)
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:108)
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
at sun.nio.ch.Invoker$2.run(Invoker.java:218)
at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2016-01-28 09:33:14.346 DEBUG 810 --- [lient-AsyncIO-1] o.s.w.s.s.c.WebSocketClientSockJsSession : Closing session with CloseStatus[code=1000, reason=null] in WebSocketClientSockJsSession[id='c5c680b9a75e488ba7bb129f90b700e6, url=ws://localhost.local:8084/admin/connect]
2016-01-28 09:33:14.346 DEBUG 810 --- [lient-AsyncIO-1] o.s.w.s.s.c.WebSocketClientSockJsSession : Ignoring close (already closing or closed), current state=CLOSED

阅读 523

收藏
2020-05-30

共1个答案

小编典典

将头撞在墙上一个星期后,我发现了问题所在。我正在使用的客户端(内部spring java websocket
stomp客户端)无法进行部分消息传递,也无法使用消息缓冲区的大小进行配置。答案(解决方法)是获取内部Java
Stop客户端代码并实现我自己的版本,该版本具有可配置的消息缓冲区大小,并实现一种处理部分消息的方法。希望其他任何遇到此问题的人。

2020-05-30