---
title: "Rabbit Receiver"
canonical: "https://docs.devo.com/space/latest/95215114/Rabbit%20Receiver"
format: markdown
---
> Macro (toc)

## Description

<span style="color: #000000">A unit that receives items from RabbitMQ message-broker queues.</span>

<span style="color: #000000">RabbitMQ uses a fixed set of queues, provided in the unit settings, and dynamic sets of queues, managed by input events to add and remove input ports. These two sets are disjoint, within different namespaces. Therefore, you cannot remove a static queue using input events. To use the same values both, set them in the default tab. </span>

<span style="color: #000000">Each queue has an identifying key, unique within its namespace (configuration or events).</span>

When using a fixed set of queues, data arrives from the RabbitMQ queue and is processed according to the unit settings. If successful, a pilot event with fields defined by the output event settings is emitted through the d*ata* port.  
If an error occurs, a pilot event with standard error fields is emitted through the *error* port.

When using dynamic queue set management, on receiving an input event via the *add* input port, a new queue is created using the settings entered in the event fields.

By default, event field names correspond to configuration item names. If you want a different mapping, you can set this in the input events tab.

On receiving an input event via the *remove* input port, the corresponding queue will be deleted. On receiving an input event via the *removeAll* input port, all dynamically created queues will be deleted.

In both cases:  
Successful input events will be enriched with an *action* field corresponding to the action performed, and are emitted through the *done* output port.  
If the action failed, the input events will be enriched with an *action* field as well as standard error fields, and are emitted through the *fail* output port.

![image](media://0f28cc7e-0579-4a7f-9c08-5c2b68d39ae3)

## Configuration

After dragging this unit into the Flow canvas, double-click it to access its configuration options. The following table describes the configuration options of this unit:

| **Tab** | **Field** | **Description** |
| --- | --- | --- |
| *General* | *Name* | Enter a name for the unit. It must start with a letter, and cannot contain spaces. Only letters, numbers, and underscores are allowed. |
| *Description* | Enter a description detailing the scope of the unit. |
| *Status queues* | *Queue* | Click the plus icon to add queue settings.<br><span style="color: #172b4d">You can collapse and expand the queues using the </span>> Macro (inline-media-image)

<span style="color: #172b4d"> icon, reorder using the arrows, or delete using the X icon.</span><br>You can also reorder the fields using drag and drop. |
| *Key* | Enter the key to identify a queue within its namespace |
| *Source* | The source of the messages (a queue or an exchange). If an exchange is given, a temporary queue will be created. |
| *Is exchange* | Whether the selected source is an exchange (true) or a queue (false). |
| *Routing key* | Enter the label to describe the message. Only applies when the source is an exchange. |
| *Host* | Enter the host to use for establishing the initial connection to RabbitMQ. |
| *Virtual host* | Enter the name of the virtual host used to configure RabbitMQ instances. |
| *Port* | Enter the name of the port used for establishing a connection to RabbitMQ. |
| *Username* | Specify the client name to access RabbitMQ. |
| *Password* | Enter the password requested to access RabbitMQ. |
| *Connection timeout* | The maximum amount of time (in milliseconds) to maintain the connection. |
| *Requested heartbeat* | Indicate how often (in milliseconds) to send signals to indicate normal operation in order to maintain the connection alive.<br>Zero for no heartbeat. |
| *Auto ack* | Whether to acknowledge queue items after extracting them from the queue. If false, you will have to send acks later using an mq.RabbitAck unit. |
| *Charset* | Indicate the encoding system to use for the message text. |
| *Input events* | *Key* | Enter the name of an input event field containing a key setting. |
| *Host* | Enter the name of an input event field containing the host setting. |
| *Virtual host* | Enter the name of an input event field containing virtual host setting. |
| *Port* | Enter the name of an input event field containing the port setting. |
| *Username* | Enter the name of an input event field containing the username setting. |
| *Password* | Enter the name of an input event field containing password setting. |
| *Connection timeout* | Enter the name of an input event field containing the connection timeout setting. |
| *Requested heartbeat* | Enter the name of an input event field containing the requested heartbeat setting. |
| *Charset* | Enter the name of an input event field containing the charset setting. |
| *Source* | Enter the name of an input event field containing the source setting. |
| *Is exchange* | Enter the name of an input event field containing the is exchange setting. |
| *Routing key* | Enter the name of an input event field containing the routing key setting. |
| *Auto Ack* | Enter the name of an input event field containing the autoAck setting. |
| *Defaults* | The fields in this tab are identical the fixed and dynamic queue settings. Here you can enter default values to be applied to both. |
| *Output events* | *Channel* | Enter a name for the output event field containing the channel. |
| *Delivery tag* | Enter a name for the output event field containing the delivery tag. |
| *Exchange* | Enter a name for the output event field containing the exchange. |
| *Routing key* | Enter a name for the output event field containing the routing key setting. |
| *Body* | Enter a name for the output event field containing the body of the message. |

## Input ports

| **Port** | **Description** |
| --- | --- |
| *add* | <span style="color: #000000">Input events to request a new queue to be added. Must have at least a field specifying the queue key.</span> |
| *remove* | <span style="color: #000000">Input events to remove a previously added queue. Must have at least a field specifying the queue key.</span> |
| *removeAll* | <span style="color: #000000">Input events to remove all previously added queues. No fields needed.</span> |

## Output ports

| **Port** | **Description** |
| --- | --- |
| <span style="color: #000000">*data*</span> | <span style="color: #000000">Output events for successful RabbitMQ messages. The structure is defined by the output event settings.</span> |
| *error* | <span style="color: #000000">Output events for failed RabbitMQ messages, enriched with standard error fields. </span> |
| *done* | <span style="color: #000000">Output events for successful queue manipulation actions, enriched with an </span><span style="color: #000000">*action *</span><span style="color: #000000">field specifying the action performed.</span> |
| <span style="color: #000000">*fail*</span> | <span style="color: #000000">Output events for failed queue manipulation actions, enriched with an </span><span style="color: #000000">*action *</span><span style="color: #000000">field and standard error fields.</span> |

## Example

In this example, we want to write events into a RabbitMQ queue. 

[Unknown Attachment]

First, add a [Tick](#) unit to fire events every time it is clicked. In the **Fields **tab of the properties, configure a string to send to the Rabbit Sender:

[Unknown Attachment]

Then, add the Rabbit Sender unit to the Flow and link it to the Tick unit.

In the properties, we need to enter the host to use for establishing the initial connection to RabbitMQ, as well as the following information:

[Unknown Attachment]

> ℹ️ After [saving and starting](#) the Flow, you must click the red button of the Tick unit to begin sending events.

### 📁 Download this example

You can try this flow by downloading this JSON file and uploading it to your domain using the **Import **option: