> ## Documentation Index
> Fetch the complete documentation index at: https://ampersand-24eb5c1a-rajatspawar-eng-4200-readd-blob-storage.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# RabbitMQ destinations

For more information on destinations, see the [Destinations](/destinations) page.

When new data is read from a SaaS instance via a [Read Action](/read-actions) or [Subscribe Action](/subscribe-actions), Ampersand publishes the payload as messages to your RabbitMQ instance.

## Prerequisites

Before setting up a RabbitMQ destination, ensure that you have:

* A RabbitMQ instance reachable from the internet
* A connection URI with permission to publish
* A routing key that reaches a queue you can consume from

## Data format

Ampersand publishes each read or subscribe message to your RabbitMQ instance as JSON, using the routing key you configure. The full payload schema is defined in [webhook.yaml](https://github.com/amp-labs/openapi/blob/main/webhook/webhook.yaml).

## Create a RabbitMQ destination

Go to the [Destinations page](https://dashboard.withampersand.com/projects/_/destinations) in the Ampersand Dashboard and create a new RabbitMQ destination.

You'll need to provide:

| Field                | Type   | Required | Example                      | Description                                      |
| -------------------- | ------ | -------- | ---------------------------- | ------------------------------------------------ |
| **Destination name** | string | Yes      | `ampersandRabbitMQ`          | Alias to reference in your `amp.yaml` file       |
| **Connection URI**   | string | Yes      | `amqp://user:pass@host:5672` | AMQP connection URI (it embeds your credentials) |
| **Routing key**      | string | Yes      | `ampersand-events`           | Routing key to publish messages with             |

## Refer to the destination in your integration

After creating your RabbitMQ destination, reference it in your `amp.yaml` file:

```yaml theme={null}
specVersion: 1.0.0
integrations:
  - name: salesforceToRabbitMQ
    displayName: Salesforce to RabbitMQ
    provider: salesforce
    read:
      objects:
        - objectName: account
          destination: ampersandRabbitMQ
        - objectName: contact
          destination: ampersandRabbitMQ
```
