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.
JavaScript
TypeScript
TypeScript
const app = await NestFactory.createMicroservice(ApplicationModule, {
transport: Transport.REDIS,
url: 'redis://localhost:6379',
});
Hint Don't forget to change theTransport.REDISin the@Client()decorator too.