DotPulsar.Extensions.Schemas 0.2.1

dotnet add package DotPulsar.Extensions.Schemas --version 0.2.1                
NuGet\Install-Package DotPulsar.Extensions.Schemas -Version 0.2.1                
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.2.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotPulsar.Extensions.Schemas --version 0.2.1                
#r "nuget: DotPulsar.Extensions.Schemas, 0.2.1"                
#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.2.1

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

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 net6.0 is compatible.  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 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 911 9/3/2024
0.2.0 166 7/30/2024
0.1.0 135 7/15/2024
0.0.9 102 7/15/2024
0.0.8 143 7/10/2024
0.0.7 101 7/9/2024
0.0.6 116 7/9/2024
0.0.5 231 6/12/2024
0.0.3 103 6/12/2024
0.0.2-rc.1 116 3/7/2024