RabbitMQ
App · Databases · 20 actions
Publish and read RabbitMQ messages, create, purge and delete queues and exchanges, bind them together, and check the broker's health, through the management API of your own broker or CloudAMQP.
Actions
| Action | What it does |
|---|---|
| Bind exchange to exchange | Route messages from one exchange on to another. |
| Bind queue to exchange | Route messages from an exchange to a queue. |
| Check alarms | Whether a memory or disk alarm is in effect anywhere in the cluster. |
| Create exchange | Create an exchange. |
| Create queue | Create a durable queue. |
| Delete binding | Remove one binding from an exchange to a queue or exchange, identified by its properties key. |
| Delete exchange | Delete an exchange and its bindings. |
| Delete queue | Delete a queue and any messages in it. |
| Get current user | The RabbitMQ user this connection signs in as, with its tags. |
| Get exchange | One exchange's type, settings and arguments. |
| Get messages | Read messages from the front of a queue - either peeking and putting them back, or taking them off the queue. |
| Get overview | The broker at a glance: cluster name, RabbitMQ and Erlang versions, the exchange types it supports, and totals of queued messages, queues, exchanges, connections and consumers. |
| Get queue | One queue in full: type, settings, how many messages are ready and unacknowledged, its consumers and the policy in effect. |
| List consumers | The consumers subscribed in a virtual host, optionally only one queue's, with their prefetch and acknowledgement settings. |
| List exchanges | The exchanges in a virtual host, sorted by name, with each one's type and settings. |
| List queue bindings | Every binding that delivers to a queue: the source exchange, routing key and arguments, and the properties key needed to delete it. |
| List queues | The queues in a virtual host, sorted by name, with each one's type, state and message and consumer counts. |
| List virtual hosts | The virtual hosts this user has permissions on, with their descriptions, default queue type and message counts. |
| Publish message | Publish a message to an exchange, or straight to a queue by leaving the exchange empty and putting the queue's name in Routing key. |
| Purge queue | Delete every ready message in a queue, keeping the queue. |
Bind exchange to exchange
Route messages from one exchange on to another. Returns the binding, including the properties key needed to delete it.
Inputs
- Source exchange
exchangetextRequired - The exchange messages come from.
- Destination exchange
destination_exchangetextRequired - The exchange to pass them on to.
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
- Routing key
routing_keytext - The routing key the binding matches. For a topic exchange use * for one word and # for any number, such as orders.*. Leave empty for none (fanout exchanges ignore it).
- Arguments
argumentsobject - Optional binding arguments. For a headers exchange, the headers to match plus x-match set to all or any.
Outputs
argumentsobject- Binding arguments
destinationtext- Destination queue or exchange
destination_typetext- queue or exchange
properties_keytext- The binding's id, used to delete it
routing_keytext- Routing key
sourcetext- Source exchange (empty for the default exchange)
vhosttext- Virtual host
Example output
{
"arguments": {},
"destination": "orders.audit",
"destination_type": "exchange",
"properties_key": "orders.created",
"routing_key": "orders.created",
"source": "orders.events",
"vhost": "/"
}Bind queue to exchange
Route messages from an exchange to a queue. Returns the binding, including the properties key needed to delete it.
Inputs
- Exchange
exchangetextRequired - The exchange messages come from.
- Queue
queuetextRequired - The queue to deliver them to.
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
- Routing key
routing_keytext - The routing key the binding matches. For a topic exchange use * for one word and # for any number, such as orders.*. Leave empty for none (fanout exchanges ignore it).
- Arguments
argumentsobject - Optional binding arguments. For a headers exchange, the headers to match plus x-match set to all or any.
Outputs
argumentsobject- Binding arguments
destinationtext- Destination queue or exchange
destination_typetext- queue or exchange
properties_keytext- The binding's id, used to delete it
routing_keytext- Routing key
sourcetext- Source exchange (empty for the default exchange)
vhosttext- Virtual host
Example output
{
"arguments": {},
"destination": "orders",
"destination_type": "queue",
"properties_key": "orders.created",
"routing_key": "orders.created",
"source": "orders.events",
"vhost": "/"
}Check alarms
Whether a memory or disk alarm is in effect anywhere in the cluster. While one is, RabbitMQ blocks publishers. Returns healthy true or false rather than failing the step.
Inputs
None.
Outputs
alarmslisthealthytrue/false- True when no alarm is in effect
reasontext- Why the check failed, if it did
statustext- ok or failed
Example output
{
"alarms": [],
"healthy": true,
"reason": null,
"status": "ok"
}Create exchange
Create an exchange. If an identical one already exists nothing changes; one with different settings is an error. Returns the exchange.
Inputs
- Exchange name
exchangetextRequired - Up to 255 characters. Names starting with amq. are reserved.
- Type
exchange_typetextRequired - How the exchange routes messages to queues.One of:
direct(Direct - route by exact routing key),fanout(Fanout - copy to every bound queue),topic(Topic - route by routing key pattern),headers(Headers - route by message headers). Default:direct. - Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
- Durable
durabletrue/false - Keep the exchange when the broker restarts.Default:
true. - Delete when the last binding is removed
auto_deletetrue/false - Delete the exchange once it has had a binding and the last one is removed.Default:
false. - Internal
internaltrue/false - Only other exchanges can route to it; clients cannot publish to it directly.Default:
false. - Alternate exchange
alternate_exchangetext - Where to send messages this exchange cannot route, instead of dropping them.
- Other arguments
argumentsobject - Any other exchange arguments.
Outputs
argumentsobject- Exchange arguments
auto_deletetrue/false- Deleted when its last binding is removed
createdtrue/false- False when an identical exchange already existed
durabletrue/false- Survives a broker restart
internaltrue/false- Only other exchanges can publish to it
nametext- Exchange name (empty for the default exchange)
policytext- Policy applied, if any
typetext- direct, fanout, topic or headers
vhosttext- Virtual host
Example output
{
"arguments": {},
"auto_delete": false,
"created": true,
"durable": true,
"internal": false,
"name": "orders.events",
"type": "topic",
"vhost": "/"
}Create queue
Create a durable queue. If an identical queue already exists nothing changes; one with different settings is an error. Returns the queue.
Inputs
- Queue name
queuetextRequired - Up to 255 characters, such as orders.
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
- Queue type
queue_typetext - Leave unset to use the virtual host's default. Quorum queues are replicated across nodes; streams keep messages after they are read.One of:
classic,quorum(Quorum (replicated)),stream. - Delete when the last consumer leaves
auto_deletetrue/false - Delete the queue once it has had a consumer and the last one disconnects. Classic queues only.Default:
false. - Message time to live (seconds)
message_ttl_secondsnumber - Discard messages that have waited this long. Leave empty to keep them until read.At least 0.001.
- Delete when unused for (seconds)
expires_secondsnumber - Delete the queue after it has had no consumers and no reads for this long. Good for temporary queues.At least 0.001.
- Maximum messages
max_lengthnumber - Once the queue holds this many, the oldest are dropped (or dead-lettered). Leave empty for no limit.At least 0.
- Dead-letter exchange
dead_letter_exchangetext - Exchange that receives messages that expire, are dropped for length or are rejected without requeue.
- Dead-letter routing key
dead_letter_routing_keytext - Routing key for dead-lettered messages. Leave empty to keep each message's own.
- Other arguments
argumentsobject - Any other queue arguments, such as x-max-priority. The fields above take precedence.
Outputs
argumentsobject- Queue arguments such as x-queue-type
auto_deletetrue/false- Deleted when its last consumer leaves
consumersnumber- Number of consumers
createdtrue/false- False when an identical queue already existed
durabletrue/false- Survives a broker restart
effective_policy_definitionobject- The policy settings in effect
exclusivetrue/false- Owned by one connection
messagesnumber- Messages in the queue (ready + unacknowledged)
messages_readynumber- Messages ready for delivery
messages_unacknowledgednumber- Messages delivered but not acknowledged
nametext- Queue name
nodetext- Node hosting the queue
policytext- Policy applied, if any
statetext- running, idle, ...
typetext- classic, quorum or stream
vhosttext- Virtual host
Example output
{
"arguments": {
"x-queue-type": "classic"
},
"auto_delete": false,
"consumers": 1,
"created": true,
"durable": true,
"effective_policy_definition": {},
"exclusive": false,
"messages": 0,
"messages_ready": 3,
"messages_unacknowledged": 0,
"name": "orders",
"node": "rabbit@rabbit-1",
"policy": null,
"state": "running",
"type": "classic",
"vhost": "/"
}Delete binding
Remove one binding from an exchange to a queue or exchange, identified by its properties key.
Inputs
- Source exchange
exchangetextRequired - The exchange the binding routes from.
- Bound to a
destination_typetext - Whether the binding delivers to a queue or exchange.One of:
queue,exchange. Default:queue. - Destination
destinationtextRequired - The queue or exchange the binding delivers to.
- Properties key
properties_keytext - The binding's properties_key, from a Bind step or List queue bindings. Leave empty for a binding with no routing key and no arguments.
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
Outputs
deletedtrue/false- Always true
destinationtext- Destination
destination_typetext- queue or exchange
properties_keytext- The binding's id
sourcetext- Source exchange
vhosttext- Virtual host
Example output
{
"deleted": true,
"destination": "orders",
"destination_type": "queue",
"properties_key": "orders.created",
"source": "orders.events",
"vhost": "/"
}Delete exchange
Delete an exchange and its bindings. Optionally only if nothing is bound to it.
Inputs
- Exchange
exchangetextRequired - The exchange's name, exactly as it appears in List exchanges.
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
- Only if unused
if_unusedtrue/false - Fail instead of deleting an exchange with bindings.Default:
false.
Outputs
deletedtrue/false- Always true
exchangetext- Exchange
vhosttext- Vhost
Example output
{
"deleted": true,
"exchange": "orders.events",
"vhost": "/"
}Delete queue
Delete a queue and any messages in it. Optionally only if it is empty or has no consumers.
Inputs
- Queue
queuetextRequired - The queue's name, exactly as it appears in List queues.
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
- Only if empty
if_emptytrue/false - Fail instead of deleting a queue with messages.Default:
false. - Only if it has no consumers
if_unusedtrue/false - Fail instead of deleting a queue being consumed.Default:
false.
Outputs
deletedtrue/false- Always true
queuetext- Queue
vhosttext- Vhost
Example output
{
"deleted": true,
"queue": "orders",
"vhost": "/"
}Get current user
The RabbitMQ user this connection signs in as, with its tags. Useful to check the connection works.
Inputs
None.
Outputs
is_internal_usertrue/false- Whether RabbitMQ's own user database holds it
nametext- Username
tagslist
Example output
{
"is_internal_user": true,
"name": "lodol",
"tags": [
"management"
]
}Get exchange
One exchange's type, settings and arguments.
Inputs
- Exchange
exchangetext - The exchange's name. Leave empty for the default exchange.
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
Outputs
argumentsobject- Exchange arguments
auto_deletetrue/false- Deleted when its last binding is removed
durabletrue/false- Survives a broker restart
internaltrue/false- Only other exchanges can publish to it
nametext- Exchange name (empty for the default exchange)
policytext- Policy applied, if any
typetext- direct, fanout, topic or headers
vhosttext- Virtual host
Example output
{
"arguments": {},
"auto_delete": false,
"durable": true,
"internal": false,
"name": "orders.events",
"type": "topic",
"vhost": "/"
}Get messages
Read messages from the front of a queue - either peeking and putting them back, or taking them off the queue. Meant for occasional reads, not as a consumer: a peeked message comes back marked redelivered and may change position.
Inputs
- Queue
queuetextRequired - The queue's name, exactly as it appears in List queues.
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
- How many
countnumber - Up to 100. Defaults to 1.From 1 to 100. Default:
1. - Mode
ackmodetext - Whether the messages stay on the queue.One of:
ack_requeue_true(Peek - read and put back),ack_requeue_false(Take - read and remove from the queue),reject_requeue_true(Reject and put back),reject_requeue_false(Reject and remove (dead-letters it if the queue has a dead-letter exchange)). Default:ack_requeue_true. - Payload format
encodingtext - How each message body is returned.One of:
auto(Text when possible, otherwise base64),base64(Always base64). Default:auto. - Cut bodies at (bytes)
truncatenumber - Shorten longer bodies to this many bytes.At least 1.
Outputs
countnumber- How many came back
messageslist
Example output
{
"count": 1,
"messages": [
{
"exchange": "orders.events",
"message_count": 2,
"payload": "{\"order_id\": 1042}",
"payload_bytes": 18,
"payload_encoding": "string",
"payload_json": {
"order_id": 1042
},
"properties": {
"content_type": "application/json",
"delivery_mode": 2
},
"redelivered": false,
"routing_key": "orders.created"
}
]
}Get overview
The broker at a glance: cluster name, RabbitMQ and Erlang versions, the exchange types it supports, and totals of queued messages, queues, exchanges, connections and consumers.
Inputs
None.
Outputs
cluster_nametext- Cluster name
default_queue_typetext- Default queue type
erlang_versiontext- Erlang version
exchange_typeslistmanagement_versiontext- Management plugin version
message_statsobject- Message rates
object_totalsobjectproduct_nametext- Product name
product_versiontext- Product version
queue_totalsobjectrabbitmq_versiontext- RabbitMQ version
Example output
{
"cluster_name": "rabbit@rabbit-1",
"default_queue_type": "classic",
"erlang_version": "27.3",
"exchange_types": [
{
"description": "",
"enabled": true,
"name": "direct"
}
],
"management_version": "4.3.6",
"object_totals": {
"channels": 2,
"connections": 2,
"consumers": 1,
"exchanges": 8,
"queues": 1
},
"product_name": "RabbitMQ",
"product_version": "4.3.6",
"queue_totals": {
"messages": 3,
"messages_ready": 3,
"messages_unacknowledged": 0
},
"rabbitmq_version": "4.3.6"
}Get queue
One queue in full: type, settings, how many messages are ready and unacknowledged, its consumers and the policy in effect.
Inputs
- Queue
queuetextRequired - The queue's name, exactly as it appears in List queues.
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
Outputs
argumentsobject- Queue arguments such as x-queue-type
auto_deletetrue/false- Deleted when its last consumer leaves
consumersnumber- Number of consumers
durabletrue/false- Survives a broker restart
effective_policy_definitionobject- The policy settings in effect
exclusivetrue/false- Owned by one connection
messagesnumber- Messages in the queue (ready + unacknowledged)
messages_readynumber- Messages ready for delivery
messages_unacknowledgednumber- Messages delivered but not acknowledged
nametext- Queue name
nodetext- Node hosting the queue
policytext- Policy applied, if any
statetext- running, idle, ...
typetext- classic, quorum or stream
vhosttext- Virtual host
Example output
{
"arguments": {
"x-queue-type": "classic"
},
"auto_delete": false,
"consumers": 1,
"durable": true,
"effective_policy_definition": {},
"exclusive": false,
"messages": 3,
"messages_ready": 3,
"messages_unacknowledged": 0,
"name": "orders",
"node": "rabbit@rabbit-1",
"policy": null,
"state": "running",
"type": "classic",
"vhost": "/"
}List consumers
The consumers subscribed in a virtual host, optionally only one queue's, with their prefetch and acknowledgement settings.
Inputs
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
- Queue
queuetext - Only this queue's consumers. Leave empty for all.
Outputs
countnumber- How many came back
itemslist- The consumers
Example output
{
"count": 1,
"items": [
{
"ack_required": true,
"active": true,
"activity_status": "up",
"arguments": {},
"consumer_tag": "amq.ctag-3fJ1xQ",
"exclusive": false,
"prefetch_count": 10,
"queue": {
"name": "orders",
"vhost": "/"
}
}
]
}List exchanges
The exchanges in a virtual host, sorted by name, with each one's type and settings. The default exchange has an empty name.
Inputs
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
- Name contains
name_filtertext - Only names containing this text. Leave empty for all of them.
- Treat the name as a regular expression
use_regextrue/false - Match 'Name contains' as a regular expression instead of text.Default:
false. - Page
pagenumber - Which page of results, starting at 1.From 1 to 1000000. Default:
1. - Results per page
page_sizenumber - How many to return, 1-500. Defaults to 100.From 1 to 500. Default:
100.
Outputs
countnumber- How many came back on this page
filtered_countnumber- How many match the name filter
has_moretrue/false- Whether a later page exists
itemslist- The matching exchanges
pagenumber- This page's number
page_countnumber- How many pages match
page_sizenumber- Page size asked for
total_countnumber- How many exist in the virtual host
Example output
{
"count": 1,
"filtered_count": 1,
"has_more": false,
"items": [
{
"arguments": {},
"auto_delete": false,
"durable": true,
"internal": false,
"name": "orders.events",
"type": "topic",
"vhost": "/"
}
],
"page": 1,
"page_count": 1,
"page_size": 100,
"total_count": 1
}List queue bindings
Every binding that delivers to a queue: the source exchange, routing key and arguments, and the properties key needed to delete it.
Inputs
- Queue
queuetextRequired - The queue's name, exactly as it appears in List queues.
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
Outputs
countnumber- How many came back
itemslist- The queue's bindings
Example output
{
"count": 1,
"items": [
{
"arguments": {},
"destination": "orders",
"destination_type": "queue",
"properties_key": "orders.created",
"routing_key": "orders.created",
"source": "orders.events",
"vhost": "/"
}
]
}List queues
The queues in a virtual host, sorted by name, with each one's type, state and message and consumer counts. Filter by part of the name.
Inputs
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
- Name contains
name_filtertext - Only names containing this text. Leave empty for all of them.
- Treat the name as a regular expression
use_regextrue/false - Match 'Name contains' as a regular expression instead of text.Default:
false. - Page
pagenumber - Which page of results, starting at 1.From 1 to 1000000. Default:
1. - Results per page
page_sizenumber - How many to return, 1-500. Defaults to 100.From 1 to 500. Default:
100.
Outputs
countnumber- How many came back on this page
filtered_countnumber- How many match the name filter
has_moretrue/false- Whether a later page exists
itemslist- The matching queues
pagenumber- This page's number
page_countnumber- How many pages match
page_sizenumber- Page size asked for
total_countnumber- How many exist in the virtual host
Example output
{
"count": 1,
"filtered_count": 1,
"has_more": false,
"items": [
{
"arguments": {
"x-queue-type": "classic"
},
"auto_delete": false,
"consumers": 1,
"durable": true,
"effective_policy_definition": {},
"exclusive": false,
"messages": 3,
"messages_ready": 3,
"messages_unacknowledged": 0,
"name": "orders",
"node": "rabbit@rabbit-1",
"policy": null,
"state": "running",
"type": "classic",
"vhost": "/"
}
],
"page": 1,
"page_count": 1,
"page_size": 100,
"total_count": 1
}List virtual hosts
The virtual hosts this user has permissions on, with their descriptions, default queue type and message counts.
Inputs
None.
Outputs
countnumber- How many came back
itemslist- The virtual hosts
Example output
{
"count": 1,
"items": [
{
"default_queue_type": "classic",
"description": "Default virtual host",
"messages": 3,
"name": "/",
"tags": [],
"tracing": false
}
]
}Publish message
Publish a message to an exchange, or straight to a queue by leaving the exchange empty and putting the queue's name in Routing key. Returns whether any queue received it.
Inputs
- Exchange
exchangetext - The exchange to publish to. Leave empty to deliver straight to the queue named in Routing key.
- Routing key
routing_keytext - Decides which bound queues receive the message - or, with no exchange, the queue's name.
- Message body
payloadtextRequired - The message. An object from an earlier step is sent as JSON.
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
- Body format
payload_encodingtext - Choose Base64 to send binary data encoded as base64.One of:
string(Text),base64(Base64 (binary data)). Default:string. - Content type
content_typetext - Such as application/json or text/plain.
- Persistent
persistenttrue/false - Write the message to disk so it survives a broker restart (in a durable queue).Default:
true. - Headers
headersobject - Message headers, also used by headers exchanges.
- Priority
prioritynumber - 0-255. Only matters on a queue created with x-max-priority.From 0 to 255.
- Correlation ID
correlation_idtext - Ties a reply to its request.
- Reply to
reply_totext - The queue a reply should go to.
- Expires after (seconds)
expiration_secondsnumber - Discard the message if unread after this long.At least 0.001.
- Message ID
message_idtext - Your own identifier for the message.
- Timestamp
timestampdate and time - The message's timestamp property.
- Message type
message_typetext - The message's type property, such as order.created.
- App ID
app_idtext - The publishing application's name.
- Fail if no queue receives it
fail_if_unroutabletrue/false - Fail the step instead of succeeding when the message matched no binding and was dropped.Default:
false.
Outputs
exchangetext- Exchange published to (empty for the default)
routedtrue/false- Whether at least one queue received the message
routing_keytext- Routing key used
vhosttext- Virtual host
Example output
{
"exchange": "orders.events",
"routed": true,
"routing_key": "orders.created",
"vhost": "/"
}Purge queue
Delete every ready message in a queue, keeping the queue. This cannot be undone.
Inputs
- Queue
queuetextRequired - The queue's name, exactly as it appears in List queues.
- Virtual host
vhosttext - The virtual host to work in. Leave empty to use the one set on the connection ('/' if none was).
Outputs
messages_beforenumber- Approximate messages in the queue before
purgedtrue/false- Always true
queuetext- Queue name
vhosttext- Virtual host
Example output
{
"messages_before": 3,
"purged": true,
"queue": "orders",
"vhost": "/"
}