Kafka序列化器和模式注册

问题描述 投票:0回答:1

在我的生产者中,我有一个属性kafkaProducer.value.serializer,并设置为org.apache.kafka.common.serialization.StringSerializer。

我只想知道架构注册表是否具有相同的用途,或者两者都具有不同的用途?例如:Avro序列化

apache-kafka kafka-producer-api
1个回答
0
投票

生产者配置包括必需的序列化器。此(StringSerializer)是String数据类型的默认序列化器。 Kafka还包括用于String,Long,Double,Integer和ByteArrays的序列化器。

两者都用于序列化数据并将其存储在Kafka中。 Avro具有类似于JSON的数据模型,但可以表示为JSON或紧凑的二进制形式。这些是Avro序列化的以下优点。

Messages are highly efficient

Strong schema support

Schema versioning

Dynamic schema support

Different, but compatible, Reader and Writer versions allowed
Union types

Object container files can include schema along with encoded records
Support for serialization/deserialization with human-readable JSON

有关完整的信息,请访问以下URL。

https://www.confluent.io/blog/avro-kafka-data/

https://www.codingblocks.net/programming/why-avro/

https://blog.cloudera.com/robust-message-serialization-in-apache-kafka-using-apache-avro-part-1/

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.