Table of Contents

Method CreateSerializer

Namespace
AvroSharp.Confluent
Assembly
AvroSharp.Confluent.dll

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

client ISchemaRegistryClient

The schema registry.

schema AvroSchema

The schema the values are written with.

config AvroSharpSerializerConfig

The settings, or null for the defaults.

ruleRegistry RuleRegistry

The data contract rules, or null for Confluent.SchemaRegistry.RuleRegistry.GlobalInstance.

Returns

AvroSharpSerializer<AvroValue>

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

client ISchemaRegistryClient

The schema registry.

config AvroSharpSerializerConfig

The settings, or null for the defaults.

ruleRegistry RuleRegistry

The data contract rules, or null for Confluent.SchemaRegistry.RuleRegistry.GlobalInstance.

Returns

AvroSharpGenericRecordSerializer

Exceptions

ArgumentException

config has a key the serializer doesn't know, or enables both use.latest.version and auto.register.schemas (the default).