Interface StoredMsg

An interface representing a message that retrieved directly from JetStream.

interface StoredMsg {
    data: Uint8Array;
    header: MsgHdrs;
    seq: number;
    subject: string;
    time: Date;
    timestamp: string;
    json<T>(reviver?: ReviverFn): T;
    string(): string;
}

Properties

data: Uint8Array

The payload of the message body

header: MsgHdrs

Headers for the message

seq: number

The sequence number of the message in the Stream

subject: string

The subject the message was originally received on

time: Date

The time the message was received

timestamp: string

The raw ISO formatted date returned by the server

Methods

  • Convenience method to parse the message payload as JSON. This method will throw an exception if there's a parsing error;

    Type Parameters

    • T

    Parameters

    • Optionalreviver: ReviverFn

    Returns T

  • Convenience method to parse the message payload as string. This method may throw an exception if there's a conversion error

    Returns string