Skip to main content

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 and MqttV5ConfigDTO.

FieldTypeDefaultDescription
maximumSessionExpirylong (s)86400Max session expiry the server will accept from clients.
maximumBufferSizelong (bytes)10485760Max per-connection buffer before backpressure.
serverReceiveMaximumint10Server’s Receive Maximum (limits in-flight QoS>0 publishes to the server).
clientReceiveMaximumint65535Maximum Receive Maximum advertised to clients (limits in-flight QoS>0 publishes to the client).
clientMaximumTopicAliasint32767Max topic aliases a client may use (client→server).
serverMaximumTopicAliasint0Max topic aliases the server will use (server→client).
strictClientIdbooleanfalseEnforce strict client ID validation.
minServerKeepAliveint (s)0Minimum server keep-alive interval enforced on clients.
maxServerKeepAliveint (s)60Maximum 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).

Diagram