From 44fbadf4e4ea16a94956aa1f1e6723e59041f55f Mon Sep 17 00:00:00 2001 From: chanyeong Date: Thu, 29 Aug 2024 17:00:32 +0900 Subject: [PATCH] fix: onApplicationBootStrap --- src/kafka/kafka.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kafka/kafka.service.ts b/src/kafka/kafka.service.ts index d29c3d1..1e522db 100644 --- a/src/kafka/kafka.service.ts +++ b/src/kafka/kafka.service.ts @@ -33,10 +33,10 @@ export class KafkaService implements OnApplicationBootstrap, OnModuleDestroy { this.consumer = this.kafka.consumer({ groupId: process.env.CONSUMER_GROUP, }); - this.consumer.connect(); } async onApplicationBootstrap() { + await this.consumer.connect(); await this.consumer.subscribe({ topic: this.topic, fromBeginning: false }); await this.consumer .run({