# 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

```bash
npm i @node-ts/bus-rabbitmq
```

Once installed, configure a new **RabbitMqTransport** and provide it to the bus configuration

```typescript
import { Bus } from '@node-ts/bus-core'
import { RabbitMqTransport, RabbitMqTransportConfiguration } from '@node-ts/bus-rabbitmq'

const rabbitConfiguration: RabbitMqTransportConfiguration = {
  queueName: 'accounts-application-queue',
  connectionString: 'amqp://guest:guest@localhost',
  maxRetries: 5
}
const rabbitMqTransport = new RabbitMqTransport(rabbitConfiguration)
await Bus
  .configure()
  .withTransport(rabbitMqTransport)
  .initialize()
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bus.node-ts.com/guide/transports/rabbitmq.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
