我的SockJs客户端在网页中发送的消息的帧大小为16K。 邮件大小限制决定了我可以传输的文件的最大大小。
以下是我在文档中找到的内容。
/**
* Configure the maximum size for an incoming sub-protocol message.
* For example a STOMP message may be received as multiple WebSocket messages
* or multiple HTTP POST requests when SockJS fallback options are in use.
*
*
In theory a WebSocket message can be almost unlimited in size.
* In practice WebSocket servers impose limits on incoming message size.
* STOMP clients for example tend to split large messages around 16K
* boundaries. Therefore a server must be able to buffer partial content
* and decode when enough data is received. Use this property to configure
* the max size of the buffer to use.
*
*
The default value is 64K (i.e. 64 * 1024).
*
*
NOTE that the current version 1.2 of the STOMP spec
* does not specifically discuss how to send STOMP messages over WebSocket.
* Version 2 of the spec will but in the mean time existing client libraries
* have already established a practice that servers must handle.
*/
public WebSocketTransportRegistration setMessageSizeLimit(int messageSizeLimit) {
this.messageSizeLimit = messageSizeLimit;
return this;
}
我的问题:我可以设置部分消息传递,以便文件被部分传输,而不像现在那样作为单个消息传输吗?
更新:仍在寻找使用部分消息传递的解决方案同时,现在对大型消息(在我的应用程序中是文件上传/下载)使用HTTP。