A subject is the Schema Registry name that scopes schema versions for a Kafka topic’s key or value. For example, avro-avengers-value governs the schemas used by values in the avro-avengers topic. Schema Registry assigns each registered schema a unique ID, while the subject organizes its version history. section 3.2.5
Choose a subject naming strategy according to how records are organized:
- TopicNameStrategy uses <topic>-key or <topic>-value, keeping one data type and schema scope per topic. Different topics can use different schemas for the same record type. section 3.3.1
- RecordNameStrategy uses the fully qualified Java class name, allowing related record types in one topic while checking compatibility for the same record name across topics. section 3.3.2
Register and inspect a subject
Register a value schema by posting to /subjects/avro-avengers-value/versions. The response returns a schema ID such as 1. Query /subjects to list subject names, /subjects/avro-avengers-value/versions to list versions, and /subjects/avro-avengers-value/versions/latest to retrieve the current schema. section 3.2.5
Listing 3.5 Registering a schema on the command line
jq '. | {schema: tojson}' src/main/avro/avenger.avsc | \ #1
curl -s -X
POST http://localhost:8081/subjects/avro-avengers-value/versions\ #2
-H "Content-Type: application/vnd.schemaregistry.v1+json" \ #3
-d @- \ #4
| jq #5
Shows the REST registration command and the subject path used for an Avro value schema. section 3.2.5

