The Simple (or Streaming) Text Oriented Messaging Protocol (STOMP) is a lightweight messaging protocol that defines a format and set of commands for interoperable message brokering. Unlike AMQP or MQTT, STOMP uses a simple text-based frame format similar to HTTP, making it easy to implement and debug across different programming languages and platforms.

This guide examines self-hosted STOMP server options, focusing on how popular message brokers implement STOMP support, and compares Apache ActiveMQ (the most mature STOMP implementation), RabbitMQ with the STOMP plugin, and Apache Artemis (the next-generation ActiveMQ successor). Understanding these options helps you choose the right messaging infrastructure for applications that require STOMP compatibility.

What is STOMP and Why Use It?

STOMP (Simple Text Oriented Messaging Protocol) provides a wire-level protocol for message-oriented middleware. Its design philosophy emphasizes simplicity — frames are text-based with headers and body content, making them human-readable and easy to implement in any language.

STOMP Use Cases

  • WebSocket-based web applications: STOMP works naturally over WebSocket connections, enabling real-time messaging in browser applications
  • Language-agnostic messaging: Any language that can open a TCP socket and send text frames can use STOMP
  • Spring Framework integration: Spring’s messaging support includes first-class STOMP protocol handling
  • IoT device communication: Lightweight text-based protocol suitable for constrained environments
  • Legacy system integration: Many older enterprise systems support STOMP natively

STOMP Frame Structure

1
2
3
4
5
6
COMMAND
header1:value1
header2:value2

Body content
^@

The ^@ character (NULL byte) terminates each frame. Common commands include SEND, SUBSCRIBE, UNSUBSCRIBE, BEGIN, COMMIT, ABORT, ACK, NACK, and DISCONNECT.

Apache ActiveMQ

Apache ActiveMQ is one of the most mature open-source message brokers and has supported STOMP since its early versions. ActiveMQ’s STOMP implementation is comprehensive, supporting all STOMP 1.2 features including heartbeats, acknowledgments, and transaction management.

Key Features

  • Full STOMP 1.2 support: Complete protocol implementation with all frame types
  • Multiple transport protocols: STOMP over TCP, WebSocket, and SSL/TLS
  • Persistent messaging: Durable subscriptions with message persistence
  • Virtual topics: STOMP-compatible virtual topic destinations
  • Message groups: Ordered message delivery within groups
  • Advisory messages: STOMP-compatible notifications for broker events
  • JMS integration: STOMP maps directly to JMS semantics

Docker Compose Configuration

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
version: "3"

services:
  activemq:
    image: rmohr/activemq:latest
    container_name: activemq
    ports:
      - "61616:61616"   # OpenWire
      - "61613:61613"   # STOMP
      - "8161:8161"     # Web Console
    environment:
      - ACTIVEMQ_ADMIN_LOGIN=admin
      - ACTIVEMQ_ADMIN_PASSWORD=admin
      - ACTIVEMQ_STOMP_TRANSPORT_ENABLED=true
    volumes:
      - activemq-data:/opt/activemq/data

volumes:
  activemq-data:

STOMP Configuration in ActiveMQ

1
2
3
4
5
6
7
8
9
<!-- activemq.xml - STOMP connector -->
<transportConnectors>
    <transportConnector name="stomp"
        uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
    <transportConnector name="stomp+nio"
        uri="stomp+nio://0.0.0.0:61614"/>
    <transportConnector name="stomp+ssl"
        uri="stomp+ssl://0.0.0.0:61615"/>
</transportConnectors>

Strengths

  • Most mature STOMP implementation with extensive testing
  • Full JMS compatibility through STOMP protocol mapping
  • Web administration console included
  • Supports virtual topics and composite destinations
  • Active community and long development history

Limitations

  • ActiveMQ Classic (5.x) is in maintenance mode; Artemis is the future
  • Higher memory footprint compared to lighter brokers
  • STOMP over WebSocket requires additional configuration

RabbitMQ with STOMP Plugin

RabbitMQ is primarily an AMQP 0-9-1 broker but includes an official STOMP plugin that provides STOMP 1.0, 1.1, and 1.2 support. This makes RabbitMQ a versatile option when you need both AMQP and STOMP compatibility in a single broker.

Key Features

  • Multi-protocol support: AMQP 0-9-1, STOMP, MQTT, and HTTP in one broker
  • Official plugin: STOMP plugin maintained by the RabbitMQ core team
  • Exchange and queue mapping: STOMP destinations map to RabbitMQ exchanges and queues
  • Management plugin integration: STOMP connections visible in the management UI
  • Plugin ecosystem: Access to RabbitMQ’s extensive plugin ecosystem
  • Clustering: Native clustering support for high availability

