phil
phil

Reputation: 1437

What is the maximal size for SockJS messages?

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?

Upvotes: 6

Views: 2286

Answers (1)

Marek
Marek

Reputation: 3509

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.

Upvotes: 7

Related Questions