confluent-kafka-dotnet
Show / Hide Table of Contents

Namespace Confluent.SchemaRegistry

Classes

AbstractBearerAuthenticationHeaderValueProvider

Abstract base class for providers that supply Bearer authentication header values.

AssociatedNameStrategy

Associated subject name strategy implementation that uses a schema registry client and configuration to determine subject names.

This strategy queries schema registry for the associated subject name for the topic. The topic is passed as the resource name to schema registry. If there is a configuration property named "subject.name.strategy.kafka.cluster.id", then its value will be passed as the resource namespace. Otherwise, if the producer or consumer supplied a cluster id resolver via SetClusterIdResolver(Func<Task<string>>), the id it resolves to is used, resolved when the association is looked up. Failing both, the value "-" will be passed as the resource namespace.

If more than one subject is returned from the query, an exception will be thrown. If no subjects are returned from the query, then the behavior will fall back to Topic strategy, unless the configuration property "subject.name.strategy.fallback.type" is set to "RECORD", "TOPIC_RECORD", or "NONE".

Association

Represents an association between a subject and a resource in Schema Registry.

AssociationCreateOrUpdateInfo

Information about an association to create or update.

AssociationCreateOrUpdateRequest

Request to create or update associations.

AssociationInfo

Information about an association in a response.

AssociationResponse

Response from creating or updating associations.

AsyncDeserializer<T, TParsedSchema>

AsyncSerde<TParsedSchema>

AsyncSerializer<T, TParsedSchema>

AzureIMDSBearerAuthenticationHeaderValueProvider

Provider for authentication header values that uses Azure Instance Metadata Service (IMDS) to obtain bearer tokens.

BasicAuthenticationHeaderValueProvider

A HTTP authentication header value provider implementing the 'Basic' scheme.

See: https://datatracker.ietf.org/doc/html/rfc7617

BearerAuthenticationHeaderValueProvider

Provides bearer token authentication header values for schema registry requests based on OAuth2 client credentials flow.

CachedSchemaRegistryClient

A caching Schema Registry client.

The following method calls cache results:

  • GetSchemaIdAsync(string, Schema, bool)
  • GetSchemaIdAsync(string, string, bool)
  • GetSchemaAsync(int, string)
  • GetSchemaBySubjectAndIdAsync(string, int, string)
  • RegisterSchemaAsync(string, Schema, bool)
  • RegisterSchemaAsync(string, string, bool)
  • GetRegisteredSchemaAsync(string, int, bool)
  • LookupSchemaAsync(string, Schema, bool, bool)
  • GetLatestSchemaAsync(string)

The following method calls do NOT cache results:

  • GetAllSubjectsAsync()
  • GetSubjectVersionsAsync(string)
  • IsCompatibleAsync(string, Schema)
  • IsCompatibleAsync(string, string)
  • GetCompatibilityAsync(string)
  • UpdateCompatibilityAsync(Compatibility, string)

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.

ErrorAction

An error action

FieldRuleExecutor

Metadata

Migration

NoneAction

A none action

PropertyNames

Configuration property names specific to the schema registry client.

ReferenceSubjectNameStrategyExtensions

Extension methods for the ReferenceSubjectNameStrategy type.

RegisteredSchema

Represents a Schema stored in Schema Registry.

RestService

Rule

RuleConditionException

A rule condition exception

RuleContext

A rule context.

RuleContext.FieldContext

RuleException

A rule exception

RuleOverride

A rule override.

RuleRegistry

A rule registry.

RuleSet

Schema

Represents a schema.

SchemaIdStrategyExtensions

SchemaReference

Represents a reference to a Schema stored in Schema Registry.

SchemaRegistryConfig

CachedSchemaRegistryClient configuration properties.

SchemaRegistryConfig.PropertyNames

Configuration property names specific to the schema registry client.

SchemaRegistryException

Represents an error returned by Confluent Schema Registry.

SchemaRegistrySerdeBuilder<TBuilder>

EXPERIMENTAL: subject to change or removal.

Common configuration for the builders of Schema Registry serializers and deserializers - how the Schema Registry client itself is obtained.

There are three ways to supply the client, exactly one of which must be used:

  • SetSchemaRegistryClient(ISchemaRegistryClient), to use a client the application constructed. Necessary when the application needs the client for something else too, such as registering encryption keys or creating associations before producing, and allows a single client to be shared across serdes and clients. The application retains ownership: the client is not disposed along with the serde.

  • SetSchemaRegistryConfig(SchemaRegistryConfig), to have the builder construct a CachedSchemaRegistryClient from configuration. The shortest form, and enough for most applications.

  • SetSchemaRegistryClientBuilder(ISchemaRegistryClientBuilder), to have the builder construct a client that needs more than configuration alone - an authentication header value provider or a proxy, neither of which can be expressed in a string-to-string SchemaRegistryConfig.

In the latter two cases the resulting client is owned by the serde, which is in turn owned by the producer or consumer that built it, and is disposed along with it.

SerdeConfig

Base functionality common to all configuration classes.

SerdeConfig.SharedPropertyNames

Configuration property names shared by all serializers and deserializers.

ServerConfig

StaticBearerAuthenticationHeaderValueProvider

Provides authentication header values using a static bearer token.

SubjectNameStrategyExtensions

Extension methods for the SubjectNameStrategy type.

Utils

ValidationRule

