Class AvroRegistryMessageReader<T>
Reads messages in a schema registry's framing (AvroRegistryFraming). The ID in each header selects the writer schema through an IAvroSchemaIdResolver; the read function for each ID is created once and cached, and the ID seen last is checked before the cache, since streams of messages mostly repeat one schema.
public sealed class AvroRegistryMessageReader<T>
Type Parameters
TThe type read.
- Inheritance
-
AvroRegistryMessageReader<T>
- Inherited Members
Remarks
Instances are thread-safe when the read functions and the resolver are.
Properties
- Framing
Gets the framing this reader expects.
Methods
- Read(ReadOnlySpan<byte>)
Reads one framed message whose schema the resolver already knows.
- ReadAsync(ReadOnlyMemory<byte>, CancellationToken)
Reads one framed message, fetching its schema through the resolver when its ID is new.
- ReadPayload(AvroSchemaId, ReadOnlySpan<byte>)
Reads the Avro data of a message whose schema ID travels outside it, for example in Confluent's
__value_schema_idheader (ConfluentSchemaIdHeader).
- ReadPayloadAsync(AvroSchemaId, ReadOnlyMemory<byte>, CancellationToken)
Reads the Avro data of a message whose schema ID travels outside it, fetching the schema when the ID is new.