edgeport - v1.0.3
    Preparing search index...

    Interface MqttMessage

    A delivered application message, yielded by a MqttSubscription.

    1.0.0

    interface MqttMessage {
        payload: Uint8Array;
        qos: 0 | 1 | 2;
        topic: string;
        json<T = unknown>(): T;
        text(): string;
    }
    Index
    payload: Uint8Array

    The raw payload bytes.

    qos: 0 | 1 | 2

    The QoS the message was delivered at.

    topic: string

    The topic the message was published to.

    • Decodes the payload as UTF-8 then parses it as JSON.

      Type Parameters

      • T = unknown

        The expected shape of the decoded value.

      Returns T

      The parsed value.

      If the payload is not valid JSON.

      1.0.2

    • Decodes the payload as UTF-8 text.

      Returns string

      The payload as a string.

      1.0.2