This commit is contained in:
sbriat 2023-02-01 14:57:48 +01:00
parent a75ca09720
commit 62fbcab34a
1 changed files with 11 additions and 11 deletions

View File

@ -1,4 +1,4 @@
import { RabbitMQModule } from '@golevelup/nestjs-rabbitmq';
import { RabbitMQConfig, RabbitMQModule } from '@golevelup/nestjs-rabbitmq';
import { RedisModule, RedisModuleOptions } from '@liaoliaots/nestjs-redis';
import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
@ -17,18 +17,19 @@ import { SetConfigurationUseCase } from './domain/usecases/set-configuration.use
inject: [ConfigService],
useFactory: async (
configService: ConfigService,
): Promise<RedisModuleOptions> => {
return {
): Promise<RedisModuleOptions> => ({
config: {
host: configService.get<string>('REDIS_HOST'),
port: configService.get<number>('REDIS_PORT'),
},
};
},
}),
}),
RabbitMQModule.forRootAsync(RabbitMQModule, {
imports: [ConfigModule],
useFactory: async (configService: ConfigService) => ({
inject: [ConfigService],
useFactory: async (
configService: ConfigService,
): Promise<RabbitMQConfig> => ({
exchanges: [
{
name: 'configuration',
@ -39,7 +40,6 @@ import { SetConfigurationUseCase } from './domain/usecases/set-configuration.use
connectionInitOptions: { wait: false },
enableControllerDiscovery: true,
}),
inject: [ConfigService],
}),
],
controllers: [ConfigurationMessagerController],