UNPKG

@rxap/nest-amqp

Version:
23 lines (22 loc) 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ClientRmqExchangeModuleOptionsFactory = void 0; const client_rmq_exchange_1 = require("./client-rmq-exchange"); const rabbitmq_options_factory_1 = require("./rabbitmq-options-factory"); class ClientRmqExchangeModuleOptionsFactory extends rabbitmq_options_factory_1.RabbitmqOptionsFactory { async createClientOptions(name = this.config.getOrThrow('RABBITMQ_EXCHANGE_NAME'), type = this.config.get('RABBITMQ_EXCHANGE_TYPE', 'topic')) { const options = await this.build(); this.logger.debug(`Using exchange '${name}' with type '${type}'`, 'ClientRmqExchangeModuleOptionsFactory'); return { customClass: client_rmq_exchange_1.ClientRMQExchange, options: { ...options, exchange: { name, type, }, }, }; } } exports.ClientRmqExchangeModuleOptionsFactory = ClientRmqExchangeModuleOptionsFactory;