Builder

class Builder

Mutable builder for WillConfig.

Provides setter properties for all will fields plus convenience methods for setting the payload from different types.

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

MIME content type of the will payload (e.g. "application/json").

Link copied to clipboard
var correlationData: ByteString?

Correlation data for request/response pattern in the will message.

Link copied to clipboard

Lifetime of the will message in seconds after publication.

Link copied to clipboard
var payloadBytes: ByteString

Payload as an immutable ByteString. Use payload methods for string/ByteArray convenience.

Link copied to clipboard

If true, the will payload is UTF-8 encoded text.

Link copied to clipboard
var qos: QoS

QoS level for the will message delivery.

Link copied to clipboard

Topic for request/response pattern in the will message.

Link copied to clipboard

If true, the broker retains the will message.

Link copied to clipboard

Topic the will message will be published to. Must not be blank.

Link copied to clipboard

Application-defined key-value pairs sent with the will message.

Link copied to clipboard

Delay in seconds before publishing the will after unexpected disconnect.

Functions

Link copied to clipboard

Build the immutable WillConfig from the current builder state.

Link copied to clipboard
fun payload(bytes: ByteArray)

Set the payload from raw bytes (copied into an immutable ByteString).

fun payload(text: String)

Set the payload from a UTF-8 string.

fun payload(byteString: ByteString)

Set the payload from an immutable ByteString.