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.
24 lines (23 loc) • 686 B
TypeScript
import { Cluster } from '../cluster';
import { Partitioner } from '../distributors/partitioner';
import { Message } from '../types';
export type ProducerOptions = {
allowTopicAutoCreation?: boolean;
partitioner?: Partitioner;
maxBatchSize?: number;
};
export declare class Producer {
private cluster;
private options;
private metadata;
private state;
private partition;
private chain;
private bufferByNodeId;
constructor(cluster: Cluster, options: ProducerOptions);
send(messages: Message[]): Promise<void>;
close(): Promise<void>;
private ensureProducerInitialized;
private fetchMetadataForTopics;
private handleError;
}