Class AdminClient

java.lang.Object
org.oracle.okafka.clients.admin.AdminClient
All Implemented Interfaces:
AutoCloseable, org.apache.kafka.clients.admin.Admin, Admin
Direct Known Subclasses:
KafkaAdminClient

@Evolving public abstract class AdminClient extends Object implements Admin
The administrative client for Transactional Event Queues(TXEQ), which supports managing and inspecting topics. For this release only creation of topic(s) and deletion of topic(s) is supported. A topic can be created by invoking #createTopics(Collection) and deleted by invoking #deleteTopics(Collection) method.

Topic can be created with following configuration.

retention.ms: Amount of time in milliseconds for which records stay in topic and are available for consumption. Internally, retention.ms value is rounded to the second. Default value for this parameter is 7 days.

  • Constructor Details

    • AdminClient

      public AdminClient()
  • Method Details

    • create

      public static AdminClient create(Properties props)
      Description copied from interface: Admin
      Create a new Admin with the given configuration.
      Parameters:
      props - The configuration.
      Returns:
      The new KafkaAdminClient.
    • create

      public static AdminClient create(Map<String,Object> conf)
      Create a new AdminClient with the given configuration.
      Parameters:
      conf - The configuration.
      Returns:
      The new KafkaAdminClient.
    • close

      public void close()
      Close the AdminClient and release all associated resources. See close(long, TimeUnit)
      Specified by:
      close in interface org.apache.kafka.clients.admin.Admin
      Specified by:
      close in interface Admin
      Specified by:
      close in interface AutoCloseable
    • close

      public abstract void close(long duration, TimeUnit unit)
      Close the AdminClient and release all associated resources. The close operation has a grace period during which current operations will be allowed to complete, specified by the given duration and time unit. New operations will not be accepted during the grace period. Once the grace period is over, all operations that have not yet been completed will be aborted with a TimeoutException.
      Specified by:
      close in interface Admin
      Parameters:
      duration - The duration to use for the wait time.
      unit - The time unit to use for the wait time.
    • createTopics

      public org.apache.kafka.clients.admin.CreateTopicsResult createTopics(Collection<org.apache.kafka.clients.admin.NewTopic> newTopics)
      Create a batch of new topics .This call supports only retention.ms option for topic creation. This operation is not transactional so it may succeed for some topics while fail for others. This method is not supported in preview release.
      Specified by:
      createTopics in interface org.apache.kafka.clients.admin.Admin
      Specified by:
      createTopics in interface Admin
      Parameters:
      newTopics - The new topics to create.
      Returns:
      The CreateTopicsResult.
    • createTopics

      public abstract org.apache.kafka.clients.admin.CreateTopicsResult createTopics(Collection<org.apache.kafka.clients.admin.NewTopic> newTopics, org.apache.kafka.clients.admin.CreateTopicsOptions options)
      Create a batch of new topics. This call supports only retention.ms option for topic creation. This operation is not transactional so it may succeed for some topics while fail for others. This method is not supported in preview release.
      Specified by:
      createTopics in interface org.apache.kafka.clients.admin.Admin
      Specified by:
      createTopics in interface Admin
      Parameters:
      newTopics - The new topics to create.
      options - The options to use when creating the new topics.
      Returns:
      The CreateTopicsResult.
    • deleteTopics

      public org.apache.kafka.clients.admin.DeleteTopicsResult deleteTopics(Collection<String> topics)
      Delete a batch of topics. This call doen't consider options for topic deletion. This operation is not transactional so it may succeed for some topics while fail for others.
      Specified by:
      deleteTopics in interface org.apache.kafka.clients.admin.Admin
      Specified by:
      deleteTopics in interface Admin
      Parameters:
      topics - The topic names to delete.
      Returns:
      The DeleteTopicsResult.
    • deleteTopics

      public abstract org.apache.kafka.clients.admin.DeleteTopicsResult deleteTopics(Collection<String> topics, org.apache.kafka.clients.admin.DeleteTopicsOptions options)
      Delete a batch of topics. This call doen't consider options for topic deletion. This operation is not transactional so it may succeed for some topics while fail for others. delete.topic.enable is true in Oracle TEQ.
      Specified by:
      deleteTopics in interface org.apache.kafka.clients.admin.Admin
      Specified by:
      deleteTopics in interface Admin
      Parameters:
      topics - The topic names to delete.
      options - The options to use when deleting the topics.
      Returns:
      The DeleteTopicsResult.