2. User Interface

eProsima DDS Router is an application executed from command line.

2.1. Source Dependency Libraries

eProsima DDS Router depends on Fast DDS fastrtps and fastcdr libraries. In order to correctly execute the Router, make sure that fastrtps and fastcdr are properly sourced.

source <path-to-fastdds-installation>/install/setup.bash

Note

If Fast DDS has been installed in the system, these libraries would be sourced by default.

2.2. Application Arguments

The DDS Router application supports several input arguments:

Command

Option

Long option

Value

Default Value

Help Argument

-h

--help

Configuration File Argument

-c

--config-path

Readable File Path

./DDS_ROUTER_CONFIGURATION.yaml

Reload Time Argument

-r

--reload-time

Unsigned Integer

0

Debug Argument

-d

--debug

2.2.1. Help Argument

It shows the usage information of the application.

Usage: Fast DDS Router
Connect different DDS networks via DDS through LAN or WAN.
It will build a communication bridge between the different Participants included in the provided configuration file.
General options:
-h --help         Print this help message.
-c --config-path  Path to the Configuration File (yaml format) [Default: ./DDS_ROUTER_CONFIGURATION.yaml].
-r --reload-time  Time period in seconds to reload configuration file. This is needed when FileWatcher functionality is not available (e.g. config file is a symbolic link).
                    Value 0 does not reload file. [Default: 0].
-d --debug        Activate debug Logs (be aware that some logs may require specific CMAKE compilation options).

2.2.2. Configuration File Argument

Set the Configuration File.

2.2.3. Reload Time Argument

Set the Reload Timer in seconds.

2.2.4. Debug Argument

Activate INFO and DEBUG logs for the DDS Router execution. For this argument to work, the DDS Router must have been compiled with CMake option CMAKE_BUILD_TYPE=Debug, or compiled with CMake option LOG_INFO=ON.

2.3. Configuration File

A DDS Router requires one and only one YAML configuration file. Check section DDS Router Configuration in order to know how to write this configuration file.

This YAML configuration file must be passed as argument to the DDS Router when executed. If no configuration file is provided as argument, the DDS Router will attempt to load a file named DDS_ROUTER_CONFIGURATION.yaml that must be in the same directory where the application is executed. If no configuration file is passed as argument, and the default configuration file does not exist in the current directory, the application will fail.

2.4. Reload Topics

The topics that the DDS Router is routing could be changed at runtime. Including topics in configuration’s allowedlist will create new Writers and Readers for each Participant in the Router. Removing a topic from allowedlist will disable this topic, and so it will stop routing data in such topic. Be aware that disabling a topic does not eliminate the entities of that topic. So, if a topic has been active before, the Writers and Readers will still be present in the DDS Router and will still receive data.

There exist two methods to reload the list of allowed topics, an active and a passive one. Both methods work over the same configuration file with which the DDS Router has been initialized.

2.4.1. File Watcher

A File Watcher is a process that runs in the background and watches for changes in the DDS Router configuration file. Every time the file is changed, the OS sends a notification, and the File Watcher listens such notification and interacts with the DDS Router in order to reload the topics. This event occurs every time the configuration file is saved.

FileWatcher is used in every DDS Router execution by default. However, this method does not work properly in specific scenarios where the file being watched is not a real file but a link (e.g. Kubernetes executions).

2.4.2. Reload Timer

A timer could be set in order to periodically reload the configuration file. The configuration file will be automatically reloaded according to the specified time period.

2.5. Close Application

In order to stop a DDS Router application, just send an interruption SIGINT | ^C signal (signal value 2) to the process.