Method SetAvroSharpValueSerializerAsync
SetAvroSharpValueSerializerAsync<TKey, TValue>(ProducerBuilder<TKey, TValue>, ISchemaRegistryClient, string, int, AvroSharpSerializerConfig?, RuleRegistry?)
Writes values with a version of a subject, pinned: an AvroSharpSerializer<T> with that version's
schema ID (use.schema.id), under that subject for every topic. A value type whose schema differs from the
version's is written in it, when the version can read the type's schema (id.compatibility.strict).
public static Task<ProducerBuilder<TKey, TValue>> SetAvroSharpValueSerializerAsync<TKey, TValue>(this ProducerBuilder<TKey, TValue> builder, ISchemaRegistryClient client, string subject, int version, AvroSharpSerializerConfig? config = null, RuleRegistry? ruleRegistry = null)
Parameters
builderProducerBuilder<TKey, TValue>The producer builder.
clientISchemaRegistryClientThe schema registry, which is asked for the version once.
subjectstringThe subject.
versionintThe version, from 1.
configAvroSharpSerializerConfigOther settings, or null for the defaults;
use.schema.idandauto.register.schemasare set.ruleRegistryRuleRegistryThe data contract rules, or null for Confluent.SchemaRegistry.RuleRegistry.GlobalInstance.
Returns
- Task<ProducerBuilder<TKey, TValue>>
Type Parameters
TKeyThe key type.
TValueThe value type.