KafkaAvroSerializer properties reference

Review the following reference for a comprehensive list of the KafkaAvroSerializer properties.

Property Name Description Type Default Value
schema.compatibility The default compatibility of the new schemas created by the serializer. For more information about the compatibility options, see the Compatibility policies documentation. String BACKWARD
schema.group The default group of the new schemas created by the serializer. String kafka
schema.name.key.suffix The provided string will be appended to the end of the schema name created for record keys. The schema name is the topic name initially, so as a result, you will have topic name + provided suffix as schema name. String :k
schema.name.value.suffix The provided string will be appended to the end of the schema name created for record values. The schema name is the topic name initially, so as a result, you will have topic name + provided suffix as schema name. String null
null.passthrough.enabled If this is enabled, the serializer will return immediately with null value, without putting anything in the serialized output. Having null values can be important in compact topics. Having null as the latest value for a key indicates for Kafka that the corresponding key can be deleted during log compaction. Boolean false
slogical.type.conversion.enabled If this is enabled, Avro record fields can be serialized that are instances of Java classes (BigDecimal, UUID, LocalDate, and so on) that can be serialized in Avro using logical types. For more information, see the Logical Types section in the official Avro documentation.

This does not have to be enabled if SpecificRecords are used as part of generated classes. SpecificDatumWriter is used for serializing SpecificRecord instances and that writer handles logical types automatically.

Boolean false
serdes.protocol.version The protocol version to be used. The available default registered protocols are the following:
  • CONFLUENT_VERSION_PROTOCOL = 0x0;
  • METADATA_ID_VERSION_PROTOCOL = 0x1;
  • VERSION_ID_AS_LONG_PROTOCOL = 0x2;
  • VERSION_ID_AS_INT_PROTOCOL = 0x3;
  • JSON_PROTOCOL = 0x4;
Byte 0x3

(VERSION_ID_AS_INT_PROTOCOL)

store.schema.version.id.in.header If this is set to true, the schema version ID will be stored in the record header instead of the value. Boolean false
key_schema_version_id_header_name If the schema of the record key is stored in the header, the header name can be configured. String key.schema.version.id
value_schema_version_id_header_name If the schema of the record value is stored in the header, the header name can be configured. String value.schema.version.id

The KafkaAvroSerializer contains an embedded SchemaRegistryClient. The configuration for SchemaRegistryClient should also be provided for the KafkaAvroSerializer. For more information about configurable properties for the Schema Registry Client properties reference documentation.