Skip to main content
Rhombus uses STOMP 1.2 (Streaming Text Oriented Messaging Protocol) over WebSocket for real-time event delivery. This page is a protocol reference for developers who need to understand or implement the STOMP framing at a low level.

What is STOMP?

STOMP is a simple, text-based messaging protocol that provides an interoperable wire format for message brokers. It defines a small set of commands (frames) for connecting, subscribing, sending, and disconnecting. Rhombus uses STOMP because it provides structured pub/sub messaging over a standard WebSocket transport.

Frame Format

Every STOMP frame follows this structure:
  • COMMAND: A single word identifying the frame type (e.g., CONNECT, MESSAGE)
  • Headers: Zero or more key:value pairs, one per line
  • Empty line: Separates headers from body
  • Body: Optional payload (typically JSON for MESSAGE frames)
  • Null byte (\x00): Terminates every frame

Example: Raw CONNECT Frame

Client-to-Server Frames

CONNECT

Initiates the STOMP session after the WebSocket connection is open.

SUBSCRIBE

Subscribes to a destination topic to receive messages.
The subscription id is client-defined. Use any unique string. If you create multiple subscriptions, each must have a distinct id.

DISCONNECT

Signals an intentional, clean disconnection.
No headers or body are required. After sending DISCONNECT, close the underlying WebSocket connection.

Server-to-Client Frames

CONNECTED

Sent by the server in response to a successful CONNECT.

MESSAGE

Delivers an event from a subscribed topic.
The body is always a JSON object containing the event payload.

Heartbeats

Heartbeats keep the connection alive and detect failures. They are negotiated during the CONNECT/CONNECTED exchange.

Format

A heartbeat is a single newline character:
No command, no headers, no null terminator. Just \n.

Negotiation

The heart-beat header uses the format cx,cy where:
  • cx = minimum interval (ms) at which the client can send heartbeats
  • cy = desired interval (ms) at which the client wants to receive heartbeats
The Rhombus server uses 10000,10000 (10 seconds both directions).

Behavior

Implementation

Frame Parsing Guide

Step-by-Step Parsing Algorithm

Edge Cases

Complete Frame Exchange

Here is the full frame sequence for a typical session:

Differences from Full STOMP 1.2

The Rhombus implementation uses a subset of STOMP 1.2. Notable differences: This means you do not need a full STOMP client library. The protocol subset is simple enough to implement manually, as shown in the Code Examples.
Last modified on July 8, 2026