Namespace AvroSharp.Confluent
The AvroSharp.Confluent package: Confluent Schema Registry serializers and deserializers for Confluent.Kafka, without Apache.Avro.
AvroSharpSerializer<T>andAvroSharpDeserializer<T>handle generated types,[AvroSerializable]types and the primitives.AvroSharpGenerichandles generic values.AvroSharpSerdeExtensionssets them on Confluent.Kafka's producer and consumer builders.
They derive from Confluent's serializer base classes, so subject name strategies, registration, schema ID strategies, references and rules are Confluent's own code. AvroSharpSerializerConfig and AvroSharpDeserializerConfig take the keys of Confluent's Avro serializer configuration. The package's README shows how to move from Confluent's Avro serializer and from Chr.Avro.
Classes
- AvroSharpDeserializerConfig
Settings of AvroSharpDeserializer<T> and the deserializers of AvroSharpGeneric, with the keys of Confluent's
AvroDeserializerConfig(avro.deserializer.*), so existing configuration carries over.
- AvroSharpDeserializerConfig.PropertyNames
The configuration keys, as Confluent's
AvroDeserializerConfig.PropertyNames.
- AvroSharpDeserializer<T>
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>.
- AvroSharpGeneric
Serializers and deserializers of generic values (AvroValue, such as a GenericRecord), for code that has schemas rather than generated types.
- AvroSharpGenericRecordSerializer
Writes generic records, each with its own schema (Schema), as Confluent's generic Avro serializer does: one serializer for a topic that carries records of several schemas, such as a bridge or a replay tool. Each schema is registered (or looked up) under its subject once, by the subject name strategy, with the record's name for the Record and TopicRecord strategies. Created by CreateSerializer(ISchemaRegistryClient, AvroSharpSerializerConfig?, RuleRegistry?).
- AvroSharpSerdeExtensions
Sets AvroSharp serializers and deserializers on Confluent.Kafka's producer and consumer builders, as their synchronous interfaces, so both
ProduceandProduceAsyncwork. They wait for the registry the first time each schema is written or read.
- AvroSharpSerializerConfig
Settings of AvroSharpSerializer<T> and the serializers of AvroSharpGeneric, with the keys of Confluent's
AvroSerializerConfig(avro.serializer.*), so existing configuration carries over.
- AvroSharpSerializerConfig.PropertyNames
The configuration keys, as Confluent's
AvroSerializerConfig.PropertyNames.
- AvroSharpSerializer<T>
Writes values in Confluent Schema Registry framing: a type generated by AvroSharp (from
.avscfiles or[AvroSerializable]), a primitive, or generic values (AvroSharpGeneric). It derives from Confluent's Confluent.SchemaRegistry.AsyncSerializer<T, TParsedSchema>, so subject name strategies, registration,use.latest.version, schema ID strategies, references and rules are Confluent's own code; only the Avro encoding is AvroSharp's. The bytes are those of Confluent's Avro serializer for the same schema and value.