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.
18 lines (17 loc) • 491 B
TypeScript
type TopicPartitionLeader = {
[topicName: string]: {
[partitionId: number]: number;
};
};
type MessagesByNodeTopicPartition<T> = {
[nodeId: number]: {
[topicName: string]: {
[partitionId: number]: T[];
};
};
};
export declare const distributeMessagesToTopicPartitionLeaders: <T extends {
topic: string;
partition: number;
}>(messages: T[], topicPartitionLeader: TopicPartitionLeader) => MessagesByNodeTopicPartition<T>;
export {};