STOMP Protocol Architecture Basics for IoT

stomp protocol
iot
message broker
architecture
middleware

This page covers the basics of the STOMP protocol architecture. STOMP, which stands for Simple Text Oriented Messaging Protocol, is a text-based protocol used with message-oriented middleware in the Internet of Things (IoT).

  • STOMP is a text-based protocol.
  • It’s designed to work with message-oriented middleware.
  • It uses an interoperable wire format.
  • This format allows clients to communicate with a message broker, enabling easy and widespread messaging interoperability. This communication is independent of the languages, platforms, and brokers used in the architecture.
  • The STOMP protocol provides a message header with properties and a frame body, similar to AMQP.
  • It’s simple and lightweight, with a wide range of language bindings, and provides some transactional semantics.

STOMP Architecture

STOMP protocol architecture

Figure: STOMP Architecture

Like other broker-based protocols, STOMP specifies a publish-subscribe mechanism. Clients subscribe to topics (similar to a path in HTTP) and receive notifications whenever messages are sent to that topic by the broker.

  • STOMP doesn’t require the use of queues and topics. Instead, it uses the “SEND” semantic with a “destination” string.
  • STOMP is a bi-directional protocol that uses textual headers similar to HTTP.
  • The broker must map the “destination” string onto something it understands internally, such as a topic, queue, or exchange.
  • Consumers subscribe to these destinations.
  • Different brokers can support different flavors of destinations, as they aren’t mandatory in the specifications. Therefore, care should be taken when porting code between different brokers, as it’s not always straightforward.

EXAMPLE: Generic broker services like RabbitMQ or ActiveMQ use STOMP/AMQP protocols to ease and scale the deployment of modern cloud services. WebSockets help use queuing protocols (e.g., STOMP/AMQP) directly from web browsers.