Interface SubjectNameStrategy

All Superinterfaces:
org.apache.kafka.common.Configurable
All Known Implementing Classes:
AssociatedNameStrategy, RecordNameStrategy, TopicNameStrategy, TopicRecordNameStrategy

public interface SubjectNameStrategy extends org.apache.kafka.common.Configurable
A SubjectNameStrategy is used by the serializer to determine the subject name under which the event record schemas should be registered in the schema registry. The default is TopicNameStrategy.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Set the schema registry client.
    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.
    default boolean
    Whether the strategy depends on the schema.

    Methods inherited from interface org.apache.kafka.common.Configurable

    configure
  • Method Details

    • setSchemaRegistryClient

      default void setSchemaRegistryClient(SchemaRegistryClient client)
      Set the schema registry client.
    • usesSchema

      default boolean usesSchema()
      Whether the strategy depends on the schema.
      Returns:
      Whether the strategy depends on the schema.
    • subjectName

      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.
      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.