Class SchemaRegistryMessageDeserializer<TMessage>
Connects to the specified schema registry and deserializes the messages.
Inheritance
Implements
Inherited Members
Namespace: Silverback.Messaging.Serialization
Assembly: Silverback.Integration.Kafka.SchemaRegistry.dll
Syntax
public abstract class SchemaRegistryMessageDeserializer<TMessage> : IMessageDeserializer where TMessage : class
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the messages to be deserialized. |
Constructors
SchemaRegistryMessageDeserializer(ISchemaRegistryClient, IAsyncDeserializer<TMessage>)
Initializes a new instance of the SchemaRegistryMessageDeserializer<TMessage> class.
Declaration
protected SchemaRegistryMessageDeserializer(ISchemaRegistryClient schemaRegistryClient, IAsyncDeserializer<TMessage> confluentDeserializer)
Parameters
| Type | Name | Description |
|---|---|---|
| ISchemaRegistryClient | schemaRegistryClient | The schema registry client. |
| IAsyncDeserializer<TMessage> | confluentDeserializer | The Confluent deserializer to be used to deserialize the message. |
Properties
RequireHeaders
Gets a value indicating whether this serializer (with the current configuration) needs the headers support to work properly.
Declaration
public bool RequireHeaders { get; }
Property Value
| Type | Description |
|---|---|
| bool |
SchemaRegistryClient
Gets the schema registry client.
Declaration
public ISchemaRegistryClient SchemaRegistryClient { get; }
Property Value
| Type | Description |
|---|---|
| ISchemaRegistryClient |
Methods
DeserializeAsync(Stream?, MessageHeaderCollection, ConsumerEndpoint)
Deserializes the byte array into a message object.
Declaration
public ValueTask<DeserializedMessage> DeserializeAsync(Stream? messageStream, MessageHeaderCollection headers, ConsumerEndpoint endpoint)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | messageStream | The Stream containing the message to be deserialized. |
| MessageHeaderCollection | headers | The message headers collection. |
| ConsumerEndpoint | endpoint | The endpoint. |
Returns
| Type | Description |
|---|---|
| ValueTask<DeserializedMessage> | A ValueTask<TResult> representing the asynchronous operation. The task result contains the
deserialized message (or |
GetCompatibleSerializer()
Gets a new IMessageSerializer compatible with this deserializer.
Declaration
public abstract IMessageSerializer GetCompatibleSerializer()
Returns
| Type | Description |
|---|---|
| IMessageSerializer | A new instance of an IMessageSerializer compatible with this deserializer. |