Interface ISchemaRegistryConfigBuilder
Defines schema configuration methods for a Schema Registry builder.
public interface ISchemaRegistryConfigBuilder
- Extension Methods
Methods
AutoRegisterSchemas(bool)
Enables or disables automatic schema registration on first use.
IConfluentSchemaRegistryBuilder AutoRegisterSchemas(bool enable = true)
Parameters
enableboolWhether to auto-register schemas. Default is true.
Returns
- IConfluentSchemaRegistryBuilder
The builder for fluent chaining.
Remarks
When enabled, schemas are automatically registered when a message type is first published. Disable in production if you want explicit schema management.
CompatibilityMode(CompatibilityMode)
Sets the schema compatibility mode.
IConfluentSchemaRegistryBuilder CompatibilityMode(CompatibilityMode mode)
Parameters
modeCompatibilityModeThe compatibility mode.
Returns
- IConfluentSchemaRegistryBuilder
The builder for fluent chaining.
Remarks
Default is Backward which allows new schemas to read data written with the previous schema version.
SubjectNameStrategy(SubjectNameStrategy)
Sets the subject naming strategy using the built-in enum.
IConfluentSchemaRegistryBuilder SubjectNameStrategy(SubjectNameStrategy strategy)
Parameters
strategySubjectNameStrategyThe subject name strategy.
Returns
- IConfluentSchemaRegistryBuilder
The builder for fluent chaining.
Remarks
Default is TopicName which uses {topic}-value
as the subject name.
SubjectNameStrategy<TStrategy>()
Sets a custom subject naming strategy.
IConfluentSchemaRegistryBuilder SubjectNameStrategy<TStrategy>() where TStrategy : class, ISubjectNameStrategy, new()
Returns
- IConfluentSchemaRegistryBuilder
The builder for fluent chaining.
Type Parameters
TStrategyThe custom strategy type implementing ISubjectNameStrategy.
Remarks
Use this for advanced scenarios where the built-in strategies are insufficient.
ValidateBeforeRegister(bool)
Enables or disables local schema validation before registration.
IConfluentSchemaRegistryBuilder ValidateBeforeRegister(bool enable = true)
Parameters
enableboolWhether to validate schemas locally. Default is true.
Returns
- IConfluentSchemaRegistryBuilder
The builder for fluent chaining.
Remarks
When enabled, schemas are validated locally before being sent to the registry. This catches schema errors earlier in the development cycle.