How to run RTI DDS Service as Windows Service
It is possible to run any of the RTI DDS Services as a Windows Service.
Starting with version 5.2.0, program nssm.exe can be found on directory %NDDSHOME%\resource\app\bin\%ARCH%
In case you are running a version of RTI Connext DDS which does not include nssm, it can be downloaded from https://nssm.cc/
To create a Windows Service, e.g. to install Recording service as a Windows Service, just execute in a command line shell "nssm.exe install recording" Following window will be shown:
Path: Select the program that you want to execute as Windows Service, e.g. C:\Program Files\rti_connext_dds-5.2.0\bin\rtirecord.bat
Startup directory: Select that starting working directory that the program shall have. E.g. in case of a Recording Servide you can create a directory and copy on it a file named USER_RECORDING_SERVICE.xml. Recording Service will automatically load this file as it can be found in its working directory.
Arguments: Any argument that the selected application needs. In that case Recording Service needs the configuration name to use (which shall be found in file USER_RECORDING_SERVICE.xml).
It is also recommended to set log files for the output and error logs, so in case there is any error while running the service it is possible to know what is going wrong. This can be achieved in the I/O tab, e.g.
And also very important to correctly set the necessary environment variables so all needed libraries can be found, e.g.:
And finally, as explained in the following KB https://community.rti.com/kb/why-doesnt-my-rti-connext-application-communicate-rti-connext-application-installed-windows
it is not possible to use shared memory to communicate with a RTI DDS Service which is running as a Windows Service. So, it is recommended that both, the application which is publishing samples and the RTI DDS Service running as Windows Service disable shared memory transport. E.g. following with Recording Service example, it would be as easy as including a file named USER_QOS_PROFILES.xml in the working directory C:\record_service with the following QoS:
<participant_qos> <transport_builtin> <mask>UDPv4</mask> </transport_builtin> <discovery> <initial_peers> <element>builtin.udpv4:/127.0.0.1</element> <element>builtin.udpv4:/239.225.0.1</element> </initial_peers> </discovery> </participant_qos>