Sending too much data over websocket?
I think I'm having issues sending too much data over a socket.io
connection. I'm subscribing to a RabbitMQ exchange and sending data
messages to the client for graphing real-time:
q.subscribe({routingKeyInPayload:true},function (message) {
socket.emit('message', {
key: message._routingKey,
//msg: decodeURIComponent(message.data),
client: qName,
ts: new Date()
});
console.log('broadcasting: ' + message._routingKey);
});
You can see that "msg" is commented out. When I comment this out, I am
able to send ~100-200 messages/second (~800/s peak). However, when the
"msg" is included in the JSON data, I get the following error:
events.js:72
throw er; // Unhandled 'error' event
I'm not sure what the error actually is or how to handle it. Any advice
would be appreciated.
EDIT: A typical message looks like (I've sanitized the userid's just in
case):
{"key":"message.1","client":"7raQ6vpCO-PZ5ZTWQVD9","ts":"2013-09-12T22:19:06.677Z"}]}
{"fromuserid": 62XXXX34, "deleted": 0, "messagetype": 1, "datetime":
1379024283000, "touserid": 12XXXX41, "message": "Bored lol, really bored
lol", "id": 27963323859}
No comments:
Post a Comment