diff --git a/apps/edr-passenger-api/src/modules/payments/payments.module.ts b/apps/edr-passenger-api/src/modules/payments/payments.module.ts index 056986613..ea5fc0af3 100644 --- a/apps/edr-passenger-api/src/modules/payments/payments.module.ts +++ b/apps/edr-passenger-api/src/modules/payments/payments.module.ts @@ -1,60 +1,67 @@ import { Module } from "@nestjs/common"; import { HttpModule } from "@nestjs/axios"; -import { ConfigService } from "@nestjs/config"; -import { RabbitMQModule } from "@golevelup/nestjs-rabbitmq"; -import { - PAYMENT_EVENTS_DLX, - PAYMENT_EVENTS_EXCHANGE, - PAYMENT_QUEUES, - PaymentService, - paymentServiceBindingPattern, -} from "@edr/types"; +// --- TEMPORARILY DISABLED: payment-event RabbitMQ consumer ---------------------------------- +// The payment broker is currently unreachable (DevOps is fixing it). @golevelup awaits the +// @RabbitSubscribe registration during bootstrap, so an unreachable broker hangs the whole API +// and it never finishes starting. Disabled so the server boots without the broker. +// TO RE-ENABLE (once the broker is back): uncomment the imports below, the RabbitMQModule entry +// in `imports`, and PaymentEventsConsumer in `providers`. +// import { ConfigService } from "@nestjs/config"; +// import { RabbitMQModule } from "@golevelup/nestjs-rabbitmq"; +// import { +// PAYMENT_EVENTS_DLX, +// PAYMENT_EVENTS_EXCHANGE, +// PAYMENT_QUEUES, +// PaymentService, +// paymentServiceBindingPattern, +// } from "@edr/types"; import { PaymentsController } from "./payments.controller"; import { PaymentsService } from "./payments.service"; import { InternalPaymentsController } from "./internal-payments.controller"; import { PaymentClientService } from "./payment-client.service"; -import { PaymentEventsConsumer } from "./payment-events.consumer"; +// import { PaymentEventsConsumer } from "./payment-events.consumer"; import { ServiceAuthGuard } from "../../common/guards/service-auth.guard"; import { SeatsModule } from "../seats/seats.module"; import { TicketsModule } from "../tickets/tickets.module"; -const PASSENGER_QUEUE = PAYMENT_QUEUES[PaymentService.PASSENGER]; +// const PASSENGER_QUEUE = PAYMENT_QUEUES[PaymentService.PASSENGER]; @Module({ imports: [ SeatsModule, TicketsModule, HttpModule.register({ timeout: 10_000 }), - RabbitMQModule.forRootAsync({ - inject: [ConfigService], - useFactory: (config: ConfigService) => ({ - uri: config.get("rabbitmq.url") as string, - exchanges: [ - { - name: PAYMENT_EVENTS_EXCHANGE, - type: "topic", - options: { durable: true }, - }, - { name: PAYMENT_EVENTS_DLX, type: "topic", options: { durable: true } }, - ], - queues: [ - { - name: PASSENGER_QUEUE.dlq, - exchange: PAYMENT_EVENTS_DLX, - routingKey: paymentServiceBindingPattern(PaymentService.PASSENGER), - options: { durable: true }, - }, - ], - prefetchCount: config.get("rabbitmq.prefetch") ?? 10, - connectionInitOptions: { wait: false }, - }), - }), + // --- TEMPORARILY DISABLED (broker unreachable) — re-enable with the imports above. ------- + // RabbitMQModule.forRootAsync({ + // inject: [ConfigService], + // useFactory: (config: ConfigService) => ({ + // uri: config.get("rabbitmq.url") as string, + // exchanges: [ + // { + // name: PAYMENT_EVENTS_EXCHANGE, + // type: "topic", + // options: { durable: true }, + // }, + // { name: PAYMENT_EVENTS_DLX, type: "topic", options: { durable: true } }, + // ], + // queues: [ + // { + // name: PASSENGER_QUEUE.dlq, + // exchange: PAYMENT_EVENTS_DLX, + // routingKey: paymentServiceBindingPattern(PaymentService.PASSENGER), + // options: { durable: true }, + // }, + // ], + // prefetchCount: config.get("rabbitmq.prefetch") ?? 10, + // connectionInitOptions: { wait: false }, + // }), + // }), ], controllers: [PaymentsController, InternalPaymentsController], providers: [ PaymentsService, PaymentClientService, - PaymentEventsConsumer, + // PaymentEventsConsumer, // TEMPORARILY DISABLED — re-enable with RabbitMQModule above. ServiceAuthGuard, ], })