TIL

10.2 카프카와 스키마 레지스트리

10.2.1 스키마 레지스트리 개요

graph LR
    subgraph 프로듀서
        Producer
    end
    subgraph 스키마 레지스트리
        SchemaRegistry
    end
    subgraph 카프카
        Kafka
    end
    subgraph 컨슈머
        Consumer
    end

    Producer -- 메시지 전송 --> Kafka
    Producer -- 스키마 등록 --> SchemaRegistry
    SchemaRegistry -- 스키마 저장 --> Kafka
    SchemaRegistry -- 스키마 읽기 --> Consumer
    Kafka -- 메시지 읽기 --> Consumer

10.2.2 스키마 레지스트리의 에이브로 지원

{ 
  "namespace": "student.avro",
  "type": "record",
  "doc": "This is example of Avro."
  "name": "Student",
  "fields": [
    {
      "name": "student_id",
      "type": "string"
    },
    {
      "name": "name",
      "type": "string"
    },
    {
      "name": "age",
      "type": "int"
    },
    {
      "name": "email",
      "type": ["null", "string"],
      "default": null
    }
  ]
}