UNPKG

1.11 kBTypeScriptView Raw
1import { ClientKafka } from '../client/client-kafka';
2import { Cluster, GroupMember, GroupMemberAssignment, GroupState } from '../external/kafka.interface';
3export declare class KafkaReplyPartitionAssigner {
4 private readonly clientKafka;
5 private readonly config;
6 readonly name = "NestReplyPartitionAssigner";
7 readonly version = 1;
8 constructor(clientKafka: ClientKafka, config: {
9 cluster: Cluster;
10 });
11 /**
12 * This process can result in imbalanced assignments
13 * @param {array} members array of members, e.g: [{ memberId: 'test-5f93f5a3' }]
14 * @param {array} topics
15 * @param {Buffer} userData
16 * @returns {array} object partitions per topic per member
17 */
18 assign(group: {
19 members: GroupMember[];
20 topics: string[];
21 }): Promise<GroupMemberAssignment[]>;
22 protocol(subscription: {
23 topics: string[];
24 userData: Buffer;
25 }): GroupState;
26 getPreviousAssignment(): {
27 [key: string]: number;
28 };
29 decodeMember(member: GroupMember): {
30 memberId: string;
31 previousAssignment: any;
32 };
33}