.. py:currentmodule:: rticonnextdds_connector Defining a DDS System in XML ============================ *Connector* loads the definition of a DDS system from an XML configuration file that includes the definition of domains, *DomainParticipants*, *Topics*, *DataReaders* and *DataWriters*, data types and quality of service. .. image:: static/xml_doc.png :align: center *Connector* uses the XML schema defined by RTI's `XML-Based Application Creation feature `__. .. hint:: The *Connext DDS* C, C++, Java and .NET APIs can also load the same XML files you write for *Connector*. The following table summarizes the XML tags, the DDS concepts they define, and how they are exposed in the *Connector* API: .. list-table:: XML Configuration Tags :header-rows: 1 * - XML Tag - DDS Concept - Connector API * - ```` - *DDS data types* (the types associated with *Topics*) - Types used by inputs and outputs (:class:`Input` and :class:`Output`). * - ````, ````, ```` and ```` - *DDS Domain*, *Topic* - Defines the domain joined by a :class:`Connector` and the *Topics* used by its inputs and outputs (:class:`Input` and :class:`Output`). * - ```` and ```` - *DomainParticipant* - Each :class:`Connector` instance loads a ````. See :ref:`Loading a Connector`. * - ```` and ```` - *Publisher* and *DataWriter* - Each ```` defines an :class:`Output`. See :ref:`Writing Data (Output)`. * - ```` and ```` - *Subscriber* and *DataReader* - Each ```` defines an :class:`Input`. See :ref:`Reading Data (Input)`. * - ```` and ```` - Quality of service (QoS) - Quality of service used to configure :class:`Connector`, :class:`Input` and :class:`Output`. .. hint:: For an example configuration file, see `ShapeExample.xml `__. Data types ~~~~~~~~~~ The ```` tags define the data types associated with the *Topics* to be published or subscribed to. The following example defines a *ShapeType* with four members: ``color``, ``x``, ``y`` and ``shapesize``: .. code-block:: xml Types are associated with *Topics*, as explained in the next section, :ref:`Domain Library`. .. hint:: You can define your types in IDL and convert them to XML with `rtiddsgen `__. For example: ``rtiddsgen -convertToXml MyTypes.idl`` For more information about defining types, see `Creating User Data Types with XML `__ in the *RTI Connext DDS Core Libraries User's Manual*. For more information about accessing data samples, see :ref:`Accessing the data`. Domain library ~~~~~~~~~~~~~~ A domain library is a collection of domains. A domain specifies: * A `domain id `__. * A set of registered types (from a subset of the types in ````). A registered type can have a local name. * A set of `topics `__, which are used by *DataReaders* and *DataWriters*. .. code-block:: xml For more information about the format of a domain library, see `XML-Based Application Creation: Domain Library `__. Participant library ~~~~~~~~~~~~~~~~~~~ A *DomainParticipant* joins a domain and contains *Publishers* and *Subscribers*, which contain *DataWriters* and *DataReaders*, respectively. Each :class:`Connector` instance created by your application is associated with a ````, as explained in :ref:`Loading a Connector`. *DataReaders* and *DataWriters* are associated with a *DomainParticipant* and a *Topic*. In *Connector*, each ```` tag defines an :class:`Output`, as described in :ref:`Writing data (Output)`; and each ```` tag defines an :class:`Input`, as described in :ref:`Reading data (Input)`. .. code-block:: xml For more information about the format of a participant library, see `XML-Based Application Creation: Participant Library `__. Quality of service ~~~~~~~~~~~~~~~~~~ All DDS entities have an associated `quality of service (QoS) `__. There are several ways to configure it. You can define a QoS profile and make it the default. The following example configures all *DataReaders* and *DataWriters* with reliable and transient-local QoS: .. code-block:: xml RELIABLE_RELIABILITY_QOS TRANSIENT_LOCAL_DURABILITY_QOS RELIABLE_RELIABILITY_QOS TRANSIENT_LOCAL_DURABILITY_QOS You can define the QoS for each individual entity: .. code-block:: xml RELIABLE_RELIABILITY_QOS TRANSIENT_LOCAL_DURABILITY_QOS Or you can use profiles and override or define additional QoS policies for each entity: .. code-block:: xml You can also use builtin profiles and QoS snippets. For example, the following profile is equivalent to *MyQosProfile* above: .. code-block:: xml BuiltinQosSnippetLib::QosPolicy.Durability.TransientLocal BuiltinQosSnippetLib::QosPolicy.Reliability.Reliable You can read more in the *RTI Connext DDS Core Libraries User's Manual*, `Configuring QoS with XML `__. Logging ^^^^^^^ Logging can be configured as explained in `Configuring Logging via XML `__. For example, to increase the logging verbosity from the default (ERROR) to WARNING, define a ``qos_profile`` with the attribute ``is_default_participant_factory_profile="true"``: .. code-block:: xml WARNING