@qualithm/kafka-client - v0.1.6
    Preparing search index...

    Class KafkaAdmin

    Kafka admin client.

    Performs administrative operations on topics and cluster configuration. Operates through the ConnectionPool and negotiates API versions automatically.

    const admin = new KafkaAdmin({ connectionPool: kafka.connectionPool })
    await admin.createTopics({
    topics: [{ name: "my-topic", numPartitions: 3, replicationFactor: 1 }],
    timeoutMs: 30000,
    })
    const topics = await admin.listTopics()
    await admin.close()
    Index

    Constructors

    Methods

    • Close the admin client.

      After closing, no more operations can be performed.

      Returns void

    • Delete records from topic partitions up to specified offsets.

      Records before the specified offset in each partition are deleted (the log start offset is advanced). Use offset -1 to delete up to the high watermark.

      Parameters

      Returns Promise<readonly DeleteRecordsTopicResponse[]>

      Per-topic/partition deletion results.

      If connection or version negotiation fails.

    • Describe specific topics using the Metadata API.

      Parameters

      • topicNames: readonly string[]

        Topic names to describe.

      Returns Promise<readonly MetadataTopic[]>

      Topic metadata including partitions and leaders.

      If connection or decoding fails.

    • List all topics in the cluster.

      Uses the Metadata API with a null topics list to discover all topics. Internal topics (e.g. __consumer_offsets) are included.

      Returns Promise<readonly TopicInfo[]>

      Array of topic info objects.

      If connection or decoding fails.