Class TopicRecordNameStrategy
java.lang.Object
io.confluent.kafka.serializers.subject.RecordNameStrategy
io.confluent.kafka.serializers.subject.TopicRecordNameStrategy
- All Implemented Interfaces:
SubjectNameStrategy,org.apache.kafka.common.Configurable
For any record type that is published to Kafka topic <topic>,
registers the schema in the registry under the subject name
<topic>-<recordName>, where <recordName> is the
fully-qualified record name. This strategy allows a topic to contain
a mixture of different record types, since no intra-topic compatibility
checking is performed. Moreover, different topics may contain mutually
incompatible versions of the same record name, since the compatibility
check is scoped to a particular record name within a particular topic.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsubjectName(String topic, boolean isKey, ParsedSchema schema) For a given topic and message, returns the subject name under which the schema should be registered in the schema registry.booleanWhether the strategy depends on the schema.Methods inherited from class io.confluent.kafka.serializers.subject.RecordNameStrategy
configure, getRecordName
-
Constructor Details
-
TopicRecordNameStrategy
public TopicRecordNameStrategy()
-
-
Method Details
-
usesSchema
public boolean usesSchema()Description copied from interface:SubjectNameStrategyWhether the strategy depends on the schema.- Specified by:
usesSchemain interfaceSubjectNameStrategy- Overrides:
usesSchemain classRecordNameStrategy- Returns:
- Whether the strategy depends on the schema.
-
subjectName
Description copied from interface:SubjectNameStrategyFor a given topic and message, returns the subject name under which the schema should be registered in the schema registry.- Specified by:
subjectNamein interfaceSubjectNameStrategy- Overrides:
subjectNamein classRecordNameStrategy- Parameters:
topic- The Kafka topic name to which the message is being published.isKey- True when encoding a message key, false for a message value.schema- the schema of the record being serialized/deserialized- Returns:
- The subject name under which the schema should be registered.
-