---
source_url: https://www.pubnub.com/docs/serverless/events-and-actions/actions/create-amqp-action
title: Create AMQP action
updated_at: 2026-05-19T12:14:08.434Z
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Create AMQP action

Set up your AMQP broker, then create the AMQP action in the [Admin Portal](#configure-admin-portal) to send PubNub data to [Advanced Message Queuing Protocol (AMQP)](https://www.cloudamqp.com/blog/what-is-amqp-and-why-is-it-used-in-rabbitmq.html).

Events & Actions is hosting‑agnostic. Any correctly configured AMQP broker works when you set up the action in the [Admin Portal](https://admin.pubnub.com/).

## Existing AMQP environment

You need:

* AMQP URL with TLS, credentials, and vhost.
* Routing key to route messages to the correct queue.
* (Optional) RabbitMQ exchange name for publishing messages.

When ready, go to [Configure Admin Portal](#configure-admin-portal).

## New AMQP environment

Set up a broker, then configure clients to connect.

Use services such as RabbitMQ or CloudAMQP to set up your AMQP broker.

### RabbitMQ

Use the [RabbitMQ](https://www.rabbitmq.com/documentation.html) docs to set up the broker, enable TLS, and get credentials, including the vhost.

Have this information ready to create an AMQP action:

* AMQP URL with TLS, credentials, and vhost.
* Routing key to route messages to the correct queue.
* (Optional) RabbitMQ exchange name for publishing messages.

When your AMQP environment is ready and you have this information, follow [Configure Admin Portal](#configure-admin-portal).

### CloudAMQP

Use the [CloudAMQP](https://www.cloudamqp.com/docs/index.html) docs to set up the broker, enable TLS, and get credentials, including the vhost.

Have this information ready to create an AMQP action:

* AMQP URL with TLS, credentials, and vhost.
* Routing key to route messages to the correct queue.
* (Optional) RabbitMQ exchange name for publishing messages.

When your AMQP environment is ready and you have this information, follow [Configure Admin Portal](#configure-admin-portal).

## Configure Admin Portal

1. In the **Events & Actions** view on the [Admin Portal](https://admin.pubnub.com/), click **+ Add Action**.
2. Select **Advanced Message Queuing Protocol (AMQP)** as the action type.
3. In the **URL** field, enter the AMQP connection string in this format: `amqps://username:password@hostname/vhost`. Example: `amqps://user123:pass456@bunny.cloudamqp.com/myvhost`.
4. In **Routing key**, enter the routing key the exchange uses to route messages. Example: `logs.warning`.
5. (Optional) Enable **Persistent** to write each message to broker disk.
6. (Optional) Enable and configure [retries](https://www.pubnub.com/docs/serverless/events-and-actions/events#retries) in **AMQP retry**.
7. (Optional) Provide an **Exchange** name to identify the exchange within RabbitMQ where messages will be published. Example: `MyExchange`.
8. (Optional) Set **TTL (min)** to override the default queue settings.
9. Pair the action with an event listener in **Actions**. Click **Add event listener** and select an existing listener or [create one](https://www.pubnub.com/docs/serverless/events-and-actions/configure-e&a#create-event-listener). Link it to a listener that captures the events you want.
10. Click **Save changes**.

## Terms in this document

* **Listener** - A function or objectthat reacts to events or messages, like new chat messages or connection updates, letting your app respond in real-time.
* **PubNub** - PubNub is a real-time messaging platform that provides APIs and SDKs for building scalable applications. It handles the complex infrastructure of real-time communication, including: Message delivery and persistence, Presence detection, Access control, Push notifications, File sharing, Serverless processing with Functions and Events & Actions, Analytics and monitoring with BizOps Workspace, AI-powered insights with Illuminate.
