rwadurian/backend/services/mpc-service/src/application
hailin c05722bbb3 fix(mpc-service): enable shutdown hooks for graceful Kafka disconnect
Root cause: When mpc-service restarts, the old Kafka consumer doesn't
properly disconnect, causing the broker to wait for sessionTimeout
(~5 minutes) before completing rebalance. This blocks app startup.

Solution: Enable NestJS shutdown hooks with app.enableShutdownHooks().
This ensures onModuleDestroy() is called on SIGTERM/SIGINT, which calls
consumer.disconnect() and allows immediate rebalance on next startup.

Also reverted the "don't await consumer.run()" workaround since the
proper fix is graceful shutdown.

Sources:
- https://github.com/tulios/kafkajs/issues/807
- https://kafka.js.org/docs/consuming

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-09 03:12:33 -08:00
..
event-handlers feat(mnemonic): propagate accountSequence through MPC keygen flow (DDD) 2025-12-08 01:08:27 -08:00
services fix(mpc-service): enable shutdown hooks for graceful Kafka disconnect 2025-12-09 03:12:33 -08:00
application.module.ts feat: add event-driven communication between identity-service and mpc-service 2025-12-06 18:17:44 -08:00