QoS

enum QoS : Enum<QoS>

Quality of Service levels for MQTT message delivery per §4.3.

QoS determines the delivery guarantee between the client and broker:

  • AT_MOST_ONCE (0): Best-effort, no acknowledgement. Messages may be lost.

  • AT_LEAST_ONCE (1): Guaranteed delivery via PUBACK. Messages may be duplicated.

  • EXACTLY_ONCE (2): Guaranteed single delivery via the 4-step PUBLISH → PUBREC → PUBREL → PUBCOMP handshake.

Higher QoS levels have higher overhead. Choose the level appropriate for your use case: telemetry data tolerates AT_MOST_ONCE, while financial transactions require EXACTLY_ONCE.

Entries

Link copied to clipboard

At most once delivery (QoS 0) — fire and forget.

Link copied to clipboard

At least once delivery (QoS 1) — acknowledged delivery.

Link copied to clipboard

Exactly once delivery (QoS 2) — assured delivery via 4-step handshake.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int
Link copied to clipboard
val value: Int

The numeric QoS level (0, 1, or 2) as encoded on the wire.

Functions

Link copied to clipboard
fun valueOf(value: String): QoS

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard
fun values(): Array<QoS>

Returns an array containing the constants of this enum type, in the order they're declared.