Stomp

Stomp

STOMP (Simple Text Oriented Messaging Protocol), formerly known as TTMP, is a lightweight, text-based messaging protocol used to communicate with message brokers such as Apache ActiveMQ, RabbitMQ, and others.

Stomp is a simple text-based protocol supported by the ActiveMQ Broker that allows communication from a variety of clients (e.g. C++, Java, .NET, Ruby, Python, etc).

It provides an interoperable wire format that allows STOMP clients to talk with any message broker supporting the protocol. It is thus language-agnostic, meaning a broker developed for one language or platform can receive communications from client software developed in another language.

STOMP Commands

The protocol is broadly similar to HTTP, and works over TCP using the following commands:

• CONNECT
• SEND
• SUBSCRIBE
• UNSUBSCRIBE
• BEGIN
• COMMIT
• ABORT
• ACK
• NACK
• DISCONNECT

Communication between client and server is through a "frame" consisting of a number of lines. The first line contains the command, followed by headers in the form : (one per line), followed by a blank line and then the body content, ending in a null character. Communication between server and client is through a MESSAGE, RECEIPT or ERROR frame with a similar format of headers and body content.

How STOMP Works

STOMP uses frames (text packets) to communicate. A basic flow:

• Client connects to broker
• Subscribes to a queue/topic
• Sends or receives messages
• Disconnects when done

Key Features of STOMP

1. Text-based protocol

Human-readable frames
Easy to debug using logs or telnet tools

2. Cross-platform support

Works with:

• Java
• JavaScript (web browsers via WebSockets)
• Python
• .NET

3. Broker-agnostic (partially)

Supported by multiple brokers:

• ActiveMQ
• RabbitMQ (via plugin)
• Apollo (older systems)

4. Lightweight design

Minimal overhead compared to enterprise protocols
Simple command structure

5. WebSocket support

STOMP can run over WebSockets, making it ideal for real-time web apps.

6. Pub/Sub and Queue support

Supports:

• Point-to-point messaging (queues)
• Publish/subscribe (topics)

Advantages of STOMP

1. Very simple

Easy to understand and implement.

2. Human-readable

Debugging is straightforward.

3. Web-friendly

Works well with WebSockets for real-time apps.

4. Multi-language support

Easy integration across different platforms.

Disadvantages of STOMP

1. Lower performance

Text-based format is less efficient than binary protocols.

2. Limited features

Does not support advanced broker-specific features directly.

3. Not always standardized behavior

Implementation can vary between brokers.

4. Less suitable for high-throughput systems

Not ideal for large-scale messaging workloads.

Contents related to 'Stomp'

OpenWire
OpenWire
Message Broker
Message Broker
Simple Object Access Protocol (SOAP)
Simple Object Access Protocol (SOAP)