Table of Contents

Class SchemaTypeResolution

Namespace
Excalibur.Dispatch.Transport.Kafka
Assembly
Excalibur.Dispatch.Transport.Kafka.dll

Represents the result of resolving a schema ID to a .NET type.

public sealed class SchemaTypeResolution
Inheritance
SchemaTypeResolution
Inherited Members
Extension Methods

Remarks

This type is immutable and can be safely cached. Resolution is performed once per schema ID and reused for subsequent messages with the same schema.

Properties

FailureReason

Gets the failure reason if resolution failed.

public string? FailureReason { get; }

Property Value

string

The failure reason, or null if successful.

IsSuccess

Gets a value indicating whether the resolution was successful.

public bool IsSuccess { get; }

Property Value

bool

true if successful; otherwise, false.

MessageType

Gets the resolved .NET type.

public Type MessageType { get; }

Property Value

Type

The .NET type to deserialize to.

MessageTypeName

Gets the message type name from the JSON Schema title property.

public string MessageTypeName { get; }

Property Value

string

The message type name (e.g., "OrderCreated").

SchemaId

Gets the Schema Registry ID.

public int SchemaId { get; }

Property Value

int

The schema ID from the wire format header.

SchemaJson

Gets the JSON Schema content from the Schema Registry.

public string SchemaJson { get; }

Property Value

string

The raw JSON Schema string.

Methods

Failed(int, string?, string)

Creates a failed resolution result.

public static SchemaTypeResolution Failed(int schemaId, string? schemaJson, string reason)

Parameters

schemaId int

The schema ID that failed to resolve.

schemaJson string

The JSON Schema content (if available).

reason string

The reason for failure.

Returns

SchemaTypeResolution

A failed resolution instance.

Success(int, Type, string, string)

Creates a successful type resolution.

public static SchemaTypeResolution Success(int schemaId, Type messageType, string messageTypeName, string schemaJson)

Parameters

schemaId int

The Schema Registry ID.

messageType Type

The resolved .NET type.

messageTypeName string

The message type name from the schema.

schemaJson string

The JSON Schema content.

Returns

SchemaTypeResolution

A successful resolution instance.