Skip to content

Stomp Message Format

Addison Higham edited this page Jun 17, 2014 · 1 revision

STOMP

Real-time messages are sent using the STOMP protocol.

Before reading these docs, familiarize yourself with the STOMP protocol (here)[http://stomp.github.io/stomp-specification-1.2.html]

Connecting

Backside allows both anonymous and logged in users. To login, send the login and passcode headers. To login anonymously, don't send the login or passcode headers. If you fail to login, an ERROR frame will be sent back.

Subscribing to paths

To subscribe to paths, the SUBSCRIBE method is used. The destination header must be sent and defines the path to listen to.

The initial state will be immediately sent on subscribing. Any updates will then send.

Update message format

The message is encoded as json, for example, the following gives an example of subscribing to the root of the tree:

SUBSCRIBE
id:sub-0
destination:/


MESSAGE
destination:/
subscription:sub-0
content-length:63

{"key":"/","message":{"foo":{"value":{"bar":{"value":"foo"}}}}}

"Sending" messages

The SEND frame is used to make writes to the backside datastore. These messages are intercepted by the proxy and written to the store. The destination header gives the key to be update and the message body contains the update.

NOTE: this may need to change! we need to support removes, which would require a different message format:

SEND
destination:/hello/world
content-length:5

stuff

Other stuff

The rest of the protocol, such as unsubscribing, error handling, etc are all in accordance with the STOMP protocol

Clone this wiki locally