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
<PackageReference Include="DotPulsar.Extensions.Schemas" Version="0.2.1" />
paket add DotPulsar.Extensions.Schemas --version 0.2.1
#r "nuget: DotPulsar.Extensions.Schemas, 0.2.1"
// 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
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 | 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. |
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.