Kafka Streams的Data Types and Serialization

Avro

<repositories>
    <repository>
        <id>confluent</id>
        <url>http://packages.confluent.io/maven/</url>
    </repository>
    <!-- further repository entries here -->
</repositories>

<dependency>
    <groupId>io.confluent</groupId>
    <artifactId>kafka-streams-avro-serde</artifactId>
    <version>5.3.0</version>
</dependency>

由confluent提供,有GenericAvroSerde,SpecificAvroSerde两种,使用方法参见:Data Types and Serialization

JSON

<dependency>
    <groupId>org.springframework.kafka</groupId>
    <artifactId>spring-kafka</artifactId>
</dependency>

由Spring提供,有JsonSerde,使用方法常见:JSON Serialization and Deserialization  JSON

PS:

  1. 国内Kafka Streams和Kafka Connect的用户群真的不多见,中文资源相对贫乏;
  2. Github上比较好的资源有:Kafka Streams Examples
原文地址:https://www.cnblogs.com/echo1937/p/11340664.html