Builder

class Builder

Mutable builder for MqttConfig.

All properties default to the same values as the MqttConfig data class constructor. Set only the properties you want to customize.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
var authenticationData: ByteString?

Initial authentication data for enhanced auth (§3.1.2.11.10).

Link copied to clipboard

Authentication method for enhanced authentication (§4.12).

Link copied to clipboard

If true, automatically reconnect with exponential backoff on connection loss.

Link copied to clipboard

If true, the broker discards any existing session state (§3.1.2.4).

Link copied to clipboard

Client identifier sent to the broker. Empty requests broker-assigned ID.

Link copied to clipboard

Default QoS level for convenience MqttClient.publish calls.

Link copied to clipboard

Default retain flag for convenience MqttClient.publish calls.

Link copied to clipboard

Maximum interval in seconds between control packets (§3.1.2.10). Range: 0..65,535.

Link copied to clipboard

Optional MqttLogger for receiving library log output.

Link copied to clipboard

Minimum log level for messages delivered to logger.

Link copied to clipboard

Maximum MQTT packet size in bytes the client accepts (§3.1.2.11.5).

Link copied to clipboard

Maximum consecutive reconnect attempts. 0 = unlimited.

Link copied to clipboard
var password: ByteString?

Optional password as an immutable ByteString (§3.1.3.6).

Link copied to clipboard

Maximum concurrent in-flight QoS 1/2 messages. Range: 1..65,535 (§3.1.2.11.4).

Link copied to clipboard

Initial delay in milliseconds between reconnection attempts. Must be > 0.

Link copied to clipboard

Maximum delay in milliseconds between reconnection attempts.

Link copied to clipboard

If true, allows Reason String and User Properties on failure packets (§3.1.2.11.8).

Link copied to clipboard

If true, requests Response Information in CONNACK (§3.1.2.11.7).

Link copied to clipboard

Session state retention duration in seconds after disconnect (§3.1.2.11.3).

Link copied to clipboard

Maximum topic aliases the client accepts from the broker (§3.1.2.11.6).

Link copied to clipboard

Optional username for password-based authentication (§3.1.3.5).

Link copied to clipboard

Application-defined key-value pairs sent with the CONNECT packet.

Link copied to clipboard

Optional will message published on unexpected disconnect (§3.1.3.2).

Functions

Link copied to clipboard

Build the immutable MqttConfig from the current builder state.

Link copied to clipboard
fun password(value: String)

Set the password from a plain String.

Link copied to clipboard
fun will(block: WillConfig.Builder.() -> Unit)

Configure a will message using a DSL block.