1 | import { Logger } from '@nestjs/common/services/logger.service';
|
2 | import { BrokersFunction, Consumer, ConsumerGroupJoinEvent, EachMessagePayload, Kafka, Producer, TopicPartitionOffsetAndMetadata } from '../external/kafka.interface';
|
3 | import { KafkaParser } from '../helpers';
|
4 | import { KafkaOptions, OutgoingEvent, ReadPacket, WritePacket } from '../interfaces';
|
5 | import { ClientProxy } from './client-proxy';
|
6 | export declare class ClientKafka extends ClientProxy {
|
7 | protected readonly options: KafkaOptions['options'];
|
8 | protected logger: Logger;
|
9 | protected client: Kafka;
|
10 | protected consumer: Consumer;
|
11 | protected producer: Producer;
|
12 | protected parser: KafkaParser;
|
13 | protected responsePatterns: string[];
|
14 | protected consumerAssignments: {
|
15 | [key: string]: number;
|
16 | };
|
17 | protected brokers: string[] | BrokersFunction;
|
18 | protected clientId: string;
|
19 | protected groupId: string;
|
20 | protected producerOnlyMode: boolean;
|
21 | constructor(options: KafkaOptions['options']);
|
22 | subscribeToResponseOf(pattern: any): void;
|
23 | close(): Promise<void>;
|
24 | connect(): Promise<Producer>;
|
25 | bindTopics(): Promise<void>;
|
26 | createClient<T = any>(): T;
|
27 | createResponseCallback(): (payload: EachMessagePayload) => any;
|
28 | getConsumerAssignments(): {
|
29 | [key: string]: number;
|
30 | };
|
31 | protected dispatchEvent(packet: OutgoingEvent): Promise<any>;
|
32 | protected getReplyTopicPartition(topic: string): string;
|
33 | protected publish(partialPacket: ReadPacket, callback: (packet: WritePacket) => any): () => void;
|
34 | protected getResponsePatternName(pattern: string): string;
|
35 | protected setConsumerAssignments(data: ConsumerGroupJoinEvent): void;
|
36 | protected initializeSerializer(options: KafkaOptions['options']): void;
|
37 | protected initializeDeserializer(options: KafkaOptions['options']): void;
|
38 | commitOffsets(topicPartitions: TopicPartitionOffsetAndMetadata[]): Promise<void>;
|
39 | }
|