From 77ead277396e46fb468369b26e2a8ba1c406ad2f Mon Sep 17 00:00:00 2001 From: Tony133 Date: Tue, 11 Apr 2023 11:09:43 +0200 Subject: [PATCH] chore(): remove method deprecated kafka --- .../microservices/external/kafka.interface.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/microservices/external/kafka.interface.ts b/packages/microservices/external/kafka.interface.ts index 97241f5bb62..ed7a07befb3 100644 --- a/packages/microservices/external/kafka.interface.ts +++ b/packages/microservices/external/kafka.interface.ts @@ -135,6 +135,13 @@ export type LegacyPartitioner = ICustomPartitioner; export let Partitioners: { DefaultPartitioner: DefaultPartitioner; LegacyPartitioner: LegacyPartitioner; + /** + * @deprecated Use DefaultPartitioner instead + * + * The JavaCompatiblePartitioner was renamed DefaultPartitioner + * and made to be the default in 2.0.0. + */ + JavaCompatiblePartitioner: DefaultPartitioner; }; export type PartitionMetadata = { @@ -1024,6 +1031,13 @@ export type ConsumerRunConfig = { eachMessage?: EachMessageHandler; }; +/** + * @deprecated Replaced by ConsumerSubscribeTopics + */ +export type ConsumerSubscribeTopic = { + topic: string | RegExp; + fromBeginning?: boolean; +}; export type ConsumerSubscribeTopics = { topics: (string | RegExp)[]; fromBeginning?: boolean; @@ -1032,7 +1046,9 @@ export type ConsumerSubscribeTopics = { export type Consumer = { connect(): Promise; disconnect(): Promise; - subscribe(subscription: ConsumerSubscribeTopics): Promise; + subscribe( + subscription: ConsumerSubscribeTopics | ConsumerSubscribeTopic, + ): Promise; stop(): Promise; run(config?: ConsumerRunConfig): Promise; commitOffsets(