RabbitMQ
Dec 6 2023 at 12:00 AM
Introduction
This data source is configured to subscribe to one or more queues (topics) on a RabbitMQ Server. The payload for each message published to the specified queue(s) will consist of the raw bytes received.
Example Options File
{
"Devices": {
"Device1": {
"DeviceType": "Generic",
...
"DataSource": {
"DataSourceType": "Rabbit",
"Servers": [
"localhost"
],
"Topics": {
"Telemetry": "natsTopic/liveTelemetry",
}
"Username": "guest",
"Password": "guest",
"UseTls": false,
"QueueOptions": {
"Declare": true
}
},
...
}
}
}
Property Details
Here is an overview of the parameters for configuring the RabbitMQ data source:
Property Name | Description |
---|---|
DataSourceType | Specifies that the data source is of type “Rabbit.” |
Servers | The list of server names or IP addresses of the RabbitMQ server cluster. |
Topics | The list of Topic Names and their associated RabbitMQ queue names to subscribe to. |
PortNo | The port number used when connecting to the RabbitMQ server. The parameter PortNo defaults to -1, indicating that the RabbitMQ client should automatically choose the default port based on the settings. |
VirtualHost | Virtual Host to access during this connection. |
Exchange | The Rabbit Exchange to use. Leave blank to use the “amq.topic” exchange. Note that the RabbitMQ message queue plugin only supports Topic exchanges. |
AuthMechanism | The authentication mechanism to use. Defaults to “Plain”. Refer to the section below. |
UserName | The username used when connecting to the RabbitMQ server. |
Password | The password used when connecting to the RabbitMQ server. |
UseTls | Indicates whether to use TLS to connect to the server. Defaults to true. |
TlsVersions | Indicates the TLS versions to use. Refer to the section below. |
ValidateTlsCertificate | Specifies whether to validate the Server’s certificate during connection. Defaults to false. |
CertificatePath | The full path to the X509 certificate to use. |
CertificatePassword | The password used to open the X509 certificate. |
QueueOptions | Options to use when declaring queues. Refer to the section below. |
HeartbeatSecs | Heartbeat interval in seconds. Defaults to 60 seconds. Set this to 0 to disable. |
ConnectionRecoverySecs | The amount of time, in seconds, to wait before retrying to recover a connection after disconnect. Defaults to 15 seconds. |
Auth Mechanism Options
Here is an overview of the RabbitMQ Auth Mechanism Options:
Auth Mechanism | Value | Description |
---|---|---|
Plain | 0 | This mechanism involves a plain user name and password authentication. |
External | 1 | Authentication occurs using an out-of-band mechanism such as X.509 certificate peer verification, client IP address range, or similar. These mechanisms are typically provided by RabbitMQ plugins. |
Queue Options
Here are explanations for the Queue Options associated with the RabbitMQ data source:
Property | Description |
---|---|
Declare | Specifies whether to declare queues before attempting to use them. Defaults to false. |
Durable | Indicates whether the queue is declared as durable, meaning it survives Broker restarts. |
Exclusive | Determines whether the queue is declared as exclusive, accessible only by the connection that created it. |
AutoDelete | Specifies whether the declared queue is deleted automatically after the last consumer has disconnected. |
TLS Version Options
Here is a tabular representation of the TLS version options for RabbitMQ:
TLS Version | Value | Description |
---|---|---|
All | 0 | Any version of TLS will be allowed. This is the default value. |
AtLeastTls12 | 1 | Only TLS 1.2 or higher will be allowed. |
AtLeastTls13 | 2 | Only TLS 1.3 or higher will be allowed. |
Configuration of the RabbitMQ data source node
Every device should include the Device Information, Data Source, and Filter nodes. To create a device, click the +
icon located on the top-left side of the ‘Create Device’ screen as shown in Figure 1. This action opens a configuration window for the device. Within this screen, users can select and add the necessary nodes. To add a node, access the ‘Add Node’ window, as illustrated in Figure 2.
Figure 1 - Create Device
The window below enables the user to add and configure a data source node.
Figure 2 - Add Node
The RabbitMQ node consists of features to:
- Configure the node: Allows users to customize and adjust the settings of the selected node according to their requirements.
- Show nodes compatible with the selected node: Displays nodes that are compatible with the selected node, providing a streamlined view of related options.
- Bring up the help centre for the node: Directs users to the help centre for the selected node, offering detailed guidance and documentation.
- Copy icon: Permits users to duplicate the selected node, facilitating efficient replication of configurations.
- Delete the node: Enables users to remove the selected node from the configuration, allowing for adjustments and refining the setup.
Figure 3 - Node Features
Upon selecting the configure button in Figure 3, the window for the RabbitMQ data source node is presented as illustrated in Figure 4. In this interface, users can input and edit relevant information to configure the RabbitMQ data source.
Figure 4 - RabbitMQ data source node
The following explanations help clarify the purpose and significance of each parameter in the configuration of the RabbitMQ data source.
- Data Source Options: This feature enables users to establish the origin and method type of the data source.
- Data source type
- Configuration path
- Servers - Port Number: Specifies the port number for the RabbitMQ servers.
- Topics: Users post their routing key, and the system selects the topic based on that input. Parse topics are simplified representations of these topics.
- Virtual Host: Represents a path not related to the server.
- Authentication Mechanism: Requires a username and password if set.
- Use TLS and Validate TLS Certificate: These checkboxes pertain to security certificates, with “Use TLS” indicating whether to establish a secure TLS connection, and “Validate TLS Certificate” specifying whether to validate the RabbitMQ server’s TLS certificate during connection.
- Queue Options: Additional details about the queue configuration.