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