---
source_url: https://www.pubnub.com/docs/integrations/event-forwarding/create-amqp-action
title: Create an AMQP action
updated_at: 2026-09-30T07:20:08.000Z
---

# Create an AMQP action

## Documentation index

To discover more PubNub resources:

1. Fetch [PubNub's llms.txt](https://www.pubnub.com/llms-full.txt) for a list of available pages in Markdown format.
2. Identify relevant URLs from that index.
3. Fetch the target pages.

Do not assume a path exists, always check the index first.

Create an AMQP action when you want [Events & Actions](https://www.pubnub.com/docs/integrations/event-forwarding/overview.md) to forward matching PubNub events to a broker that speaks the [Advanced Message Queuing Protocol (AMQP)](https://www.cloudamqp.com/blog/what-is-amqp-and-why-is-it-used-in-rabbitmq.html). [RabbitMQ](https://www.rabbitmq.com/) and [CloudAMQP](https://www.cloudamqp.com/) both work. You configure the action in the [Admin Portal](https://admin.pubnub.com/), and it connects to any correctly configured broker because Events & Actions is hosting-agnostic for AMQP.

If you already have a broker URL with TLS, credentials, and a vhost, skip to [Configure the AMQP action](#configure-the-amqp-action).

## Set up your AMQP broker

Gather the following information from your AMQP environment before you configure the action:

* An AMQP URL with TLS, credentials, and vhost.
* A routing key the exchange uses to route messages to the correct queue.
* Optionally, an exchange name for publishing messages.

If you use RabbitMQ, follow the [RabbitMQ documentation](https://www.rabbitmq.com/documentation.html) to set up the broker, enable TLS, and create credentials and a vhost.

If you use CloudAMQP, follow the [CloudAMQP documentation](https://www.cloudamqp.com/docs/index.html) to do the same.

## Configure the AMQP action

1. In **Events & Actions** in the [Admin Portal](https://admin.pubnub.com/), select your app and keyset, then click **+ Add Action**.
2. Select **Advanced Message Queuing Protocol (AMQP)** as the action type.
3. In **URL**, enter the connection string in the format `amqps://username:password@hostname/vhost`, for example `amqps://user123:pass456@bunny.cloudamqp.com/myvhost`.
4. In **Routing key**, enter the routing key your exchange uses to route messages, for example `logs.warning`.
5. If you want each message written to broker disk instead of kept only in memory, enable **Persistent**.
6. If you want to publish through a specific exchange, enter its name in **Exchange**, for example `MyExchange`.
7. If you need a queue TTL different from your broker's default, set **TTL (min)**.
8. If you want failed deliveries retried automatically, enable and configure **AMQP retry**. See [Available actions](https://www.pubnub.com/docs/integrations/event-forwarding/available-actions.md) for the retry policy and backoff formula.
9. Click **Add event listener** and pair the action with an existing event listener, or [create one](https://www.pubnub.com/docs/integrations/event-forwarding/configure.md).
10. Click **Save changes**.

[Publish](https://www.pubnub.com/docs/pub-sub/publish/overview.md) a message that matches the paired listener's filter and confirm it arrives on your queue.

## Related tasks

* [Configure Events & Actions](https://www.pubnub.com/docs/integrations/event-forwarding/configure.md). Create the event listener that triggers this action.
* [Available actions](https://www.pubnub.com/docs/integrations/event-forwarding/available-actions.md). Look up the retry and envelope settings shared by every action type.
* [Create a Kafka action](https://www.pubnub.com/docs/integrations/event-forwarding/create-kafka-action.md). Forward matching events to an Apache Kafka topic instead of an AMQP broker.
* [Events & Actions](https://www.pubnub.com/docs/integrations/event-forwarding/overview.md). Understand event listeners, filters, and the concepts behind Events & Actions.

Last updated at: 2026-09-30T07:20:08.000Z
