Link Search Menu Expand Document

RabbitMQ

Dec 6 2023 at 12:00 AM

  1. Introduction
  2. Example Options File
    1. Property Details
    2. Auth Mechanism Options
    3. Queue Options
    4. TLS Version Options
  3. Configuration of the RabbitMQ data source node

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 NameDescription
DataSourceTypeSpecifies that the data source is of type “Rabbit.”
ServersThe list of server names or IP addresses of the RabbitMQ server cluster.
TopicsThe list of Topic Names and their associated RabbitMQ queue names to subscribe to.
PortNoThe 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.
VirtualHostVirtual Host to access during this connection.
ExchangeThe Rabbit Exchange to use. Leave blank to use the “amq.topic” exchange. Note that the RabbitMQ message queue plugin only supports Topic exchanges.
AuthMechanismThe authentication mechanism to use. Defaults to “Plain”. Refer to the section below.
UserNameThe username used when connecting to the RabbitMQ server.
PasswordThe password used when connecting to the RabbitMQ server.
UseTlsIndicates whether to use TLS to connect to the server. Defaults to true.
TlsVersionsIndicates the TLS versions to use. Refer to the section below.
ValidateTlsCertificateSpecifies whether to validate the Server’s certificate during connection. Defaults to false.
CertificatePathThe full path to the X509 certificate to use.
CertificatePasswordThe password used to open the X509 certificate.
QueueOptionsOptions to use when declaring queues. Refer to the section below.
HeartbeatSecsHeartbeat interval in seconds. Defaults to 60 seconds. Set this to 0 to disable.
ConnectionRecoverySecsThe 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 MechanismValueDescription
Plain0This mechanism involves a plain user name and password authentication.
External1Authentication 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:

PropertyDescription
DeclareSpecifies whether to declare queues before attempting to use them. Defaults to false.
DurableIndicates whether the queue is declared as durable, meaning it survives Broker restarts.
ExclusiveDetermines whether the queue is declared as exclusive, accessible only by the connection that created it.
AutoDeleteSpecifies 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 VersionValueDescription
All0Any version of TLS will be allowed. This is the default value.
AtLeastTls121Only TLS 1.2 or higher will be allowed.
AtLeastTls132Only 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.

Generic Driver

Figure 1 - Create Device

The window below enables the user to add and configure a data source node.

Generic Driver

Figure 2 - Add Node

The RabbitMQ node consists of features to:

  1. Configure the node: Allows users to customize and adjust the settings of the selected node according to their requirements.
  2. Show nodes compatible with the selected node: Displays nodes that are compatible with the selected node, providing a streamlined view of related options.
  3. Bring up the help centre for the node: Directs users to the help centre for the selected node, offering detailed guidance and documentation.
  4. Copy icon: Permits users to duplicate the selected node, facilitating efficient replication of configurations.
  5. Delete the node: Enables users to remove the selected node from the configuration, allowing for adjustments and refining the setup.

Generic Driver

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.

Generic Driver

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.

  1. Data Source Options: This feature enables users to establish the origin and method type of the data source.
    • Data source type
    • Configuration path
  2. Servers - Port Number: Specifies the port number for the RabbitMQ servers.
  3. Topics: Users post their routing key, and the system selects the topic based on that input. Parse topics are simplified representations of these topics.
  4. Virtual Host: Represents a path not related to the server.
  5. Authentication Mechanism: Requires a username and password if set.
  6. 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.
  7. Queue Options: Additional details about the queue configuration.

Continue reading