ngATL Conference Atlanta, GA

NestJS on 2018 ngATL Conference Atlanta, GA

NestJS 2018 ngATL

LEARN MORE

Redis

There's' another way to play with the Nest microservices. Instead of TCP communication, we can use the great Redis feature – the publish / subscribe.

To switch from the TCP transport strategy to Redis pub/sub, we only need to change the options object passed to the createMicroservice() method.

main.ts
JavaScript TypeScript
TypeScript

const app = await NestFactory.createMicroservice(ApplicationModule, {
  transport: Transport.REDIS,
  url: 'redis://localhost:6379',
});
Hint Don't forget to change the Transport.REDIS in the @Client() decorator too.

Sponsors

Nest is an MIT-licensed open source project. It can grow thanks to the support by these awesome people. If you'd like to join them, please read more here. Thanks!

Become a sponsor