AMQP Component
Send and receive messages on an AMQP-based message broker
Component key: amqp
Description
The Advanced Message Queuing Protocol (AMQP) is a standard protocol for interacting with message brokers and queueing platforms. It is used by many common message broker services like Azure Event Hubs, Apache Qpid, RabbitMQ and more.
This component allows you to manage messages on an AMQP-based queue.
API Documentation
This component was built using the AMQP API Reference.
Connections
AMQP Connection
An AMQP connection is comprised of a host name (this can be an IP address or FQDN endpoint), port, protocol and vhost.
For example, if you are told that your AMQP server is hosted at amqps://amqp.example.com:5672/example/vhost
, enter amqp.example.com
for the host, and 5672
for the port, select AMQPS
for the protocol, and enter example/vhost
for the vhost.
AMQP often requires authentication (a username and password), but some AMQP servers are anonymous and do not require authentication. If the server you're interacting with is allows anonymous authentication, you can omit the username and password fields.
You can verify that your settings are correct using the this component's Check AMQP Connection action.
Input | Default | Notes |
---|---|---|
Host string / Required host | 192.168.0.1 | The IP address or endpoint of the AMQP server |
Password string password | This can be omitted if the AMQP server allows anonymous authentication | |
Port string / Required port | 5672 | The port of the AMQP server |
Protocol string / Required protocol | amqp | Provide the desired protocol in which you want to interact with the queue. |
Username string username | This can be omitted if the AMQP server allows anonymous authentication | |
Vhost string vhost | The "example/vhost" portion of amqps://amqp.example.com:5672/example/vhost |
Actions
Acknowledge Message
Acknowledge a previously fetched message | key: acknowledgeMessage
Input | Notes |
---|---|
Connection connection / Required amqpConnection | |
Message string / Required message | An AMQP message. This must reference the results of a previous 'Get Message' step |
Check AMQP Connection
Verify that an AMQP server is available, and return the server's connection information. This is helpful for debugging purposes. | key: checkConnection
Input | Notes |
---|---|
Connection connection / Required amqpConnection |
Example Payload for Check AMQP Connection
{
"data": {
"host": "amqp.example.com",
"copyright": "Copyright (c) 2007-2022 VMware, Inc. or its affiliates.",
"information": "Licensed under the MPL 2.0. Website: https://rabbitmq.com",
"platform": "Erlang/OTP 24.2.1",
"product": "RabbitMQ",
"version": "3.9.13",
"connection": {
"host": "amqp.example.com",
"port": "5672",
"vhost": "example/vhost",
"password": "myPassword",
"protocol": "amqp",
"username": "myUsername"
}
}
}
Get Message
Receives a message from an AMQP-based queue | key: getMessage
Input | Default | Notes | Example |
---|---|---|---|
Acknowledge Message boolean acknowledgeMessage | true | Automatically mark the message received as "Acknowledged" | |
Connection connection / Required amqpConnection | |||
Queue Name string / Required queueName | Provide the name of the queue you would like to interact with. | myQueue |
This action will return a message from a given queue, if a message is available to get.
If no message is available, this action will return null
.
Use a Branch on Expression step to branch based on whether or not a message was fetched. You can check if the results of this step are non-null using the exists operator.
You have two options for marking a message "acknowledged":
- You can set the
Acknowledge Message
input totrue
. This will cause the message to be acknowledged immediately, and the message will be removed from the queue. - You can choose to not acknowledge the message immediately, but instead process the message and then pass the message to a Acknowledge Message step instead. This option is helpful if you would like to ensure the message is processed completely before removing it from the queue.
Example Payload for Get Message
{
"data": {
"fields": {
"deliveryTag": 1,
"redelivered": true,
"routingKey": "classic",
"messageCount": 10
},
"properties": {
"contentType": "text",
"contentEncoding": "",
"deliveryMode": "exampleMode",
"priority": "High",
"correlationId": "exampleId",
"replyTo": "",
"expiration": "",
"messageId": "exampleId",
"timestamp": "Fri, 06 Aug 2021 00:00:00 GMT",
"type": "Buffer",
"userId": "exampleId",
"appId": "exampleId",
"clusterId": "exampleId"
},
"content": {
"type": "Buffer",
"data": [
69,
120,
97,
109,
112,
108,
101
]
},
"message": "Example Message Content"
}
}
Publish Message
Add a message to an AMQP-based queue | key: publishMessage
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required amqpConnection | |||
Exchange string exchange | Provide the name of the exchange you would like to interact with. (Note: this parameter is required when Route Messages is true.) | account_events | |
Message string / Required message | Provide a message to push on to the queue. | Message to Queue | |
Queue Name string queueName | Provide the name of the queue you would like to interact with. (Note: this input is required when Route Messages is false.) | myQueue | |
Route Message boolean / Required routeMessage | false | If you would like to route this message, check this box. | |
Routing Key string routingKey | Provide the routing key you would like to use. (Note: this parameter is required when Route Messages is true.) | account_key |
Example Payload for Publish Message
{
"data": true
}
Reject Message
Rejects one message from an AMQP-based queue | key: rejectMessage
Input | Notes | Example |
---|---|---|
Connection connection / Required amqpConnection | ||
Queue Name string / Required queueName | Provide the name of the queue you would like to interact with. | myQueue |
Example Payload for Reject Message
{
"data": {
"consumerTag": "amq.ctag-ExampleTag"
}
}