Table of Contents

Method SetAvroSharpValueSerializerAsync

Namespace
AvroSharp.Confluent
Assembly
AvroSharp.Confluent.dll

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

builder ProducerBuilder<TKey, TValue>

The producer builder.

client ISchemaRegistryClient

The schema registry, which is asked for the version once.

subject string

The subject.

version int

The version, from 1.

config AvroSharpSerializerConfig

Other settings, or null for the defaults; use.schema.id and auto.register.schemas are set.

ruleRegistry RuleRegistry

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

Returns

Task<ProducerBuilder<TKey, TValue>>

Type Parameters

TKey

The key type.

TValue

The value type.