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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With