AvroSharp.Confluent 1.0.0

dotnet add package AvroSharp.Confluent --version 1.0.0
                    
NuGet\Install-Package AvroSharp.Confluent -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AvroSharp.Confluent" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AvroSharp.Confluent" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="AvroSharp.Confluent" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AvroSharp.Confluent --version 1.0.0
                    
#r "nuget: AvroSharp.Confluent, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AvroSharp.Confluent@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AvroSharp.Confluent&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=AvroSharp.Confluent&version=1.0.0
                    
Install as a Cake Tool

AvroSharp.Confluent

Confluent Schema Registry serializers and deserializers for Confluent.Kafka, built on AvroSharp, without Apache.Avro.

  • Types:

    • types generated from .avsc files;
    • your own C# types marked [AvroSerializable];
    • generic records (AvroValue);
    • the primitives string, int, long, float, double, bool and byte[], as in Confluent's serializers (not yet its Null).
  • Confluent's own code for the registry: AvroSharp's serializers derive from Confluent's serializer base classes, so these work as in Confluent's serializer:

    • subject name strategies;
    • registration and use.latest.version;
    • schema ID strategies (prefix or header);
    • schema references;
    • data contract rules: domain rules (such as CEL, which names the Avro fields, as Java's serializer does) and encoding rules. Field rules, such as field-level encryption (CSFLE), and migration rules aren't supported yet, and fail rather than being skipped.

    Only the Avro encoding is AvroSharp's. With use.latest.version or use.schema.id, the serializer also checks that the target schema encodes as your type's, logical types included, which Confluent's doesn't.

  • Interchangeable with Confluent's serializer:

    • the same message bytes for the same schema and value;
    • the same configuration keys (avro.serializer.*, avro.deserializer.*);
    • each reads what the other writes. The tests compare them byte for byte.
  • Schema evolution: a message is read in its writer's schema, from the registry by its schema ID, and resolved to your type's schema, so older and newer versions both read.

Status: new in 1.0.0, and released with AvroSharp at the same version. It follows semantic versioning with the rest of AvroSharp.

Guide · API reference · Sample · AvroSharp documentation

Install

dotnet add package AvroSharp.Confluent
dotnet add package AvroSharp.Generators

AvroSharp.Generators turns your .avsc files and [AvroSerializable] types into C# code while the project builds (see code generation). AvroSharp.Confluent depends on Confluent.SchemaRegistry 2.14.0 or later (below 3.0). The tests run against 2.14.0 and the newest release.

Use

using AvroSharp.Confluent;
using Confluent.Kafka;
using Confluent.SchemaRegistry;

using var registry = new CachedSchemaRegistryClient(new SchemaRegistryConfig { Url = "http://localhost:8081" });

// Order is generated from Order.avsc, or is a partial class marked [AvroSerializable].
using var producer = new ProducerBuilder<string, Order>(new ProducerConfig { BootstrapServers = "localhost:9092" })
    .SetAvroSharpKeySerializer(registry)
    .SetAvroSharpValueSerializer(registry)
    .Build();
await producer.ProduceAsync("orders", new Message<string, Order> { Key = order.Id.ToString(), Value = order });

using var consumer = new ConsumerBuilder<string, Order>(new ConsumerConfig { BootstrapServers = "localhost:9092", GroupId = "billing" })
    .SetAvroSharpKeyDeserializer(registry)
    .SetAvroSharpValueDeserializer(registry)
    .Build();

The guide has:

  • generic records;
  • .NET Standard;
  • the settings and their Confluent keys;
  • moving from Confluent's Avro serializer and from Chr.Avro;
  • tombstones and the other behaviors to know;
  • which data contract rules run.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on AvroSharp.Confluent:

Package Downloads
AvroSharp.KafkaFlow

KafkaFlow serializers and deserializers for Confluent Schema Registry on AvroSharp: generated and [AvroSerializable] types, several types per topic, the same bytes as KafkaFlow's Confluent Avro serializer. No Apache.Avro.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 66 10/3/2026