Question

I'm using Vert.x and SockJS to transfer data encapsulated in messages. Is there a specification how big the SockJS/Websocket messages can be?

Was it helpful?

Solution

There isn't an explicit limit of a size of a SockJS message. But unfortunately SockJS is quite fragile and should not be used to send huge data. In ideal world you'd send control messages (latency-sensitive) over SockJS and big payloads (for throughput) using external methods - for example using an AJAX call.

On technical side you should be able to push pretty much anything over websockets transport, but on streaming and polling ones you need to be more careful. Specifically, a polling requests must be reestablished within 5 seconds, and it may be tough when all the bandwidth is occupied by sending data from the browser to the server. So, uploading large blobs is not recommended with sockjs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top