Table of Contents

Class KafkaJsonSerializerConfiguration

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

Wraps the Confluent.SchemaRegistry.Serdes.JsonSerializerConfig.

public sealed record KafkaJsonSerializerConfiguration : IEquatable<KafkaJsonSerializerConfiguration>
Inheritance
KafkaJsonSerializerConfiguration
Implements
Inherited Members

Constructors

KafkaJsonSerializerConfiguration()

public KafkaJsonSerializerConfiguration()

Properties

AutoRegisterSchemas

Gets a value indicating whether the serializer should attempt to auto-register unrecognized schemas with the schema registry. The default is true.

public bool? AutoRegisterSchemas { get; init; }

Property Value

bool?

BufferBytes

Gets the initial size (in bytes) of the buffer used for the message serialization. Use a value high enough to avoid resizing the buffer, but small enough to avoid excessive memory use. Each message is serialized into a new buffer. The default is 1024.

public int? BufferBytes { get; init; }

Property Value

int?

LatestCompatibilityStrict

Gets a value indicating whether the serializer should check the backwards compatibility with the latest schema of the subject.

public bool? LatestCompatibilityStrict { get; init; }

Property Value

bool?

NormalizeSchemas

Gets a value indicating whether the schemas should be normalized, transforming them to have a consistent format, including ordering properties and references.

public bool? NormalizeSchemas { get; init; }

Property Value

bool?

SchemaIdStrategy

Gets the schema ID strategy. The default is Confluent.SchemaRegistry.SchemaIdSerializerStrategy.Prefix.

public SchemaIdSerializerStrategy? SchemaIdStrategy { get; init; }

Property Value

SchemaIdSerializerStrategy?

SubjectNameStrategy

Gets the subject name strategy. The default is Confluent.SchemaRegistry.SubjectNameStrategy.Associated.

public SubjectNameStrategy? SubjectNameStrategy { get; init; }

Property Value

SubjectNameStrategy?

UseLatestVersion

Gets a value indicating whether the serializer should use the latest subject version for serialization. Note that by default there is no check that the latest schema is compatible with the schema of the object being serialized: use LatestCompatibilityStrict to enable it.

public bool? UseLatestVersion { get; init; }

Property Value

bool?

UseLatestWithMetadata

Gets the metadata to be used to select the latest subject version to be used for serialization. Note that there is no check that the latest schema is backwards compatible with the schema of the object being serialized.

public IReadOnlyDictionary<string, string>? UseLatestWithMetadata { get; init; }

Property Value

IReadOnlyDictionary<string, string>

UseSchemaId

Gets the ID of the schema to be used for serialization. Note that there is no check that the schema is backwards compatible with the schema of the object being serialized.

public int? UseSchemaId { get; init; }

Property Value

int?

Validate

Gets a value indicating whether the serializer should validate the payload against the schema. The default is true.

public bool? Validate { get; init; }

Property Value

bool?

ValidateBeforeDomainRules

Gets a value indicating whether the message should be validated against the schema before running the domain rules instead of after.

public bool? ValidateBeforeDomainRules { get; init; }

Property Value

bool?

ValidationRulesExecution

Gets a value specifying when the inline validation rules run, relative to the domain rule transformations. The default is Confluent.SchemaRegistry.ValidationRulesExecution.Disabled.

public ValidationRulesExecution? ValidationRulesExecution { get; init; }

Property Value

ValidationRulesExecution?

ValidationRulesFailFast

Gets a value indicating whether the validation stops at the first failed rule and reports only that violation.

public bool? ValidationRulesFailFast { get; init; }

Property Value

bool?

Methods

Equals(KafkaJsonSerializerConfiguration?)

public bool Equals(KafkaJsonSerializerConfiguration? other)

Parameters

other KafkaJsonSerializerConfiguration

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(KafkaJsonSerializerConfiguration?, KafkaJsonSerializerConfiguration?)

public static bool operator ==(KafkaJsonSerializerConfiguration? left, KafkaJsonSerializerConfiguration? right)

Parameters

left KafkaJsonSerializerConfiguration
right KafkaJsonSerializerConfiguration

Returns

bool

operator !=(KafkaJsonSerializerConfiguration?, KafkaJsonSerializerConfiguration?)

public static bool operator !=(KafkaJsonSerializerConfiguration? left, KafkaJsonSerializerConfiguration? right)

Parameters

left KafkaJsonSerializerConfiguration
right KafkaJsonSerializerConfiguration

Returns

bool