Javascript 使用ActiveMQ最大帧大小错误Stomp Web套接字
我有一个Stomp客户端,配置为通过web套接字协议与ActiveMQ代理通信 stomp.js具有以下发送功能:Javascript 使用ActiveMQ最大帧大小错误Stomp Web套接字,javascript,websocket,jms,activemq,stomp,Javascript,Websocket,Jms,Activemq,Stomp,我有一个Stomp客户端,配置为通过web套接字协议与ActiveMQ代理通信 stomp.js具有以下发送功能: Client.prototype._transmit = function(command, headers, body) { var out; out = Frame.marshall(command, headers, body); if (typeof this.debug === "function") { this.debug(">>>
Client.prototype._transmit = function(command, headers, body) {
var out;
out = Frame.marshall(command, headers, body);
if (typeof this.debug === "function") {
this.debug(">>> " + out);
}
while (true) {
if (out.length > this.maxWebSocketFrameSize) {
this.ws.send(out.substring(0, this.maxWebSocketFrameSize));
out = out.substring(this.maxWebSocketFrameSize);
if (typeof this.debug === "function") {
this.debug("remaining = " + out.length);
}
} else {
return this.ws.send(out);
}
}
};
其中:
命令
是'SEND'
标题
是{“内容长度”:false}
而body
是一个非常长的字符串化JSON对象。(长于此.maxWebSocketFrameSize)
maxWebSocketFrameSize=16*1024代码>这是在客户端初始化时设置的
所以这个函数将我的大消息分成多个帧,并分别发送它们
stomp.js中的默认调试日志(在Chrome控制台中)
如果我在out
上设置一个断点,则根据代码,每一帧都是正确的。body
的子字符串。我不确定这是否正确,或者它是否应该被重组以拥有自己的命令等等
如果这是正确的行为,那么可能与我的ActiveMQ代理配置有关:
<transportConnector name="websocket" uri="ws://0.0.0.0:24511/>
WARN | Transport Connection to: StompSocket_721080149 failed: java.io.IOException
WARN | Exception occurred processing:
null
null
null
null
null
null
null
<transportConnector name="websocket" uri="ws://0.0.0.0:24511/>
<transportConnector name="websocket" uri="ws://0.0.0.0:24511?websocket.maxTextMessageSize=9999999"/>