RabbitMQ
RabbitMQ is an AMQP compatible transport that's officially supported by @node-ts/bus. Once configured, @node-ts/bus will create all necessary queues and exchanges to support the handlers of the application.

Installation

Install the @node-ts/bus-rabbitmq npm package
1
npm i @node-ts/bus-rabbitmq
Copied!
Once installed, configure a new RabbitMqTransport and provide it to the bus configuration
1
import { Bus } from '@node-ts/bus-core'
2
import { RabbitMqTransport, RabbitMqTransportConfiguration } from '@node-ts/bus-rabbitmq'
3
​
4
const rabbitConfiguration: RabbitMqTransportConfiguration = {
5
queueName: 'accounts-application-queue',
6
connectionString: 'amqp://guest:[email protected]',
7
maxRetries: 5
8
}
9
const rabbitMqTransport = new RabbitMqTransport(rabbitConfiguration)
10
await Bus
11
.configure()
12
.withTransport(rabbitMqTransport)
13
.initialize()
Copied!
Copy link
Contents
Installation