Docker Compose Configuration

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
version: "3"

services:
  rabbitmq:
    image: rabbitmq:3-management
    container_name: rabbitmq-stomp
    ports:
      - "5672:5672"    # AMQP
      - "61613:61613"  # STOMP
      - "15672:15672"  # Management UI
    environment:
      - RABBITMQ_DEFAULT_USER=admin
      - RABBITMQ_DEFAULT_PASS=secret
    volumes:
      - ./enabled_plugins:/etc/rabbitmq/enabled_plugins
      - rabbitmq-data:/var/lib/rabbitmq

volumes:
  rabbitmq-data:

Create enabled_plugins:

1
[rabbitmq_stomp, rabbitmq_management].

STOMP Configuration in RabbitMQ

1
2
3
4
5
6
%% rabbitmq.conf
stomp.listeners.tcp.1 = 61613
stomp.ssl_listeners.tcp.1 = 61614
stomp.default_user = guest
stomp.default_pass = guest
stomp.heartbeat = 60

Strengths

  • Single broker for multiple protocols (AMQP, STOMP, MQTT)
  • Excellent management and monitoring tools
  • Active development with frequent releases
  • Large ecosystem of plugins and integrations
  • Built-in clustering and high availability

Limitations

  • STOMP is a secondary protocol (AMQP is primary)
  • Some STOMP features are translated to AMQP semantics
  • STOMP plugin requires explicit enablement

Apache Artemis

Apache Artemis is the next-generation message broker from the Apache ActiveMQ project. It was designed from the ground up to be high-performance and multi-protocol, with native STOMP support as a first-class citizen.

Key Features

  • High performance: Asynchronous IO and journal-based persistence
  • Multi-protocol: AMQP, STOMP, MQTT, OpenWire, and HornetQ protocols
  • Clustering: Automatic cluster discovery and load balancing
  • Bridge support: Message bridging between brokers and protocols
  • Diverts: Server-side message routing without client changes
  • Embedded mode: Can run embedded within Java applications

Docker Compose Configuration

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
version: "3"

services:
  artemis:
    image: apache/activemq-artemis:latest
    container_name: artemis
    ports:
      - "61616:61616"  # Core protocol
      - "61613:61613"  # STOMP
      - "8161:8161"    # Web Console
      - "5672:5672"    # AMQP
    environment:
      - ARTEMIS_USER=admin
      - ARTEMIS_PASSWORD=admin
      - ARTEMIS_MIN_THREADS=10
      - ARTEMIS_MAX_THREADS=200
    volumes:
      - artemis-data:/var/lib/artemis-instance

volumes:
  artemis-data:

STOMP Configuration in Artemis

1
2
3
4
5
6
7
8
9
<!-- broker.xml -->
<acceptors>
    <acceptor name="stomp">
        <factory-class>org.apache.activemq.artemis.core.remoting.impl.netty.NettyAcceptorFactory</factory-class>
        <param key="host" value="0.0.0.0"/>
        <param key="port" value="61613"/>
        <param key="protocols" value="STOMP"/>
    </acceptor>
</acceptors>

Strengths

  • Modern architecture with async IO for high throughput
  • STOMP as a first-class protocol (not an add-on)
  • Active development as the successor to ActiveMQ Classic
  • Excellent clustering capabilities
  • Lower resource consumption than ActiveMQ Classic

Limitations

  • Smaller community than RabbitMQ
  • STOMP documentation less extensive than ActiveMQ Classic
  • Configuration can be complex for advanced use cases

Comparison Table

FeatureApache ActiveMQRabbitMQ + STOMPApache Artemis
STOMP Version1.0, 1.1, 1.21.0, 1.1, 1.21.0, 1.1, 1.2
Primary ProtocolOpenWire (JMS)AMQP 0-9-1Core protocol
Multi-ProtocolOpenWire, AMQP, MQTT, STOMPAMQP, STOMP, MQTT, HTTPAMQP, STOMP, MQTT, OpenWire
PersistenceKahaDB, JDBCMnesia, file-basedJournal (async IO)
ClusteringNetwork of brokersRabbitMQ clusteringAutomatic cluster discovery
Management UIWeb ConsoleManagement PluginHawtIO-based Console
Docker Imagermohr/activemqrabbitmq:3-managementapache/activemq-artemis
PerformanceModerateHighVery High
Memory FootprintHighMediumLow-Medium
WebSocket SupportYesYes (via plugin)Yes
SSL/TLSYesYesYes
HeartbeatYesYesYes
Virtual DestinationsYesVia exchange routingVia addresses/routing
Transaction SupportYesYesYes
Development StatusMaintenance modeActive developmentActive development

