Method CreateSerializer
CreateSerializer(ISchemaRegistryClient, AvroSchema, AvroSharpSerializerConfig?, RuleRegistry?)
Creates a serializer of values of schema, which it registers under the subject.
public static AvroSharpSerializer<AvroValue> CreateSerializer(ISchemaRegistryClient client, AvroSchema schema, AvroSharpSerializerConfig? config = null, RuleRegistry? ruleRegistry = null)
Parameters
clientISchemaRegistryClientThe schema registry.
schemaAvroSchemaThe schema the values are written with.
configAvroSharpSerializerConfigThe settings, or null for the defaults.
ruleRegistryRuleRegistryThe data contract rules, or null for Confluent.SchemaRegistry.RuleRegistry.GlobalInstance.
Returns
CreateSerializer(ISchemaRegistryClient, AvroSharpSerializerConfig?, RuleRegistry?)
Creates a serializer of generic records that writes each record with its own schema, as Confluent's generic Avro serializer does, for a topic that carries records of several schemas.
public static AvroSharpGenericRecordSerializer CreateSerializer(ISchemaRegistryClient client, AvroSharpSerializerConfig? config = null, RuleRegistry? ruleRegistry = null)
Parameters
clientISchemaRegistryClientThe schema registry.
configAvroSharpSerializerConfigThe settings, or null for the defaults.
ruleRegistryRuleRegistryThe data contract rules, or null for Confluent.SchemaRegistry.RuleRegistry.GlobalInstance.
Returns
Exceptions
- ArgumentException
confighas a key the serializer doesn't know, or enables bothuse.latest.versionandauto.register.schemas(the default).