There are several ways to load XML QoS profiles into your application. In C, Traditional C++, Java and .NET, it's the singleton DomainParticipantFactory that loads these profiles. Applications using the Modern C++ API can create any number of instances of dds::core::QosProvider with different parameters to load different QoS profiles or, they can use the singleton QosProvider::Default(). The profiles configured in the default QosProvider are used when creating an Entity without an explicit QoS parameter.
Here are the various approaches, listed in load order:
Semicolons indicate to Connext DDS to load multiple files or strings all at once. For example:
On UNIX-like systems with bash
export NDDS_QOS_PROFILES=file:///usr/local/default_dds_1.xml; file:///usr/local/default_dds_2.xml
On UNIX-like systems with tcsh
setenv NDDS_QOS_PROFILES file:///usr/local/default_dds_1.xml; file:///usr/local/default_dds_2.xml
In a Windows command prompt
set NDDS_QOS_PROFILES=file://D:/Data/ConnextDDSExample/default_dds_1.xml; file://D:/Data/ConnextDDSExample/default_dds_2.xml
Note: The url_profile and string_profile fields are useful for adding profiles programmatically, when you do not want to use an environment variable.
You may use a combination of the above approaches.
The location of the XML documents (only files and strings are supported) is specified using URL (Uniform Resource Locator) format. For example:
If you omit the URL schema name, Connext DDS will assume a file name. For example:
Note: The path you specify can be absolute or relative. If you specify a relative path, it should be a path to a file that is lower down in the file hierarchy, not higher up.
Duplicate QoS profiles are not allowed. Connext DDS will report an error message in these scenarios. To overwrite a QoS profile, use 19.3.3 QoS Profile Inheritance and Composition.
Several QoS profiles are built into the Connext DDS core libraries and can be used as starting points when configuring QoS for your Connext DDS applications. For details, see 19.4 Configuring QoS with XML.
To load redundant locations for a single XML file, see 19.8 URL Groups (Loading Redundant Locations).
© 2020 RTI