![]() |
VOOZH | about |
dotnet add package MASES.KNet.Serialization.Avro --version 3.2.3
NuGet\Install-Package MASES.KNet.Serialization.Avro -Version 3.2.3
<PackageReference Include="MASES.KNet.Serialization.Avro" Version="3.2.3" />
<PackageVersion Include="MASES.KNet.Serialization.Avro" Version="3.2.3" />Directory.Packages.props
<PackageReference Include="MASES.KNet.Serialization.Avro" />Project file
paket add MASES.KNet.Serialization.Avro --version 3.2.3
#r "nuget: MASES.KNet.Serialization.Avro, 3.2.3"
#:package MASES.KNet.Serialization.Avro@3.2.3
#addin nuget:?package=MASES.KNet.Serialization.Avro&version=3.2.3Install as a Cake Addin
#tool nuget:?package=MASES.KNet.Serialization.Avro&version=3.2.3Install as a Cake Tool
KNet comes with a base set of serializer and deserializer. Most of them are usable with primitives types (bool, int, etc) and array of bytes.
If the user wants to use structures types there are two ways:
KNet suite offers some ready made serializer/deserializer usable with the specific APIs (KNetProducer/KNetConsumer).
The current available packages are:
Starting from version 2.7.0, KNet comes with two kind of data exchange mechanisms:
byte array transfer and this is the standard used since last versionByteBuffer objects:
ByteBuffer are exchangedByteBuffer, the memory pointers originating the information and the counterpart reads that memory without make copiesAll available packages listed at the beginning comes with both versions and the user can choose its preferred one.
As example, let consider a type defined like the following one:
public class TestType
{
public TestType(int i)
{
name = description = value = i.ToString();
}
public string name;
public string description;
public string value;
public override string ToString()
{
return $"name {name} - description {description} - value {value}";
}
}
To manage it within C#, without create TestType in Java™, an user can create:
SerDesRaw<TestType> serializer = new SerDesRaw<TestType>()
{
OnSerialize = (topic, type) => { return Array.Empty<byte>(); }
};
SerDesRaw<TestType> deserializer = new SerDesRaw<TestType>()
{
OnDeserialize = (topic, data) => { return new TestType(0); }
};
Otherwise the user can use a ready made class like in the following snippet:
ISerDesRaw<TestType> serdes = JsonSerDes.Value<TestType>.NewByteArraySerDes();
A single JsonSerDes.ValueRaw can be used in serialization and deserialization, and produce Json serialized data.
The reader noticed that in the example was used JsonSerDes.Value<T>().NewByteArraySerDes(). It is a serializer/deserializer, based on byte array, generally used for values because it stores, within the record Headers information related to the value itself.
All packages listed above have multiple types based on the scope and data exchange mechanism:
byte array and ByteBufferbyte array and ByteBufferwhere [Serialization format] depends on the serializatin package in use and the selection of the data transfer can be made from underlying code or can be requested from the user:
[Serialization Format].[Key or Value]<TData>.NewByteArraySerDes(): returns an ISerDesRaw<TData>[Serialization Format].[Key or Value]<TData>.NewByteBufferSerDes(): returns an ISerDesBuffered<TData>As specified above, each serializer stores info within the Headers and this behavior is controlled from a property named UseHeaders.
If the user writes a code like:
ISerDesRaw<TestType> serdes = JsonSerDes.Value<TestType>.NewByteArraySerDes();
serdes.UseHeader = false;
The ISerDesRaw<TestType> instance does not writes the Headers and can be used both for key and value.
Some kind of serializers extension have specific needs will be listed below.
The Avro serializer is based on Apache.Avro package. The types managed are:
NOTE: simple types (the one that have an Apache Kafka™ default serializer) are not managed and will be refused
The MessagePack serializer is based on MessagePack package. The types managed are:
NOTE: simple types (the one that have an Apche Kafka™ default serializer) are not managed and will be refused
The Protobuf serializer is based on Google.Protobuf package. The types managed are:
IMessage<T>NOTE: simple types (the one that have an Apche Kafka™ default serializer) are not managed and will be refused
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Framework | net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.2.3 | 125 | 6/16/2026 |
| 3.2.3-rc991 | 216 | 6/10/2026 |
| 3.2.3-rc99 | 111 | 6/9/2026 |
| 3.2.3-rc98 | 104 | 6/8/2026 |
| 3.2.3-rc97 | 100 | 6/5/2026 |
| 3.2.3-rc96 | 125 | 6/4/2026 |
| 3.2.3-rc95 | 112 | 5/29/2026 |
| 3.2.3-rc94 | 128 | 5/26/2026 |
| 3.2.3-rc93 | 126 | 5/22/2026 |
| 3.2.3-rc92 | 131 | 5/20/2026 |
| 3.2.3-rc91 | 124 | 5/16/2026 |
| 3.2.3-rc9 | 133 | 5/12/2026 |
| 3.2.3-rc8 | 174 | 5/8/2026 |
| 3.2.3-rc7 | 101 | 5/8/2026 |
| 3.2.3-rc6 | 108 | 5/6/2026 |
| 3.2.3-rc5 | 101 | 5/4/2026 |
| 3.2.3-rc4 | 105 | 5/2/2026 |
| 3.2.3-rc3 | 154 | 4/30/2026 |
| 2.9.12 | 97 | 6/16/2026 |
| 2.9.12-rc1 | 90 | 6/10/2026 |