A subject name strategy determines how Schema Registry derives subjects and therefore where it checks schema compatibility. Treat the strategy as a function of the topic name and record schema. section 3.3 section 3.3.3
Choose among three scopes:
- TopicNameStrategy uses the topic name and ignores the record schema; it may allow multiple types in a topic and supports different object versions across topics. section 3.3.3
- RecordNameStrategy uses the fully qualified record name, so schemas with the same record name are checked together across every topic using that subject. All those topics must use the same schema. section 3.3.2
- TopicRecordNameStrategy uses both topic and record name, allowing multiple event types in a topic and different schema versions for the same type across topics. section 3.3.3
Configure a record-scoped subject
For an Avro AvengerAvro record, configure both producer and consumer value serializers or deserializers with RecordNameStrategy. Configure key strategies only when keys use schemas, and remember that key and value strategies may differ. section 3.3.2
Figure 3.7 RecordNameStrategy enforces having the same schema for a domain object across different topics.
Use the diagram to see how RecordNameStrategy enforces one schema for a domain object across different topics. section 3.3.2
