Class KafkaSchemaRegistryClient


  • public class KafkaSchemaRegistryClient
    extends Object
    • Method Detail

      • getSchemaRegistryBaseUrl

        protected String getSchemaRegistryBaseUrl()
      • resetSchemaRegistry

        public void resetSchemaRegistry()
                                 throws Exception
        Deletes registered schemas from the registry.
        Throws:
        Exception
      • registerSchema

        public int registerSchema​(String subject,
                                  String schema)
                           throws Exception
        Register the schema derived from the avro generated class. To get the schema, call getClassSchema() on the Avro generated class. e.g. SendPayment.getClassSchema().toString() The subject is calculated from the Class. The hyphenated lower case String based on the avro generated class name, with a "-value" suffix. e.g. SendPayment is send-payment-value.
        Parameters:
        subject - the subject (topic name) of the schema being registered
        schema - the schema JSON string
        Returns:
        schemaId the schemaId used to register this Avro schema
        Throws:
        Exception