From af896db36c81085f2cec04def2e006d6c358b643 Mon Sep 17 00:00:00 2001 From: hailin Date: Tue, 9 Dec 2025 03:04:48 -0800 Subject: [PATCH] fix(mpc-service): don't await consumer.run() to prevent app startup blocking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit consumer.run() never resolves as it runs continuously. Awaiting it blocks onApplicationBootstrap which prevents app.listen() from being called, causing the service to never start listening on port 3006. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../application/services/event-consumer-starter.service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/services/mpc-service/src/application/services/event-consumer-starter.service.ts b/backend/services/mpc-service/src/application/services/event-consumer-starter.service.ts index e7d4f092..bf2b6bf6 100644 --- a/backend/services/mpc-service/src/application/services/event-consumer-starter.service.ts +++ b/backend/services/mpc-service/src/application/services/event-consumer-starter.service.ts @@ -16,7 +16,11 @@ export class EventConsumerStarterService implements OnApplicationBootstrap { async onApplicationBootstrap() { try { - await this.eventConsumer.startConsuming(); + // Don't await - consumer.run() never resolves (it runs continuously) + // Just fire and forget, let it run in the background + this.eventConsumer.startConsuming().catch((error) => { + this.logger.error('Kafka consumer error', error); + }); this.logger.log('MPC event consumers started successfully'); } catch (error) { this.logger.error('Failed to start MPC event consumers', error);