Table of Contents

Class MessageMetadataJsonConverter

Namespace
Excalibur.Dispatch.Metadata
Assembly
Excalibur.Dispatch.dll

Serializes MessageMetadata using a flat JSON object shape, preserving the wire contract that existed before the metadata fields were composed into focused value-type groups (MessageIdentity, MessageRouting, etc.).

public sealed class MessageMetadataJsonConverter : JsonConverter<MessageMetadata>
Inheritance
MessageMetadataJsonConverter
Inherited Members
Extension Methods

Remarks

Composing the metadata into nested groups is a C# API concern only. This converter hoists the grouped fields back to the top level on write and routes flat fields back into the builder on read, so the serialized representation is unchanged for consumers and transports. The converter is hand-written (no reflection) and therefore AOT/trimming safe.

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts the JSON to type MessageMetadata.

public override MessageMetadata Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader

The reader.

typeToConvert Type

The type to convert.

options JsonSerializerOptions

An object that specifies serialization options to use.

Returns

MessageMetadata

The converted value.

Write(Utf8JsonWriter, MessageMetadata, JsonSerializerOptions)

Writes a specified value as JSON.

public override void Write(Utf8JsonWriter writer, MessageMetadata value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter

The writer to write to.

value MessageMetadata

The value to convert to JSON.

options JsonSerializerOptions

An object that specifies serialization options to use.