Class RecordedMessage

Namespace
XBullet.EasyTesting.Messaging
Assembly
XBullet.EasyTesting.Messaging.dll

A transport-neutral representation of one successfully published message.

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

Constructors

RecordedMessage(string, string, string, JsonElement, IReadOnlyDictionary<string, string>)

A transport-neutral representation of one successfully published message.

public RecordedMessage(string Transport, string Destination, string MessageType, JsonElement Payload, IReadOnlyDictionary<string, string> Headers)

Parameters

Transport string

The transport identifier, such as Kafka.

Destination string

The transport-specific queue, topic, hub, or other destination name.

MessageType string

The captured compile-time payload type name, normally its fully qualified name.

Payload JsonElement

The self-contained JSON element produced when the message was recorded.

Headers IReadOnlyDictionary<string, string>

The captured message headers. Recorder-created dictionaries use case-insensitive keys. Header values are stored without automatic redaction.

Properties

Destination

The transport-specific queue, topic, hub, or other destination name.

public string Destination { get; init; }

Property Value

string

Headers

The captured message headers. Recorder-created dictionaries use case-insensitive keys. Header values are stored without automatic redaction.

public IReadOnlyDictionary<string, string> Headers { get; init; }

Property Value

IReadOnlyDictionary<string, string>

MessageType

The captured compile-time payload type name, normally its fully qualified name.

public string MessageType { get; init; }

Property Value

string

Payload

The self-contained JSON element produced when the message was recorded.

public JsonElement Payload { get; init; }

Property Value

JsonElement

Transport

The transport identifier, such as Kafka.

public string Transport { get; init; }

Property Value

string

Methods

GetPayload<T>(JsonSerializerOptions?)

Deserializes the captured JSON payload to the requested type.

public T? GetPayload<T>(JsonSerializerOptions? serializerOptions = null)

Parameters

serializerOptions JsonSerializerOptions

Options used for deserialization, or null to use new web-default options. The supplied instance is read but not owned, retained, or mutated by this method.

Returns

T

The deserialized payload, or null when the captured JSON represents null or the target type's converter returns null.

Type Parameters

T

The target payload type.