Simple (or Streaming) Text Oriented Message Protocol (STOMP), formerly known as TTMP, is a simple
text-based protocol
In computing, text-based user interfaces (TUI) (alternately terminal user interfaces, to reflect a dependence upon the properties of computer terminals and not just text), is a retronym describing a type of user interface (UI) common as an ear ...
, designed for working with
message-oriented middleware
Message-oriented middleware (MOM) is software or hardware infrastructure supporting sending and receiving messages between distributed systems. Message-oriented middleware is in contrast to streaming-oriented middleware where data is communicate ...
(MOM). It provides an interoperable
wire format that allows STOMP clients to talk with any
message broker
A message broker (also known as an integration broker or interface engine) is an intermediary computer program module that translates a message from the formal messaging protocol of the sender to the formal messaging protocol of the receiver. Mes ...
supporting the protocol.
Overview
The protocol is broadly similar to
HTTP
HTTP (Hypertext Transfer Protocol) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, wher ...
, 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
The null character is a control character with the value zero. Many character sets include a code point for a null character including Unicode (Universal Coded Character Set), ASCII (ISO/IEC 646), Baudot, ITA2 codes, the C0 control code, and EB ...
. 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
Some message-oriented middleware products support STOMP, such as::
* Apache ActiveMQ,
Fuse Message Broker
* HornetQ
* Open Message Queue (OpenMQ)
*RabbitMQ
RabbitMQ is an open-source message-broker software (sometimes called message-oriented middleware) that originally implemented the Advanced Message Queuing Protocol (AMQP) and has since been extended with a plug-in architecture to support Str ...
* syslog-ng
*Spring Framework
The Spring Framework is an application framework and inversion of control container for the Java platform. The framework's core features can be used by any Java application, but there are extensions for building web applications on top of the Ja ...
References
Internet protocols
Application layer protocols
Message-oriented middleware
{{network-stub