Skip to main content
Version: 2.14 (latest)

mqtt

Hot Reloadable
Only ack_wait, max_ack_pending, the consumer settings and the TLS certificate material reload. Changing the MQTT host, port, authorization, no_auth_user or js_domain fails the reload.

Configuration for enabling the MQTT interface.

Properties

NameDescriptionTypeDefaultReloadable
hoststring0.0.0.0No
portinteger1883No*
listenstring-No
tlsobject-Yes*
authorizationobject-No
no_auth_userIf no user name is provided when an MQTT client connects, will default this user name in the authentication phase. If specified, this will override, for MQTT clients, any no_auth_user value defined in the main configuration file. Note: that this is not compatible with running the server in operator mode.string-No
ack_waitThis is the amount of time after which a QoS 1 message sent to a client is redelivered as a DUPLICATE if the server has not received the PUBACK packet on the original Packet Identifier. will cause the server to use the default value (30 seconds). Note that changes to this option is applied only to new MQTT subscriptions.duration30sYes*
max_ack_pendingThis is the amount of QoS 1 messages the server can send to a subscription without receiving any PUBACK for those messages. The valid range is [0..65535]. The total of subscriptions' max_ack_pending on a given session cannot exceed 65535. Attempting to create a subscription that would bring the total above the limit would result in the server returning 0x80 in the SUBACK for this subscription. Due to how the NATS Server handles the MQTT # wildcard, each subscription ending with # will use 2 times the max_ack_pending value. Note that changes to this option is applied only to new subscriptions.integer100Yes*
js_domainIf specified, sets an explicit JetStream domain to be used by MQTT.string-No
consumer_memory_storageHold MQTT consumer state in memory rather than on disk.booleanfalseYes*
consumer_replicasDeprecated. The server logs a warning and ignores the value; consumer replication follows the stream.integer-Ignored*
js_api_timeoutHow long MQTT waits for a JetStream API call before giving up.duration5sNo
reject_qos2_publishReject QoS 2 publishes instead of accepting them, for clients that must not silently get weaker delivery guarantees.booleanfalseNo
downgrade_qos2_subscribeAccept a QoS 2 subscription but serve it at QoS 1.booleanfalseNo
stream_replicasIf specified, sets an explicit number of stream replicas to be used for MQTT-backed streams.integer-Yes*
consumer_inactive_thresholdSet an explicit default inactive threshold for consumers used by MQTT.duration-Yes*

* See the property page for reload caveats.