An inline validation rule (a CHECK constraint) declared on a schema, either on a record/message/object or on one of its fields.

ValidationRuleError

A single inline validation rule failure, located at FieldPath within the message that was validated.

ValidationRules

Helpers shared by the per-format inline validation rule walkers.

ValidationRulesFailedException

Thrown when one or more inline validation rules fail during serialization.

Variant

A read-only view over a Variant (a Spark/Parquet Variant: a metadata key-dictionary plus a self-describing value stream) at a byte position. Navigation (GetFieldByKey(string) / GetElementAtIndex(int)) returns a sub-Variant sharing the same buffers. This is the .NET counterpart of Java's io.confluent.kafka.schemaregistry.type.Variant; it lives in the core package so the Avro and Protobuf serdes can use it without a Rules dependency.

ToJson() renders temporal types as ISO-8601 with the seconds field always present (0/3/6/9-digit fractional grouping) and decimals in fixed-point - the cross-language contract. ParseJson(string) follows Java number handling: a fractional JSON number becomes a DOUBLE, an integer wider than 64 bits a scale-0 decimal.

VariantBuilder

A flat, streaming writer that builds a Variant programmatically. A single builder maintains an internal nesting stack (the arrow-dotnet flat streaming-writer shape): each Append* targets the current slot - the root, the next array element, or the current object field value (after AppendKey(string)). Object fields are sorted by key on EndObject() (canonical order) and their keys accumulate into the metadata dictionary. Build() finalizes and returns a Variant.

Output is byte-identical to ParseJson(string) for the equivalent document: ParseJson(string) is itself implemented on top of this builder. Integer widths are the caller's choice here (AppendByte(sbyte) .. AppendLong(long)), whereas the JSON path selects the smallest width that fits; pick the matching method to reproduce a parsed document exactly.

Misuse (an unbalanced Start*/End*, AppendKey(string) outside an object, a value append without a preceding AppendKey(string) inside an object, or Build() with an open container) raises VariantException.

VariantException

Raised for a malformed or unsupported Variant binary value.

WildcardMatcher

Structs

BigDecimal

Arbitrary-precision signed decimal, the CEL Decimal backing type for this client and the unscaled/scale representation used by the Variant codec. A value is unscaled × 10^(-scale) — a BigInteger unscaled value and an int scale, exactly like Java's java.math.BigDecimal. .NET's decimal tops out at 28–29 significant digits; parity with the other Schema Registry clients (Java/Go/Python/ JS/Rust) requires the 38-significant-digit division and square root those clients produce, so the arithmetic here mirrors Java's MathContext(38, HALF_UP).

SchemaId

Represents a schema ID or GUID.

Interfaces

IAuthenticationBearerHeaderValueProvider

An interface defining HTTP client authentication header values.

IAuthenticationHeaderValueProvider

An interface defining HTTP client authentication header values.

ICustomReferenceSubjectNameStrategy

Custom Reference Subject Name Strategy Interface

IFieldTransform

IRuleAction

A rule action

IRuleBase

A base class for rule executors and actions

IRuleExecutor

A rule executor

ISchemaIdDecoder

Interface for decoding schema IDs or GUIDs.

ISchemaIdEncoder

Interface for encoding schema IDs or GUIDs.

ISchemaRegistryClient

An interface implemented by Confluent Schema Registry clients.

ISchemaRegistryClientBuilder

EXPERIMENTAL: subject to change or removal.

Defines a builder of ISchemaRegistryClient instances, for use with the Schema Registry serde builders.

A client cannot be described by SchemaRegistryConfig alone: an authentication header value provider and a proxy are objects rather than configuration strings, so they cannot be carried in a string-to-string property collection. This interface gathers everything needed to construct a client into a single value that can be handed to a serde builder, and reused across several of them.

IValidationRuleExecutor

Evaluates a single inline validation rule against a value.

Implementations return either a bool (false meaning the rule failed) or a string (non-empty meaning the rule failed, with that string as the failure message).

Enums

AuthCredentialsSource

Auth credentials source.

BearerAuthCredentialsSource

Bearer auth credentials source.

BigDecimal.Rounding

Compatibility

Enumerates the schema compatibility types.

ReferenceSubjectNameStrategy

Subject name strategy for referenced schemas.

RuleContext.Type

RuleKind

Rule kind.

RuleMode

Rule mode.

RulePhase

Rule phase.

SchemaIdDeserializerStrategy

The schema ID deserialization strategy.

SchemaIdSerializerStrategy

The schema ID serialization strategy.

SchemaType

Enumerates the types of schema supported by Schema Registry.

SubjectNameStrategy

Subject name strategy. Refer to: https://www.confluent.io/blog/put-several-event-types-kafka-topic/

ValidationRulesExecution

Determines when inline validation rules run, relative to domain rule transformations.

VariantType

The value type of a Variant, mirroring Java's Variant.Type. Integer, decimal, and timestamp widths are kept distinct here; the CEL layer collapses them.

Delegates

AsyncSubjectNameStrategyDelegate

Asynchronously construct the subject name under which the schema associated with a record should be registered in Schema Registry.

FieldTransformer

ReferenceSubjectNameStrategyDelegate

Construct the subject name under which a referenced schema should be registered in Schema Registry.

SubjectNameStrategyDelegate

Construct the subject name under which the schema associated with a record should be registered in Schema Registry.

In this article