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
TransportstringThe transport identifier, such as
Kafka.DestinationstringThe transport-specific queue, topic, hub, or other destination name.
MessageTypestringThe captured compile-time payload type name, normally its fully qualified name.
PayloadJsonElementThe self-contained JSON element produced when the message was recorded.
HeadersIReadOnlyDictionary<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
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
MessageType
The captured compile-time payload type name, normally its fully qualified name.
public string MessageType { get; init; }
Property Value
Payload
The self-contained JSON element produced when the message was recorded.
public JsonElement Payload { get; init; }
Property Value
Transport
The transport identifier, such as Kafka.
public string Transport { get; init; }
Property Value
Methods
GetPayload<T>(JsonSerializerOptions?)
Deserializes the captured JSON payload to the requested type.
public T? GetPayload<T>(JsonSerializerOptions? serializerOptions = null)
Parameters
serializerOptionsJsonSerializerOptionsOptions 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
TThe target payload type.