build
Build an MqttConfig using a lambda with named property assignments.
Example
val config = MqttConfig.build {
clientId = "sensor-hub-01"
keepAliveSeconds = 30
defaultQos = QoS.AT_LEAST_ONCE
autoReconnect = true
logger = MqttLogger.println()
logLevel = MqttLogLevel.DEBUG
will {
topic = "sensors/status"
payload("offline")
retain = true
}
}Content copied to clipboard