stomp / stomp-spec

STOMP Protocol Specification
http://stomp.github.io/
78 stars 30 forks source link

Stomp over WebSockets #13

Open chirino opened 14 years ago

chirino commented 14 years ago

see: http://groups.google.com/group/stomp-spec/browse_thread/thread/8812531abd8c4b12#

rstoyanchev commented 10 years ago

The spec currently "assumes a reliable 2-way streaming network protocol (such as TCP) underneath". Given that the WebSocket layer splits a TCP stream into messages, a natural question to address in the spec is whether a WebSocket message corresponds to one STOMP frame, or if it can batch multiple frames.

This STOMP client for example buffers frames and flushes them asynchronously, sometimes sending multiple frames in one WebSocket message. Seems like a reasonable optimization.

chirino commented 10 years ago

The biggest issue is that there is a maximum size to the websocket messages. So in my opinion, no they should not correspond 1 to 1. You should be able to place multiple stomp frames in one websocket message or split a stomp frame across multiple websocket messages.

rstoyanchev commented 10 years ago

The WebSocket protocol itself doesn't impose limits on the message size. Fragmentation allows messages to be of unknown size.