The MQTT settings section allows you to configure various aspects of MQTT protocol behavior, including message handling, session management, and quality of service settings.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/hivemq/hivemq-community-edition/llms.txt
Use this file to discover all available pages before exploring further.
Configuration Section
All MQTT settings are configured within the<mqtt> element:
Queued Messages
Configure how HiveMQ handles message queuing for disconnected clients.Configuration
Options
| Option | Type | Default | Description |
|---|---|---|---|
max-queue-size | Long | 1000 | Maximum number of queued messages per client |
strategy | Enum | discard | Strategy when queue is full: discard (drop new messages) or discard-oldest (drop oldest messages) |
Retained Messages
Enable or disable support for retained messages.true
Wildcard Subscriptions
Enable or disable wildcard subscriptions using+ and #.
true
Shared Subscriptions
Enable or disable MQTT 5 shared subscriptions.true
Quality of Service
Configure the maximum allowed QoS level.0, 1, or 2Default:
2 (exactly once delivery)
Topic Alias
Configure MQTT 5 topic alias support.Options
| Option | Type | Default | Range | Description |
|---|---|---|---|---|
enabled | Boolean | true | - | Enable topic alias feature |
max-per-client | Integer | 5 | 1-65535 | Maximum topic aliases per client |
Subscription Identifier
Enable or disable MQTT 5 subscription identifiers.true
Message Expiry
Configure maximum message expiry interval.Default:
4294967296 (effectively unlimited)Range: 0-4294967296
Session Expiry
Configure maximum session expiry interval.Default:
4294967295 (approximately 136 years)Range: 0-4294967295
Keep Alive
Configure client keep-alive settings.Options
| Option | Type | Default | Range | Description |
|---|---|---|---|---|
max-keep-alive | Integer | 65535 | 0-65535 | Maximum keep-alive in seconds |
allow-unlimited | Boolean | true | - | Allow clients to disable keep-alive (value 0) |
Packets
Configure maximum packet size.Default:
268435460 (256 MB)Range: 0-268435460
Receive Maximum
Configure the server’s receive maximum for QoS 1 and 2 flow control.10Range: 1-65535 This setting controls how many QoS 1 and QoS 2 messages the server will accept without acknowledgment.
Complete Example
Here’s a complete example with commonly configured MQTT settings:Performance Considerations
- Lower
max-queue-sizevalues reduce memory usage but may drop messages - Higher
receive-maximumvalues increase throughput but use more memory - Disabling unused features (e.g., retained messages) can improve performance
- Consider your use case when setting expiry intervals