# Stomp Gateway
# Introduction
The Stomp gateway is based on the Stomp v1.2 (opens new window) and is compatible with the Stomp v1.0 and v1.1 specification.
# Quick Start
In EMQX 5.0, Stomp gateways can be configured and enabled through the Dashboard.
It can also be enabled via the HTTP API or emqx.conf, e.g:
TIP
Configuring the gateway via emqx.conf requires changes on a per-node basis, but configuring it via Dashboard or the HTTP API will take effect across the cluster.
The Stomp gateway only supports TCP and SSL type listeners, for a complete list of configurable parameters refer to: Gateway Configuration - Listeners
# Authentication
As the concept of username and password is already defined in the connection message of the Stomp protocol, it supports a variety of authenticator types, such as:
- Built-in Database Authentication
- MySQL Authentication
- MongoDB Authentication
- PostgreSQL Authentication
- Redis Authentication
- HTTP Server Authentication
- JWT Authentication
Stomp gateway uses the information in the CONNECT or STOMP message of STOMP protocol to generate the authentication fields for the client:
- Client ID: is a randomly generated string.
- Username: is the value of the
login
field in the CONNECT or STOMP message headers. - Password: The value of the
passcode
field in the CONNECT or STOMP message headers.
For example, to create a built-in database authentication for a Stomp gateway via HTTP API or emqx.conf:
Unlike the MQTT protocol, the gateway only supports the creation of an authenticator, not a list of authenticators (or an authentication chain). When no authenticator is enabled, it means that all Stomp clients are allowed to log in.
For the configuration format of other types of authenticators refer to Security - Authenticator
# Publish/Subscribe
The Stomp protocol is fully compatible with the PUB/SUB messaging model, and the Stomp gateway uses:
- The SEND message of the Stomp protocol is used as a message publishing. The topic is the
destination
field in the SEND message, the message content is the message body content of the SEND message, and the QoS is fixed to 0. - The SUBSCRIBE message of the Stomp protocol is used as a subscribing request. The topic is the
destination
field of the SUBSCRIBE message, the QoS is fixed to 0, and the wildcards defined in the MQTT protocol are supported. - The UNSUBSCRIBE message of the Stomp protocol is used as an unsubscribe request. The topic is the
destination
field in the UNSUBSCRIBE message.
There are no special authorization configurations within Stomp gateway, and its permission control for topics needs to be configured Authorization.
# User Interfaces
- Detailed configuration options: Configuration - Stomp Gateway
- Detailed HTTP APIs Description: HTTP API - Gateway
# Client libraries
← CoAP Gateway Hooks →