Package com.bakdata.kafka.util
Class SchemaTopicClient
- java.lang.Object
-
- com.bakdata.kafka.util.SchemaTopicClient
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public final class SchemaTopicClient extends java.lang.Object implements java.io.Closeable
-
-
Constructor Summary
Constructors Constructor Description SchemaTopicClient(@NonNull TopicClient topicClient, @NonNull io.confluent.kafka.schemaregistry.client.SchemaRegistryClient schemaRegistryClient)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static SchemaTopicClientcreate(java.util.Properties configs, java.lang.String schemaRegistryUrl, java.time.Duration timeout)Creates a newSchemaTopicClientusing the specified configuration.static io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClientcreateSchemaRegistryClient(@NonNull java.util.Map<java.lang.Object,java.lang.Object> configs, @NonNull java.lang.String schemaRegistryUrl)Creates a newCachedSchemaRegistryClientusing the specified configuration.voiddeleteTopicAndResetSchemaRegistry(java.lang.String topic)Delete a topic if it exists and reset the corresponding schema registry subjects.voidresetSchemaRegistry(java.lang.String topic)Delete key and value schemas associated with a topic from the schema registry.
-
-
-
Constructor Detail
-
SchemaTopicClient
public SchemaTopicClient(@NonNull @NonNull TopicClient topicClient, @NonNull @NonNull io.confluent.kafka.schemaregistry.client.SchemaRegistryClient schemaRegistryClient)
-
-
Method Detail
-
create
public static SchemaTopicClient create(java.util.Properties configs, java.lang.String schemaRegistryUrl, java.time.Duration timeout)
Creates a newSchemaTopicClientusing the specified configuration.- Parameters:
configs- properties passed toAdminClient.create(Properties)schemaRegistryUrl- URL of schema registrytimeout- timeout for waiting for Kafka admin calls- Returns:
SchemaTopicClient
-
createSchemaRegistryClient
public static io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient createSchemaRegistryClient(@NonNull @NonNull java.util.Map<java.lang.Object,java.lang.Object> configs, @NonNull @NonNull java.lang.String schemaRegistryUrl)Creates a newCachedSchemaRegistryClientusing the specified configuration.- Parameters:
configs- properties passed toCachedSchemaRegistryClient(String, int, Map)schemaRegistryUrl- URL of schema registry- Returns:
CachedSchemaRegistryClient
-
deleteTopicAndResetSchemaRegistry
public void deleteTopicAndResetSchemaRegistry(java.lang.String topic)
Delete a topic if it exists and reset the corresponding schema registry subjects.- Parameters:
topic- the topic name
-
resetSchemaRegistry
public void resetSchemaRegistry(java.lang.String topic)
Delete key and value schemas associated with a topic from the schema registry.- Parameters:
topic- the topic name
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-