Class SchemaRegistryDeserializerBuilder<TBuilder>
- Namespace
- Silverback.Messaging.Configuration
- Assembly
- Silverback.Integration.Kafka.SchemaRegistry.dll
Builds an IMessageDeserializer based on the schema registry.
public abstract class SchemaRegistryDeserializerBuilder<TBuilder> where TBuilder : SchemaRegistryDeserializerBuilder<TBuilder>
Type Parameters
TBuilderThe actual builder type.
- Inheritance
-
SchemaRegistryDeserializerBuilder<TBuilder>
- Derived
- Inherited Members
Constructors
SchemaRegistryDeserializerBuilder(IConfluentSchemaRegistryClientFactory)
Initializes a new instance of the SchemaRegistryDeserializerBuilder<TBuilder> class.
protected SchemaRegistryDeserializerBuilder(IConfluentSchemaRegistryClientFactory schemaRegistryClientFactory)
Parameters
schemaRegistryClientFactoryIConfluentSchemaRegistryClientFactoryThe IConfluentSchemaRegistryClientFactory to be used to create the schema registry client.
Properties
This
Gets the actual builder instance.
protected abstract TBuilder This { get; }
Property Value
- TBuilder
Methods
Build()
Builds the IMessageDeserializer instance.
public IMessageDeserializer Build()
Returns
BuildCore(Type, ISchemaRegistryClient)
Builds the IMessageDeserializer instance.
protected abstract IMessageDeserializer BuildCore(Type messageType, ISchemaRegistryClient schemaRegistryClient)
Parameters
messageTypeTypeThe type of the message to serialize.
schemaRegistryClientISchemaRegistryClientThe schema registry client.
Returns
ConnectToSchemaRegistry(Action<KafkaSchemaRegistryConfigurationBuilder>)
Configures the Confluent.SchemaRegistry.SchemaRegistryConfig.
public TBuilder ConnectToSchemaRegistry(Action<KafkaSchemaRegistryConfigurationBuilder> configurationBuilderAction)
Parameters
configurationBuilderActionAction<KafkaSchemaRegistryConfigurationBuilder>An Action<T> that takes the Confluent.SchemaRegistry.SchemaRegistryConfig and configures it.
Returns
- TBuilder
The builder so that additional calls can be chained.
ConnectToSchemaRegistry(string, Action<KafkaSchemaRegistryConfigurationBuilder>?)
Configures the Confluent.SchemaRegistry.SchemaRegistryConfig.
public TBuilder ConnectToSchemaRegistry(string url, Action<KafkaSchemaRegistryConfigurationBuilder>? configurationBuilderAction = null)
Parameters
urlstringThe comma-separated list of URLs for schema registry instances.
configurationBuilderActionAction<KafkaSchemaRegistryConfigurationBuilder>An optional Action<T> that takes the Confluent.SchemaRegistry.SchemaRegistryConfig and configures it.
Returns
- TBuilder
The builder so that additional calls can be chained.
UseModel(Type)
Specifies the message type.
public TBuilder UseModel(Type messageType)
Parameters
messageTypeTypeThe type of the message to serialize or deserialize.
Returns
- TBuilder
The builder so that additional calls can be chained.
UseModel<TMessage>()
Specifies the message type.
public TBuilder UseModel<TMessage>() where TMessage : class
Returns
- TBuilder
The builder so that additional calls can be chained.
Type Parameters
TMessageThe type of the message to deserialize.