Table of Contents

Class AvroSharpGlueSerializer

Namespace
AvroSharp.Aws.Glue
Assembly
AvroSharp.Aws.Glue.dll

Writes and reads Avro messages in AWS Glue Schema Registry's wire format, as AWS's serializer does: the header byte 0x03, the compression byte (0x00, or 0x05 for zlib), the schema version's 16-byte UUID, then the Avro data. It calls Glue through the AWS SDK for .NET's IAmazonGlue, and runs on every platform, with no native library.

public sealed class AvroSharpGlueSerializer
Inheritance
AvroSharpGlueSerializer
Inherited Members

Remarks

The values are types AvroTypes knows (generated from .avsc files, or marked [AvroSerializable]), and generic records (GenericRecord, or an AvroValue holding one).

A schema version is looked up (or registered, with AutoRegisterSchemas) once per schema name and definition, and a version's schema is fetched once per ID. A message is read in its writer's schema and resolved to the type's schema, so data of older and newer versions reads; a generic record is read in the writer's schema. Compressed and uncompressed messages both read.

For Confluent.Kafka, AvroSharpGlueKafkaSerializer<T> and AvroSharpGlueKafkaDeserializer<T> of the AvroSharp.Aws.Glue.Kafka package wrap it.

Constructors

AvroSharpGlueSerializer(IAmazonGlue, AvroSharpGlueOptions?)

Creates a serializer.

Methods

CanDecode(ReadOnlySpan<byte>)

Gets whether message starts with Glue Schema Registry's header, as AWS's CanDecode.

DeserializeAsync<T>(ReadOnlyMemory<byte>, CancellationToken)

Reads a message as T.

SerializeAsync<T>(T, string, bool, CancellationToken)

Writes a key or a value.

SerializeAsync<T>(T, string, CancellationToken)

Writes a value.