Redis
A second built-in transporter is based on Redis database. This transporter takes advantage of publish/subscribe feature.

Installation
Before we start, we have to install required package:
$ npm i --save redisOverview
In order to switch from TCP transport strategy to Redis pub/sub, we need to change an options object passed to the createMicroservice() method.
JS TS
TypeScript
const app = await NestFactory.createMicroservice(ApplicationModule, {
transport: Transport.REDIS,
options: {
url: 'redis://localhost:6379',
},
});Options
There are a bunch of available options that determine a transporter behaviour.
url | Connection url |
retryAttempts | A total amount of connection attempts |
retryDelay | A connection retrying delay (ms) |
