Table of Contents

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

TBuilder

The 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

schemaRegistryClientFactory IConfluentSchemaRegistryClientFactory

The 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

IMessageDeserializer

The IMessageDeserializer.

BuildCore(Type, ISchemaRegistryClient)

Builds the IMessageDeserializer instance.

protected abstract IMessageDeserializer BuildCore(Type messageType, ISchemaRegistryClient schemaRegistryClient)

Parameters

messageType Type

The type of the message to serialize.

schemaRegistryClient ISchemaRegistryClient

The schema registry client.

Returns

IMessageDeserializer

The IMessageDeserializer.

ConnectToSchemaRegistry(Action<KafkaSchemaRegistryConfigurationBuilder>)

Configures the Confluent.SchemaRegistry.SchemaRegistryConfig.

public TBuilder ConnectToSchemaRegistry(Action<KafkaSchemaRegistryConfigurationBuilder> configurationBuilderAction)

Parameters

configurationBuilderAction Action<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

url string

The comma-separated list of URLs for schema registry instances.

configurationBuilderAction Action<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

messageType Type

The 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

TMessage

The type of the message to deserialize.