Redis
Redis can be used as a message transport by installing the @node-ts/bus-redis package. This will configure Redis to use lists as de-facto message queues and route messages according to your application handlers.

Installation

Install the @node-ts/bus-redis package
1
npm install @node-ts/bus-redis
Copied!
Configure the Redis transport and provide it to the bus configuration
1
import { Bus } from '@node-ts/bus-core'
2
import { RedisTransport, RedisTransportConfiguration } from '@node-ts/bus-redis'
3
​
4
const redisTransportConfiguration: RedisTransportConfiguration = {
5
queueName: 'accounts-application-queue',
6
connectionString: 'redis://127.0.0.1:6379',
7
maxRetries: 3
8
}
9
const redisTransport = new RedisTransport(redisTransportConfiguration)
10
await Bus
11
.configure()
12
.withTransport(redisTransport)
13
.initialize()
Copied!
Copy link
Contents
Installation