Table of Contents

Class DeserializationResult

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

Represents the result of deserializing a Confluent wire format message.

public sealed class DeserializationResult
Inheritance
DeserializationResult
Inherited Members
Extension Methods

Remarks

This type provides runtime type information alongside the deserialized message, enabling dynamic dispatch scenarios where the message type is only known after deserialization.

Constructors

DeserializationResult(object, Type, int, int)

Initializes a new instance of the DeserializationResult class.

public DeserializationResult(object message, Type messageType, int schemaId, int version)

Parameters

message object

The deserialized message.

messageType Type

The .NET type of the message.

schemaId int

The Schema Registry ID used for deserialization.

version int

The message version (if applicable).

Properties

Message

Gets the deserialized message.

public object Message { get; }

Property Value

object

The message object.

MessageType

Gets the .NET type of the deserialized message.

public Type MessageType { get; }

Property Value

Type

The message type.

SchemaId

Gets the Schema Registry ID that was used for deserialization.

public int SchemaId { get; }

Property Value

int

The schema ID from the wire format header.

Version

Gets the message version (for versioned messages).

public int Version { get; }

Property Value

int

The version number if the message implements IVersionedMessage; otherwise, 1.

Methods

As<T>()

Casts the deserialized message to the specified type.

public T As<T>()

Returns

T

The message cast to T.

Type Parameters

T

The expected message type.

Exceptions

InvalidCastException

The message cannot be cast to T.