liveBook · Manning

Topic record name strategy

As explained in Kafka for Architects

TopicRecordNameStrategy is a Schema Registry subject-naming strategy that combines topic association with fully qualified record names.

TopicRecordNameStrategy is a hybrid Schema Registry subject-naming strategy. It associates each subject with a specific topic while retaining the record’s fully qualified name, allowing multiple event types to coexist in one topic and evolve independently. section 6.4.3

Client events in one topic

Registering com.example.ClientEvent for the CLIENTS topic produces the subject CLIENTS-com.example.ClientEvent. Other event types can share CLIENTS under distinct subjects, while each schema evolves independently within that topic. section 6.4.3

Listing 6.10 An example of the client event in Avro format
{
  "type": "record",
  "name": "ClientEvent",
  "namespace": "com.example",
  "fields": [
    {
      "name": "eventId",
      "type": "string",
      "doc": "Unique identifier for the event"
    },
    {
      "name": "eventType",
      "type": "string",
      "doc": "Type of event (e.g., 'ClientCreated', 'ClientUpdated')"
    },
    {
      "name": "timestamp",
      "type": "long",
      "logicalType": "timestamp-millis",
      "doc": "Event timestamp in milliseconds"
    },
    {
      "name": "clientId",
      "type": "string",
      "doc": "Unique identifier for the client"
    },
    {
      "name": "clientName",
      "type": "string",
      "doc": "Name of the client"
    }
  ]
}

An Avro ClientEvent record illustrates the fully qualified name and the eventId, eventType, timestamp, clientId, and clientName fields carried by the example. section 6.4.3

How Kafka for Architects covers it

How deep it goes
Defines subject composition and coexistence behavior, but stops short of configuration or implementation walkthroughs.
Examples
Uses the CLIENTS topic, com.example.ClientEvent schema, and an Avro record containing client and event fields.
What it assumes
Assumes familiarity with topics, schemas, fully qualified record names, and Schema Registry subject naming.
What you can do after
Evaluate whether multiple event types can share a topic while retaining distinct, independently evolving subjects.
How it connects
Combines TopicNameStrategy and RecordNameStrategy through Schema Registry subjects and polyglot topics.

Also explained in

Compare how 2 books explain topic record name strategy →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kafka for Architects. The section links point to the parts of the book it draws on.