Rabbit Sender
Description
This unit is a Processor type unit.
This unit writes into a RabbitMQ queue.
The destination can be a queue or an exchange. In both cases, if no RabbitMQ queue exists, it will be created.
An event comes in through the in port. When the event contains a field with the message to be written, the message is sent.
Successful input events are emitted through the done port without modification.
If an error occurs, the input event is enriched with standard error fields and emitted through the error port.</li>
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. | |
Check configuration | Whether to connect to the destination when building the flow (true) or only when it has started (false). | |
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. Zero for no heartbeat. | |
Target | The name of the destination (queue or exchange). | |
Exchange type | Whether the selected source is an exchange or a queue (queue by default). | |
Routing key | Enter the label to describe the message. Only applies when the source is an exchange. | |
Charset | Indicate the encoding system to use for the message text. | |
Data field | Enter the name of an input event field containing the message to be sent. |
Input ports
Port | Description |
---|---|
in | Must contain a field (defined by the dataField setting) containing the message to be sent. |
Output ports
Port | Description |
---|---|
done | Outputs events that were successfully sent, without any modification. |
error | Outputs events that were not successfully sent, enriched with standard error fields. |
Example
In this example, we want to write events into a RabbitMQ queue.
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:
Then, add the Rabbit Sender unit to the Flow and link it to the Tick unit.
In the properties, we need to enter the data used to establish the initial connection to RabbitMQ, such as Host, Port, Username, Password, Target destination, and more.
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, filling in the Rabbit Sender data:
Â