Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

201
Vistas
Connecting Redis microservice in NestJS causes app to get stuck

I'm trying to set up a simple hybrid app using Nest's documentation, but the app gets stuck without throwing.

main.ts

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { Logger } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { MicroserviceOptions, Transport } from '@nestjs/microservices';

const logger = new Logger('Main');

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  const configService = app.get(ConfigService);
  const redisConfig = configService.get('database.redis');

  app.connectMicroservice<MicroserviceOptions>({
    transport: Transport.REDIS,
    options: {
      url: `redis://${redisConfig.host}:${redisConfig.port}`,
    },
  });

  await app.startAllMicroservices();
  await app.listen(configService.get('app.port'));
}

bootstrap()
  .then(() => logger.log('App running'))
  .catch((e) => logger.error(e));

When I comment out app.startAllMicroservices() or the code connecting the microservice, the App running line is logged, with it, the app is stuck.

I am 100% certain Redis is up and running and responsive, I am using Bull which uses the same config and it runs just fine.

I have tried commenting out everything irrelevant to the above (everything besides the ConfigModule) in the app.module to no avail. Any help would be appreciated.

I am running the latest version of NestJS and its peer dependencies.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Just resolved a similar issue. As per the time of writing downgrade redis npm package to ^3 from anything high i.e ^4.

From nestjs microservice redis docs To start building Redis-based microservices, first install the required package (note as of now the supported Redis version is ^3, not the latest ^4):

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda