public class TopicNameStrategy extends Object implements SubjectNameStrategy, SubjectNameStrategy
SubjectNameStrategy: for any messages published to
<topic>, the schema of the message key is registered under
the subject name <topic>-key, and the message value is registered
under the subject name <topic>-value.| Constructor and Description |
|---|
TopicNameStrategy() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Map<String,?> config) |
String |
getSubjectName(String topic,
boolean isKey,
Object value)
Deprecated.
|
String |
subjectName(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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitusesSchemapublic void configure(Map<String,?> config)
configure in interface org.apache.kafka.common.Configurablepublic String subjectName(String topic, boolean isKey, ParsedSchema schema)
SubjectNameStrategytopic - 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@Deprecated public String getSubjectName(String topic, boolean isKey, Object value)
SubjectNameStrategygetSubjectName in interface SubjectNameStrategytopic - The Kafka topic name to which the message is being published.isKey - True when encoding a message key, false for a message value.value - The value to be published in the message.Copyright © 2025 Confluent, Inc.. All rights reserved.