Choosing the Right STOMP Server

Choose Apache ActiveMQ if:

  • You need full JMS compatibility through STOMP protocol mapping
  • Your application already uses ActiveMQ and needs STOMP access
  • You want the most battle-tested STOMP implementation
  • Your team has existing ActiveMQ operational experience

Choose RabbitMQ with STOMP Plugin if:

  • You need multi-protocol support (AMQP + STOMP + MQTT) in one broker
  • You want the best management and monitoring tools in the ecosystem
  • High availability through clustering is a priority
  • Your application primarily uses AMQP but has some STOMP clients

Choose Apache Artemis if:

  • You need high-performance messaging with STOMP support
  • You want a modern, actively-developed ActiveMQ successor
  • Resource efficiency is important for your deployment
  • You need automatic clustering with minimal configuration

Security Best Practices

  1. Enable STOMP over SSL/TLS — Never transmit STOMP credentials or message content over unencrypted connections
  2. Use strong authentication — Configure broker-specific users with minimal permissions; avoid default credentials
  3. Implement destination-based access control — Restrict which queues and topics each STOMP user can access
  4. Enable heartbeat monitoring — Detect and close stale connections to prevent resource exhaustion
  5. Set frame size limits — Prevent memory exhaustion by limiting maximum STOMP frame sizes
  6. Monitor connection counts — Set maximum connection limits per user and globally

FAQ

What is the difference between STOMP and AMQP?

STOMP is a simpler, text-based protocol that focuses on basic messaging operations (send, subscribe, acknowledge). AMQP is a binary protocol with more features including exchanges, routing, and transaction management. STOMP is easier to implement and debug, while AMQP provides more sophisticated routing capabilities. RabbitMQ supports both, making it a versatile choice.

Can I use STOMP with WebSocket in the browser?

Yes. STOMP works naturally over WebSocket connections, which is one of its primary advantages. All three brokers support STOMP over WebSocket. In a browser application, you can use libraries like @stomp/stompjs or sockjs-client to connect to a STOMP-over-WebSocket endpoint and send/receive messages in real-time.

Is STOMP suitable for high-throughput messaging?

STOMP’s text-based framing introduces overhead compared to binary protocols like AMQP. For moderate message volumes (thousands per second), STOMP performance is acceptable. For very high throughput (hundreds of thousands per second), consider using AMQP or a binary protocol. Apache Artemis handles STOMP most efficiently due to its async IO architecture.

How does STOMP handle message acknowledgments?

STOMP supports two acknowledgment modes: auto (messages are automatically acknowledged upon delivery) and client (the client must explicitly send an ACK frame). For reliable message processing, use client acknowledgments so that messages are only removed from the queue after your application has successfully processed them.

Can I migrate from ActiveMQ Classic to Artemis?

Yes, Apache Artemis is designed as a drop-in replacement for ActiveMQ Classic. It supports the same OpenWire, AMQP, MQTT, and STOMP protocols. The migration path involves updating your broker configuration and testing client compatibility. Artemis provides migration tools and documentation for the transition.

Do I need a separate STOMP server, or can I add STOMP to an existing broker?

If you already run RabbitMQ or ActiveMQ, you can enable STOMP support through plugins or configuration without deploying a separate server. RabbitMQ’s STOMP plugin and ActiveMQ’s built-in STOMP transport both allow you to add STOMP access to an existing broker installation.

Why Self-Host Your STOMP Messaging Infrastructure?

Control and Customization: Self-hosted STOMP servers let you configure transport settings, security policies, and persistence behavior to match your application requirements. Cloud-hosted messaging services often restrict configuration options.

Cost Efficiency: At scale, self-hosted message brokers are more cost-effective than managed alternatives. RabbitMQ and ActiveMQ run efficiently on standard hardware, and their open-source licenses have no per-connection or per-message fees.

Protocol Flexibility: Self-hosted brokers give you the freedom to use any STOMP version (1.0, 1.1, or 1.2) and configure transport options (TCP, WebSocket, SSL) without vendor-imposed limitations.

For message queue alternatives, see our RabbitMQ vs NATS vs ActiveMQ comparison. For webhook management infrastructure, check our Svix vs Convoy vs Hook0 guide. And for API gateway observability, our Kong Vitals vs Tyk vs Gravitee article covers monitoring API traffic.