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
TMessageThe 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
schemaRegistryClientISchemaRegistryClientThe schema registry client.
confluentSerializerIAsyncSerializer<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
messageobjectThe message object to be serialized.
headersMessageHeaderCollectionThe message headers collection.
endpointProducerEndpointThe endpoint.
Returns
- ValueTask<Stream>
A Task<TResult> representing the asynchronous operation. The task result contains the Stream with the serialized message.