Table of Contents

Class SchemaRegistryMessageSerializer<TMessage>

Namespace
Silverback.Messaging.Serialization
Assembly
Silverback.Integration.Kafka.SchemaRegistry.dll

Connects to the specified schema registry and deserializes the messages.

public abstract class SchemaRegistryMessageSerializer<TMessage> : IMessageSerializer where TMessage : class

Type Parameters

TMessage

The type of the messages to be serialized.

Inheritance
SchemaRegistryMessageSerializer<TMessage>
Implements
Derived
Inherited Members

Constructors

SchemaRegistryMessageSerializer(ISchemaRegistryClient, IAsyncSerializer<TMessage>)

Initializes a new instance of the SchemaRegistryMessageSerializer<TMessage> class.

protected SchemaRegistryMessageSerializer(ISchemaRegistryClient schemaRegistryClient, IAsyncSerializer<TMessage> confluentSerializer)

Parameters

schemaRegistryClient ISchemaRegistryClient

The schema registry client.

confluentSerializer IAsyncSerializer<TMessage>

The Confluent serializer to be used to serialize the message.

Properties

SchemaRegistryClient

Gets the schema registry client.

public ISchemaRegistryClient SchemaRegistryClient { get; }

Property Value

ISchemaRegistryClient

Methods

SerializeAsync(object?, MessageHeaderCollection, ProducerEndpoint)

Serializes the specified message object into a byte array.

public ValueTask<Stream?> SerializeAsync(object? message, MessageHeaderCollection headers, ProducerEndpoint endpoint)

Parameters

message object

The message object to be serialized.

headers MessageHeaderCollection

The message headers collection.

endpoint ProducerEndpoint

The endpoint.

Returns

ValueTask<Stream>

A Task<TResult> representing the asynchronous operation. The task result contains the Stream with the serialized message.