Skip to content
Search

Streaming Text Oriented Messaging Protocol

lastmod 2023-08-11created 2023-08-111 edits

The Simple Text Oriented Messaging Protocol

STOMP (Simple (or Streaming) Text Oriented Message Protocol), formerly known as TTMP, is a simple text-based protocol designed for working with message-oriented middleware (MOM). It provides an interoperable wire format that allows STOMP clients to talk with any message broker supporting the protocol.

What is it ?

STOMP is the Simple (or Streaming) Text Oriented Messaging Protocol.

STOMP provides an interoperable wire format so that STOMP clients can communicate with any STOMP message broker to provide easy and widespread messaging interoperability among many languages, platforms and brokers.

Simple Design

STOMP is a very simple and easy to implement protocol, coming from the HTTP school of design; the server side may be hard to implement well, but it is very easy to write a client to get yourself connected. For example you can use Telnet to log in to any STOMP broker and interact with it!

Many developers have said that they managed to write a STOMP client in a couple of hours for their particular language, runtime or platform into the STOMP network. So if your favored language/runtime does not offer a good enough STOMP client, don't be afraid to write one.

Overview

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 <key>: <value> (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.

Example

SEND
destination:/queue/a
content-type:text/plain

hello queue a
^@

Implementations

These are some MOM products that support STOMP:

  • Apache ActiveMQ
  • Fuse Message Broker
  • HornetQ
  • Open Message Queue (OpenMQ)
  • RabbitMQ (message broker, has support for STOMP)
  • syslog-ng through its STOMP destination plugin

A list of implementations is also maintained on the STOMP web site.

STOMP is also supported by the [[Spring Framework] in module org.springframework:spring-websocket.

Clients

See also

Favorite site

with Spring

author Zer0 sitemap