Class 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
      void close()  
      static SchemaTopicClient create​(java.util.Properties configs, java.lang.String schemaRegistryUrl, java.time.Duration timeout)
      Creates a new SchemaTopicClient using the specified configuration.
      static io.confluent.kafka.schemaregistry.client.CachedSchemaRegistryClient createSchemaRegistryClient​(@NonNull java.util.Map<java.lang.Object,​java.lang.Object> configs, @NonNull java.lang.String schemaRegistryUrl)
      Creates a new CachedSchemaRegistryClient using the specified configuration.
      void deleteTopicAndResetSchemaRegistry​(java.lang.String topic)
      Delete a topic if it exists and reset the corresponding schema registry subjects.
      void resetSchemaRegistry​(java.lang.String topic)
      Delete key and value schemas associated with a topic from the schema registry.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 new SchemaTopicClient using the specified configuration.
        Parameters:
        configs - properties passed to AdminClient.create(Properties)
        schemaRegistryUrl - URL of schema registry
        timeout - 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 new CachedSchemaRegistryClient using the specified configuration.
        Parameters:
        configs - properties passed to CachedSchemaRegistryClient(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:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable