Table of Contents

Class SchemaRegistrySerializerBuilder<TBuilder>

Namespace
Silverback.Messaging.Configuration
Assembly
Silverback.Integration.Kafka.SchemaRegistry.dll

Builds an IMessageSerializer based on the schema registry.

public abstract class SchemaRegistrySerializerBuilder<TBuilder> where TBuilder : SchemaRegistrySerializerBuilder<TBuilder>

Type Parameters

TBuilder

The actual builder type.

Inheritance
SchemaRegistrySerializerBuilder<TBuilder>
Derived
Inherited Members

Constructors

SchemaRegistrySerializerBuilder(IConfluentSchemaRegistryClientFactory)

Initializes a new instance of the SchemaRegistrySerializerBuilder<TBuilder> class.

protected SchemaRegistrySerializerBuilder(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 IMessageSerializer instance.

public IMessageSerializer Build()

Returns

IMessageSerializer

The IMessageSerializer.

BuildCore(Type, ISchemaRegistryClient)

Builds the IMessageSerializer instance.

protected abstract IMessageSerializer BuildCore(Type messageType, ISchemaRegistryClient schemaRegistryClient)

Parameters

messageType Type

The type of the message to serialize.

schemaRegistryClient ISchemaRegistryClient

The schema registry client.

Returns

IMessageSerializer

The IMessageSerializer.

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 serialize.

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 serialize.