DotPulsar.Extensions.Schemas 0.0.5

There is a newer version of this package available.
See the version list below for details.
dotnet add package DotPulsar.Extensions.Schemas --version 0.0.5                
NuGet\Install-Package DotPulsar.Extensions.Schemas -Version 0.0.5                
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="DotPulsar.Extensions.Schemas" Version="0.0.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotPulsar.Extensions.Schemas --version 0.0.5                
#r "nuget: DotPulsar.Extensions.Schemas, 0.0.5"                
#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.
// Install DotPulsar.Extensions.Schemas as a Cake Addin
#addin nuget:?package=DotPulsar.Extensions.Schemas&version=0.0.5

// Install DotPulsar.Extensions.Schemas as a Cake Tool
#tool nuget:?package=DotPulsar.Extensions.Schemas&version=0.0.5                

DotPulsar Schema Extensions

Build status CodeQL analysis

Provides support for using Json and ProtoBuf producers, consumers, and receivers.

It is important to note that this library does not use the official Pulsar Schema Registry. The types provided are merely for convenience on top of the existing Schema.ByteSequence schema.

Installation

dotnet add package DotPulsar.Extensions.Schemas

Usage

A JSON schema can be created using JsonSchema.Get<T>(). This schema can be used to create a producer, consumer, or receiver.

await using var producer = client.NewProducer(JsonSchema.Get<YourType>())
	.Topic("persistent://public/default/my-topic")
	.Create();

Custom serialization options can be passed into the constructor new JsonSchema<T>(options) or by overriding the default options using JsonSchema.DefaultSerializerOptions.

The same can be done for ProtoBuf schemas using ProtoBufSchema.Get<T>(). Currently, only protbuf-net serializable types are supported.

await using var producer = client.NewProducer(ProtoBufSchema.Get<YourType>())
	.Topic("persistent://public/default/my-topic")
	.Create();

Both JsonSchema and ProtoBufSchema support passing a custom ISchema<ReadOnlySequence<byte>> schema. This allows for custom handling of the bytes that are sent and received. One potential use case would be to implement custom encryption or compression of the message bytes.

License

This project is licensed under Apache License, Version 2.0.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.1 799 9/3/2024
0.2.0 163 7/30/2024
0.1.0 132 7/15/2024
0.0.9 99 7/15/2024
0.0.8 140 7/10/2024
0.0.7 98 7/9/2024
0.0.6 113 7/9/2024
0.0.5 228 6/12/2024
0.0.3 100 6/12/2024
0.0.2-rc.1 115 3/7/2024