Table of Contents

Class AvroSharpDeserializer<T>

Namespace
AvroSharp.Confluent
Assembly
AvroSharp.Confluent.dll

Reads values in Confluent Schema Registry framing as a type generated by AvroSharp, a primitive, or generic values (AvroSharpGeneric). The writer's schema comes from the registry by the message's schema ID (Confluent's client caches it), and the data is resolved to the type's own schema, so data of older and newer versions reads. It derives from Confluent's Confluent.SchemaRegistry.AsyncDeserializer<T, TParsedSchema>.

public sealed class AvroSharpDeserializer<T> : AsyncDeserializer<T, AvroSchema>, IAsyncDeserializer<T>, IDeserializer<T>

Type Parameters

T

The type read.

Inheritance
AsyncSerde<AvroSchema>
AsyncDeserializer<T, AvroSchema>
AvroSharpDeserializer<T>
Implements
IAsyncDeserializer<T>
IDeserializer<T>
Inherited Members

Remarks

It is both asynchronous and synchronous (Confluent.Kafka.IDeserializer<T>), which Confluent.Kafka's consumer calls. Once a schema ID's reader is known, the synchronous path reads without a task. It waits for the registry the first time, and on every message with use.latest.version or use.latest.with.metadata, or whose schema has rules, which can run asynchronously.

Constructors

AvroSharpDeserializer(ISchemaRegistryClient, AvroSharpDeserializerConfig?, RuleRegistry?)

Creates a deserializer of a generated type or a primitive, which AvroTypes knows. On .NET Standard, pass the type's AvroTypeInfo to the other constructor, or register it first.

AvroSharpDeserializer(ISchemaRegistryClient, AvroTypeInfo<T>, AvroSharpDeserializerConfig?, RuleRegistry?)

Creates a deserializer of the type that type reads and writes.

Methods

Deserialize(ReadOnlySpan<byte>, bool, SerializationContext)

Reads a value without a task once its schema ID's reader is known; until then, and with settings or rules that can run asynchronously, it waits for DeserializeAsync(ReadOnlyMemory<byte>, bool, SerializationContext).

DeserializeAsync(ReadOnlyMemory<byte>, bool, SerializationContext)

Reads a value: the writer's schema by the message's schema ID, then the data resolved to the type's schema.

ParseSchema(Schema)