MQTT 5.0
MQTT 5.0 implementation with enhanced flow control, properties, and session handling.
Additional Features
- Reason Codes & User Properties
- Shared Subscriptions
- Topic Aliases
- Message Expiry
- Server Keep Alive (server-enforced)
- Receive Maximum (client/server)
- Enhanced Session Expiry
Quick Start
protocols:
mqtt:
version: "5.0"
port: 1883
Configuration (5.0)
Fields below map to
MqttConfigDTO
andMqttV5ConfigDTO
.
Field | Type | Default | Description |
---|---|---|---|
maximumSessionExpiry | long (s) | 86400 | Max session expiry the server will accept from clients. |
maximumBufferSize | long (bytes) | 10485760 | Max per-connection buffer before backpressure. |
serverReceiveMaximum | int | 10 | Server’s Receive Maximum (limits in-flight QoS>0 publishes to the server). |
clientReceiveMaximum | int | 65535 | Maximum Receive Maximum advertised to clients (limits in-flight QoS>0 publishes to the client). |
clientMaximumTopicAlias | int | 32767 | Max topic aliases a client may use (client→server). |
serverMaximumTopicAlias | int | 0 | Max topic aliases the server will use (server→client). |
strictClientId | boolean | false | Enforce strict client ID validation. |
minServerKeepAlive | int (s) | 0 | Minimum server keep-alive interval enforced on clients. |
maxServerKeepAlive | int (s) | 60 | Maximum server keep-alive interval enforced on clients. |
Example with flow-control & aliases
protocols:
mqtt:
version: "5.0"
port: 1883
maximumBufferSize: 2097152 # 2 MiB
maximumSessionExpiry: 604800 # 7 days
serverReceiveMaximum: 50
clientReceiveMaximum: 1000
clientMaximumTopicAlias: 256
serverMaximumTopicAlias: 32
minServerKeepAlive: 10
maxServerKeepAlive: 120
strictClientId: true
Shared Subscriptions
MAPS fully supports shared subscriptions as defined in the MQTT 5 specification (§4.8).
This allows multiple clients in the same subscription group to share the load of receiving messages from a topic.
- Syntax:
$share/{group}/{topic}
{group}
is the name of the subscription group.{topic}
is the normal MQTT topic filter.
Example
If two clients subscribe to:
$share/analytics/sensors/temperature
then MAPS will balance delivery across the clients in the analytics
group — each message is delivered to only one client in the group, rather than broadcasting to all subscribers.
This is useful for load-balancing consumers (e.g., analytics workers, stream processors).