Interface Mqtt5ClientConfig

Configuration options for mqtt5 client creation.

Hierarchy

  • Mqtt5ClientConfig

Properties

hostName: string

Host name of the MQTT server to connect to.

port: number

Network port of the MQTT server to connect to.

sessionBehavior?: ClientSessionBehavior

Controls how the MQTT5 client should behave with respect to MQTT sessions.

retryJitterMode?: RetryJitterType

Controls how the reconnect delay is modified in order to smooth out the distribution of reconnection attempt timepoints for a large set of reconnecting clients.

minReconnectDelayMs?: number

Minimum amount of time to wait to reconnect after a disconnect. Exponential backoff is performed with jitter after each connection failure.

maxReconnectDelayMs?: number

Maximum amount of time to wait to reconnect after a disconnect. Exponential backoff is performed with jitter after each connection failure.

minConnectedTimeToResetReconnectDelayMs?: number

Amount of time that must elapse with an established connection before the reconnect delay is reset to the minimum. This helps alleviate bandwidth-waste in fast reconnect cycles due to permission failures on operations.

connackTimeoutMs?: number

Time interval to wait after sending a CONNECT request for a CONNACK to arrive. If one does not arrive, the connection will be shut down.

connectProperties?: ConnectPacket

All configurable options with respect to the CONNECT packet sent by the client, including the will. These connect properties will be used for every connection attempt made by the client.

topicAliasingOptions?: TopicAliasingOptions

Additional controls for client behavior with respect to topic alias usage.

If this setting is left undefined, then topic aliasing behavior will be disabled.

Node-only

offlineQueueBehavior?: ClientOperationQueueBehavior

Controls how disconnects affect the queued and in-progress operations tracked by the client. Also controls how new operations are handled while the client is not connected. In particular, if the client is not connected, then any operation that would be failed on disconnect (according to these rules) will also be rejected.

pingTimeoutMs?: number

Time interval to wait after sending a PINGREQ for a PINGRESP to arrive. If one does not arrive, the client will close the current connection.

ackTimeoutSeconds?: number

Time interval to wait for an ack after sending a QoS 1+ PUBLISH, SUBSCRIBE, or UNSUBSCRIBE before failing the operation.

clientBootstrap?: ClientBootstrap

Client bootstrap to use. In almost all cases, this can be left undefined.

socketOptions?: SocketOptions

Controls socket properties of the underlying MQTT connections made by the client. Leave undefined to use defaults (no TCP keep alive, 10 second socket timeout).

TLS context for secure socket connections. If undefined, then a plaintext connection will be used.

websocketHandshakeTransform?: WebsocketHandshakeTransform

This callback allows a custom transformation of the HTTP request that acts as the websocket handshake. Websockets will be used if this is set to a valid transformation callback. To use websockets but not perform a transformation, just set this as a trivial completion callback. If undefined, the connection will be made with direct MQTT.

httpProxyOptions?: HttpProxyOptions

Configures (tunneling) HTTP proxy usage when establishing MQTT connections

extendedValidationAndFlowControlOptions?: ClientExtendedValidationAndFlowControl

Additional controls for client behavior with respect to operation validation and flow control; these checks go beyond the base MQTT5 spec to respect limits of specific MQTT brokers.

Generated using TypeDoc