confluent-kafka-dotnet
Show / Hide Table of Contents

Class CachedSchemaRegistryClientBuilder

EXPERIMENTAL: subject to change or removal.

A builder of CachedSchemaRegistryClient instances, covering the client's entire input surface: its configuration, an optional authentication header value provider, and an optional proxy.

Hand one of these to a serde builder via SetSchemaRegistryClientBuilder when the client needs more than configuration alone. For the common case where configuration is enough, the serde builders accept a SchemaRegistryConfig directly.

Inheritance
object
CachedSchemaRegistryClientBuilder
Implements
ISchemaRegistryClientBuilder
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Confluent.SchemaRegistry
Assembly: Confluent.SchemaRegistry.dll
Syntax
public class CachedSchemaRegistryClientBuilder : ISchemaRegistryClientBuilder
Examples
var clientBuilder = new CachedSchemaRegistryClientBuilder()
    .SetConfig(schemaRegistryConfig)
    .SetAuthenticationHeaderValueProvider(myProvider);

using var producer = new ProducerBuilder<string, User>(producerConfig)
    .SetValueSerializerBuilder(new AvroSerializerBuilder<User>()
        .SetSchemaRegistryClientBuilder(clientBuilder))
    .Build();

Methods

Build()

Build a Schema Registry client.

The caller owns the returned client and is responsible for disposing it. A serde builder given this builder passes that ownership on to the serde, and thence to the producer or consumer that built it.

Declaration
public ISchemaRegistryClient Build()
Returns
Type Description
ISchemaRegistryClient

SetAuthenticationHeaderValueProvider(IAuthenticationHeaderValueProvider)

The authentication header value provider to construct the client with.

Use this for an authentication scheme that cannot be expressed in configuration alone, or for credentials that change over the lifetime of the client: configuration selects among the built-in providers, but only an instance can be supplied directly, and a client's provider cannot be replaced once it is constructed.

Declaration
public CachedSchemaRegistryClientBuilder SetAuthenticationHeaderValueProvider(IAuthenticationHeaderValueProvider authenticationHeaderValueProvider)
Parameters
Type Name Description
IAuthenticationHeaderValueProvider authenticationHeaderValueProvider
Returns
Type Description
CachedSchemaRegistryClientBuilder

SetConfig(SchemaRegistryConfig)

The configuration to construct the client with. Required.

Declaration
public CachedSchemaRegistryClientBuilder SetConfig(SchemaRegistryConfig config)
Parameters
Type Name Description
SchemaRegistryConfig config
Returns
Type Description
CachedSchemaRegistryClientBuilder

SetWebProxy(IWebProxy)

The proxy to construct the client with.

Declaration
public CachedSchemaRegistryClientBuilder SetWebProxy(IWebProxy proxy)
Parameters
Type Name Description
IWebProxy proxy
Returns
Type Description
CachedSchemaRegistryClientBuilder

Implements

ISchemaRegistryClientBuilder
In this article