Backward Comaptibility issue and uncertainity in Schema Registry

后端 未结 1 1572
遥遥无期
遥遥无期 2021-01-25 08:43

I have a use case where I have a JSON and I want to generate schema and record out of the JSON and publish a record. I have configured the value serializer and Schema setting is

相关标签:
1条回答
  • 2021-01-25 09:27

    Let's go over the backwards compatibility rules... https://docs.confluent.io/current/schema-registry/avro.html#compatibility-types

    First, the default isn't transitive, so version 3 only will look at version 2.

    The backwards rule states you can delete fields or add optional fields (those with a default). I assume your schema generator tool doesn't know how to use optionals, so you're only allowed to delete, not add.

    Between version 1 and 2, you've deleted the name field, which is valid.

    Between version 2 and the incoming 3, it thinks you're trying to post a new schema which removes price (this is okay}, but adds a required name field, which is not allowed.

    0 讨论(0)
提交回复
热议问题