Class SchemaRegistryAppUtils

java.lang.Object
com.bakdata.kafka.SchemaRegistryAppUtils

public final class SchemaRegistryAppUtils extends Object
Utility class that provides helpers for removing schemas associated with topics
  • Method Details

    • createSchemaRegistryClient

      public static Optional<io.confluent.kafka.schemaregistry.client.SchemaRegistryClient> createSchemaRegistryClient(Map<String,Object> kafkaProperties)
      Creates a new SchemaRegistryClient using the specified configuration if AbstractKafkaSchemaSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG is configured.
      Parameters:
      kafkaProperties - properties for creating SchemaRegistryClient
      Returns:
      SchemaRegistryClient if AbstractKafkaSchemaSerDeConfig.SCHEMA_REGISTRY_URL_CONFIG is configured
      See Also:
    • createSchemaRegistryClient

      public static io.confluent.kafka.schemaregistry.client.SchemaRegistryClient createSchemaRegistryClient(@NonNull @NonNull Map<String,Object> configs, @NonNull @NonNull String schemaRegistryUrl)
      Creates a new SchemaRegistryClient using the specified configuration.
      Parameters:
      configs - properties passed to SchemaRegistryClientFactory.newClient(String, int, List, Map, Map)
      schemaRegistryUrl - URL of schema registry
      Returns:
      SchemaRegistryClient
    • createTopicHook

      public static Optional<HasTopicHooks.TopicHook> createTopicHook(Map<String,Object> kafkaProperties)
      Create a hook that cleans up schemas associated with a topic. It is expected that all necessary properties to create a SchemaRegistryClient are part of kafkaProperties.
      Parameters:
      kafkaProperties - Kafka properties to create hook from
      Returns:
      hook that cleans up schemas associated with a topic
      See Also:
    • createTopicHook

      public static Optional<HasTopicHooks.TopicHook> createTopicHook(AppConfiguration<?> configuration)
      Create a hook that cleans up schemas associated with a topic. It is expected that all necessary properties to create a SchemaRegistryClient are part of AppConfiguration.getKafkaProperties().
      Parameters:
      configuration - Configuration to create hook from
      Returns:
      hook that cleans up schemas associated with a topic
      See Also: