DotPulsar.Extensions.Schemas
0.0.9
See the version list below for details.
dotnet add package DotPulsar.Extensions.Schemas --version 0.0.9
NuGet\Install-Package DotPulsar.Extensions.Schemas -Version 0.0.9
<PackageReference Include="DotPulsar.Extensions.Schemas" Version="0.0.9" />
paket add DotPulsar.Extensions.Schemas --version 0.0.9
#r "nuget: DotPulsar.Extensions.Schemas, 0.0.9"
// Install DotPulsar.Extensions.Schemas as a Cake Addin #addin nuget:?package=DotPulsar.Extensions.Schemas&version=0.0.9 // Install DotPulsar.Extensions.Schemas as a Cake Tool #tool nuget:?package=DotPulsar.Extensions.Schemas&version=0.0.9
DotPulsar Schema Extensions
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 | Versions 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. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.