kafka-ts
Version:
**KafkaTS** is a Apache Kafka client library for Node.js. It provides both a low-level API for communicating directly with the Apache Kafka cluster and high-level APIs for publishing and subscribing to Kafka topics.
28 lines (27 loc) • 984 B
TypeScript
import { Cluster } from './cluster';
type MetadataOptions = {
cluster: Cluster;
};
export declare class Metadata {
private options;
private topicPartitions;
private topicNameById;
private topicIdByName;
private leaderIdByTopicPartition;
private isrNodesByTopicPartition;
constructor(options: MetadataOptions);
getTopicPartitionLeaderIds(): Record<string, Record<number, number>>;
getTopicPartitionReplicaIds(): Record<string, Record<number, number[]>>;
getTopicPartitions(): Record<string, number[]>;
getTopicIdByName(name: string): string;
getTopicNameById(id: string): string;
fetchMetadataIfNecessary({ topics, allowTopicAutoCreation, }: {
topics: string[] | Set<string>;
allowTopicAutoCreation: boolean;
}): Promise<void>;
fetchMetadata({ topics, allowTopicAutoCreation, }: {
topics: string[] | Set<string> | null;
allowTopicAutoCreation: boolean;
}): Promise<void>;
}
export {};