Table of Contents

Class TransportMessage

Namespace
Pamoja.Core
Assembly
Pamoja.Core.dll

A message that arrived on a subscribed topic.

public sealed record TransportMessage : IEquatable<TransportMessage>
Inheritance
TransportMessage
Implements
Inherited Members

Constructors

TransportMessage(string, byte[])

A message that arrived on a subscribed topic.

public TransportMessage(string Topic, byte[] Payload)

Parameters

Topic string

The topic it was published to.

Payload byte[]

The raw payload bytes.

TransportMessage(string, string)

Creates a message whose payload is text, such as a command written out.

public TransportMessage(string topic, string text)

Parameters

topic string

The topic it was published to.

text string

The payload, sent as UTF-8.

Properties

Number

Gets the payload as a number written out as text, such as 21.5, or null when it is not one.

public double? Number { get; }

Property Value

double?

Payload

The raw payload bytes.

public byte[] Payload { get; init; }

Property Value

byte[]

Text

Gets the payload as text: words, or a number written out.

public string Text { get; }

Property Value

string

Topic

The topic it was published to.

public string Topic { get; init; }

Property Value

string