Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LiftbridgeMessage

Liftbridge message subclass.

Includes some helpful methods to convert to/from native JSON objects to Liftbridge gRPC objects.

Hierarchy

  • Message
    • LiftbridgeMessage

Index

Type aliases

Static AsObject

AsObject: object

Type declaration

  • ackinbox: string
  • ackpolicy: 0 | 1 | 2
  • correlationid: string
  • headersMap: Array<[string, Uint8Array | string]>
  • key: Uint8Array | string
  • offset: string
  • reply: string
  • subject: string
  • timestamp: string
  • value: Uint8Array | string

Constructors

constructor

  • Creates a Message object that is a representation of the gRPC Message object.

    Parameters

    Returns LiftbridgeMessage

    Message object (with some extra helpful methods).

Properties

correlationId

correlationId: string = hyperId().uuid

partition

partition: number | undefined = undefined

partitionStrategy

partitionStrategy: keyof BuiltinPartitioners | PartitionerLike | undefined = "key"

Static extensions

extensions: object

Type declaration

  • [key: number]: jspb.ExtensionFieldInfo<jspb.Message>

Static extensionsBinary

extensionsBinary: object

Type declaration

  • [key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>

Methods

clearHeadersMap

  • clearHeadersMap(): void

getAckinbox

  • getAckinbox(): string

getAckpolicy

  • getAckpolicy(): 0 | 1 | 2

getCorrelationid

  • getCorrelationid(): string

getHeadersMap

  • getHeadersMap(): jspb.Map<string, Uint8Array | string>

getKey

  • getKey(): Uint8Array | string

getKey_asB64

  • getKey_asB64(): string

getKey_asU8

  • getKey_asU8(): Uint8Array

getOffset

  • getOffset(): string

getReply

  • getReply(): string

getSubject

  • getSubject(): string

getTimestamp

  • getTimestamp(): string

getValue

  • getValue(): Uint8Array | string

getValue_asB64

  • getValue_asB64(): string

getValue_asU8

  • getValue_asU8(): Uint8Array

serializeBinary

  • serializeBinary(): Uint8Array

serializeMessage

  • serializeMessage(): Buffer
  • Create a serialized Message object with the Liftbridge envelope.

    ℹ️ Use only when you're talking directly to NATS systems.

    Returns Buffer

    Buffer of Protobuf message.

setAckinbox

  • setAckinbox(value: string): void

setAckpolicy

  • setAckpolicy(value: 0 | 1 | 2): void

setCorrelationid

  • setCorrelationid(value: string): void

setKey

  • setKey(value: Uint8Array | string): void

setOffset

  • setOffset(value: string): void

setReply

  • setReply(value: string): void

setSubject

  • setSubject(value: string): void

setTimestamp

  • setTimestamp(value: string): void

setValue

  • setValue(value: Uint8Array | string): void

toObject

  • toObject(includeInstance?: undefined | false | true): Message.AsObject

Static deserializeBinary

  • deserializeBinary(bytes: Uint8Array): Message

Static deserializeBinaryFromReader

  • deserializeBinaryFromReader(message: Message, reader: jspb.BinaryReader): Message

Static serializeBinaryToWriter

  • serializeBinaryToWriter(message: Message, writer: jspb.BinaryWriter): void

Static toJSON

  • Returns a deserialized Message in JSON form.

    Buffers & byte-arrays are deserialized to UTF-8 strings, and maps of the form [[k1, v1], [k2, v2]] are converted to objects of the form { k1: v1, k2, v2 }.

    Parameters

    • message: Message

      Liftbridge Message to deserialize.

    Returns IMessage

    JSON form of given Message as IMessage.

Static toObject

  • toObject(includeInstance: boolean, msg: Message): Message.AsObject