> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/logs/integrations/providers/amqp.md).

# AMQP (RabbitMQ)

Connect AMQP (RabbitMQ) to Logs — not in the Cloud picker; it can be saved from code, but Norbix cannot send logs to it yet.

AMQP is the message-queue protocol of RabbitMQ and ActiveMQ; each log entry would be published to an exchange with a routing key.

{% hint style="warning" %}
Cloud has no screen to add AMQP (RabbitMQ): it is not in the picker, and its address shows *This is an internal platform-monitoring provider, configured by the Norbix host operator — it is not a project integration. Please pick a provider from the integrations list.* An integration saved from the SDK, the CLI or the API opens in Cloud with its fields, but its test fails with *Log delivery for the 'AMQP' provider is configured but not yet supported by this version. The integration is saved correctly; delivery will start working once the provider's runtime client ships. NorbixLogging and MongoDB are currently the only providers with live delivery.* — so it receives no entries. To keep your logs today, use [Norbix Logging](/codemash/cloud/logs/integrations/providers/norbix-logging.md).
{% endhint %}

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-0c0e208e04476ef94424e9921e76afaec04581fa%2Famqp-new-1.png?alt=media" alt="The address /logging/integrations/new/amqp shows the text This is an internal platform-monitoring provider, configured by the Norbix host operator — it is not a project integration."><figcaption><p>The AMQP (RabbitMQ) address in Cloud today.</p></figcaption></figure>

## Get your credentials

What AMQP (RabbitMQ) will ask for, from its own documentation:

1. In RabbitMQ, choose or create the **virtual host** and the **exchange** for log messages, for example `/` and `logs`. See [Virtual hosts](https://www.rabbitmq.com/docs/vhosts).
2. Create a user that may publish to that exchange and note its password. See [Authentication and authorisation](https://www.rabbitmq.com/docs/access-control).
3. Pick the **routing key** your queues are bound with, for example `bookshop.logs`.

## Connect it in Cloud

**Where:** not in the picker. An integration saved from code opens from Logs → Integrations at `/projects/<project>/logging/integrations/<integrationId>/edit`.

| Field            | Required | What it does                                     | Example                |
| ---------------- | -------- | ------------------------------------------------ | ---------------------- |
| Host             | yes      | The broker host.                                 | `rabbitmq.example.com` |
| Port             | no       | The broker port; 5672 when empty.                | `5672`                 |
| Virtual Host     | yes      | The virtual host.                                | `/`                    |
| Exchange         | yes      | The exchange entries are published to.           | `logs`                 |
| Routing Key      | yes      | The routing key of each message.                 | `bookshop.logs`        |
| Username         | yes      | The AMQP user.                                   | `bookshop`             |
| Password         | yes      | Secret; encrypted on save and never shown again. | `your-amqp-password`   |
| Integration Name | yes      | The name in your integrations list.              | `RabbitMQ logs`        |

<figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-96ec329d09e4e6fb33877ebd7fde5ce7079d8407%2Famqp-saved-2.png?alt=media" alt="Editing AMQP (RabbitMQ) integration saved from the SDK: badges ENABLED and TEST FAILED and the AMQP (RabbitMQ) fields"><figcaption><p>An integration saved from code, opened in Cloud.</p></figcaption></figure>

Secret fields are never shown; type them again before **Save** on this page.

## Test and set as default

**Test integration** runs one check, **WriteLog**, and it fails today for every AMQP (RabbitMQ) integration — Norbix has no AMQP (RabbitMQ) sender yet. See [Test an integration](/codemash/cloud/logs/integrations/test.md). Logging has no default integration ([Default integration](/codemash/cloud/logs/integrations/set-default.md)).

## Common errors

| Message                                                                                                                                                                                                                                                                            | Cause                                                         | Fix                                                                                                        |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| Log delivery for the 'AMQP' provider is configured but not yet supported by this version. The integration is saved correctly; delivery will start working once the provider's runtime client ships. NorbixLogging and MongoDB are currently the only providers with live delivery. | Every AMQP (RabbitMQ) test today.                             | Use [Norbix Logging](/codemash/cloud/logs/integrations/providers/norbix-logging.md).                       |
| This is an internal platform-monitoring provider, configured by the Norbix host operator — it is not a project integration. Please pick a provider from the integrations list.                                                                                                     | You opened `/new/amqp` in Cloud.                              | Save it from code, or use [Norbix Logging](/codemash/cloud/logs/integrations/providers/norbix-logging.md). |
| Required                                                                                                                                                                                                                                                                           | An empty field on the edit form; secrets must be typed again. | Fill every field.                                                                                          |

## Do it from code

```ts
const { id } = await norbix.hub.logs.saveLoggingIntegration({
  integration: {
    provider: 'AMQP',
    integrationName: 'RabbitMQ logs',
    isEnabled: true,
    host: 'rabbitmq.example.com',
    port: 5672,
    virtualHost: '/',
    exchange: 'logs',
    routingKey: 'bookshop.logs',
    username: 'bookshop',
    password: 'your-amqp-password',
  } as any, // the TS type knows only the shared fields
});
const { items } = await norbix.hub.logs.testLoggingIntegration({ integrationId: id });
// [ { operation: 'WriteLog', result: 'FAILED', errors: [ "Log delivery for the …" ] } ]
```

```sh
norbix hub logs logging integration save --integration '{"provider":"AMQP","integrationName":"RabbitMQ logs","isEnabled":true,"host":"rabbitmq.example.com","port":5672,"virtualHost":"/","exchange":"logs","routingKey":"bookshop.logs","username":"bookshop","password":"your-amqp-password"}'
```

The provider is written `AMQP` in requests. The client setup is on the [Logs page](/codemash/cloud/logs.md#use-it-from-code). API: [Save Logging Integration](/codemash/api-reference/logs/integrations/save-logging-integration.md) · [Test Logging Integration](/codemash/api-reference/logs/integrations/test-logging-integration.md)
