Class KafkaSchemaRegistryClient
- java.lang.Object
-
- dev.lydtech.component.framework.client.kafka.KafkaSchemaRegistryClient
-
public class KafkaSchemaRegistryClient extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KafkaSchemaRegistryClientgetInstance()protected StringgetSchemaRegistryBaseUrl()intregisterSchema(String topic, String schema)Register the schema derived from the avro generated class.voidresetSchemaRegistry()Deletes registered schemas from the registry.
-
-
-
Method Detail
-
getInstance
public static KafkaSchemaRegistryClient getInstance()
-
getSchemaRegistryBaseUrl
protected String getSchemaRegistryBaseUrl()
-
resetSchemaRegistry
public void resetSchemaRegistry() throws ExceptionDeletes registered schemas from the registry.- Throws:
Exception
-
registerSchema
public int registerSchema(String topic, 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()- Parameters:
topic- the topic name for the event schema being registeredschema- the schema JSON string- Returns:
- schemaId the schemaId used to register this Avro schema
- Throws:
Exception
-
-