Class AvroProperties
- Namespace
- Solace.SchemaRegistry.Serdes.Avro
- Assembly
- Solace.SchemaRegistry.Serdes.Avro.dll
A class for configuring AVRO-specific properties. This is used by AvroSerializer<T> and AvroDeserializer<T>.
public class AvroProperties : SerdeProperties
- Inheritance
-
AvroProperties
- Inherited Members
Remarks
This class extends SerdeProperties and provides AVRO-specific configuration options including encoding settings, record type configuration, and schema dereferencing options.
Constructors
AvroProperties(IDictionary<string, object>)
Initializes a new instance of the AvroProperties class with the specified configuration dictionary.
protected AvroProperties(IDictionary<string, object> configuration)
Parameters
configurationIDictionary<string, object>A dictionary containing configuration key-value pairs. Required properties must be provided.
Exceptions
- ArgumentNullException
Thrown when configuration is null
Methods
FromDictionary(IDictionary<string, object>)
Creates a new AvroProperties instance with the specified configuration.
public static AvroProperties FromDictionary(IDictionary<string, object> configuration)
Parameters
configurationIDictionary<string, object>A dictionary containing configuration key-value pairs. Required properties must be provided.
Returns
- AvroProperties
A fully initialized AvroProperties instance.
Exceptions
- ArgumentNullException
Thrown when configuration is null
- ArgumentException
Thrown when the configuration contains invalid property values, or required properties are missing
GetDefaults()
Gets the default AVRO properties, including base SERDES and AVRO-specific defaults.
protected override IDictionary<string, object> GetDefaults()
Returns
- IDictionary<string, object>
A dictionary containing default property values
GetEncodingType()
Gets the encoding type for AVRO serialization. Defaults to BINARY.
public AvroProperties.AvroEncoding GetEncodingType()
Returns
- AvroProperties.AvroEncoding
The AVRO encoding type
Remarks
Accepts an AvroProperties.AvroEncoding value or its UPPER_SNAKE_CASE
string form (BINARY, JSON).
GetRecordType()
Gets the record type for AVRO deserialization. Defaults to GENERIC_RECORD.
public AvroProperties.AvroRecordType GetRecordType()
Returns
- AvroProperties.AvroRecordType
The AVRO record type
Remarks
Accepts an AvroProperties.AvroRecordType value or its UPPER_SNAKE_CASE
string form (GENERIC_RECORD, SPECIFIC_RECORD).
LoadFromConfig()
Resolves AVRO-specific configuration values from the config dictionary.
protected override void LoadFromConfig()