Create AMQP action
To send PubNub data into Advanced Message Queuing Protocol (AMQP), you must first configure your AMQP environment and the AMQP action in Admin Portal.
For Events & Actions, it doesn't matter how or where you set up your AMQP environment as long as you correctly configure your action in Admin Portal.
Existing AMQP environment
You will need the following information to configure Events & Actions to connect to AMQP.
- URL configuration - full AMQP URL with TLS, credentials, and Vhost.
- Routing key to direct messages to the appropriate queue.
- (Optional) RabbitMQ Exchange name for message publication.
Once you can access this information, create an AMQP action by following the steps described in the Configure Admin Portal section.
New AMQP environment
Setting up an Advanced Message Queuing Protocol (AMQP) environment typically involves deploying a message broker that implements the AMQP standard and configuring your client applications to communicate with this broker.
Use services like RabbitMQ or CloudAMQP to establish your AMQP environment.
- RabbitMQ
- CloudAMQP
Refer to RabbitMQ documentation to understand how to set up your AMQP environment, secure your connection with TLS, and obtain credentials, including the Vhost.
Ensure to have the following information ready, as you will need it to create an AMQP action:
- URL configuration - full AMQP URL with TLS, credentials, and Vhost.
- Routing key to direct messages to the appropriate queue.
- (Optional) RabbitMQ Exchange name for message publication.
When you've created your AMQP environment and have access to this information, create an AMQP action by following the steps described in the Configure Admin Portal section.
Refer to CloudAMQP documentation to understand how to set up your AMQP environment, secure your connection with TLS, and obtain credentials, including the Vhost.
Ensure to have the following information ready, as you will need it to create an AMQP action:
- URL configuration - full AMQP URL with TLS, credentials, and Vhost.
- Routing key to direct messages to the appropriate queue.
- (Optional) RabbitMQ Exchange name for message publication.
When you've created your AMQP environment and have access to this information, create an AMQP action by following the steps described in the Configure Admin Portal section.
Configure Admin Portal
-
In the Events & Actions view on the Admin Portal, create an action by clicking the + Add Action button.
-
Select Advanced Message Queuing Protocol (AMQP) as the action type.
-
In the URL field, enter the full AMQP URL with TLS, credentials, and Vhost in the
amqps://username:password@hostname/vhost
format, likeamqps://user123:pass456@bunny.cloudamqp.com/myvhost
. -
In the Routing key field, enter a message attribute the exchange looks at when deciding how to route the message to queues. For example, to direct messages to a queue that collects warning logs, use
logs.warning
. -
Optionally, enable the Persistent toggle to ensure each message is saved on a message broker disk.
-
Optionally, enable and configure retries through the AMQP retry option.
-
(Optional) Provide an Exchange name to identify an exchange within a RabbitMQ server where messages will be published. For example,
MyExchange
. -
(Optional) Set a custom TTL (Time-To-Live) for messages and queues in TTL (min) to override the default AMQP queue settings.
-
Pair your action with an event listener without leaving the Actions view. To do this, click the Add event listener button and select an existing event listener or create a new one.
-
Save your newly created action by clicking the Save changes button.