Skip to content

Commit

Permalink
DomainParticipant ignore_local_endpoints documentation (#485)
Browse files Browse the repository at this point in the history
* Refs #18153: Property documentation

Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com>

* Refs #18153: Add reference to the property in the ignore participant flags section

Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com>

* Refs #18153: Bonus commit: migrate discovery settings snippets to tabs

Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com>

* Refs #18153: Apply suggestions

Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com>

---------

Signed-off-by: Eduardo Ponz <eduardoponz@eprosima.com>
  • Loading branch information
EduPonz committed Apr 25, 2023
1 parent 921f644 commit 23898e8
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 106 deletions.
11 changes: 11 additions & 0 deletions code/DDSCodeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,17 @@ void dds_domain_examples()
);
//!--
}

{
// IGNORE_LOCAL_ENDPOINTS_DOMAINPARTICIPANT
DomainParticipantQos participant_qos;

// Avoid local matching of this participant's endpoints
participant_qos.properties().properties().emplace_back(
"fastdds.ignore_local_endpoints",
"true");
//!--
}
}

//DOMAINPARTICIPANTLISTENER-DISCOVERY-CALLBACKS
Expand Down
145 changes: 103 additions & 42 deletions code/XMLTester.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2095,57 +2095,93 @@
<!--><-->

<!-->CONF-DISCOVERY-PROTOCOL<-->
<participant profile_name="participant_discovery_protocol">
<rtps>
<builtin>
<discovery_config>
<discoveryProtocol>SIMPLE</discoveryProtocol>
</discovery_config>
</builtin>
</rtps>
</participant>
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<dds xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
<profiles>
-->
<participant profile_name="participant_discovery_protocol">
<rtps>
<builtin>
<discovery_config>
<discoveryProtocol>SIMPLE</discoveryProtocol>
</discovery_config>
</builtin>
</rtps>
</participant>
<!--
</profiles>
</dds>
-->
<!--><-->

<!-->CONF-DISCOVERY-IGNORE-FLAGS<-->
<participant profile_name="participant_discovery_ignore_flags">
<rtps>
<builtin>
<discovery_config>
<ignoreParticipantFlags>FILTER_DIFFERENT_PROCESS | FILTER_SAME_PROCESS</ignoreParticipantFlags>
</discovery_config>
</builtin>
</rtps>
</participant>
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<dds xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
<profiles>
-->
<participant profile_name="participant_discovery_ignore_flags">
<rtps>
<builtin>
<discovery_config>
<ignoreParticipantFlags>FILTER_DIFFERENT_PROCESS | FILTER_SAME_PROCESS</ignoreParticipantFlags>
</discovery_config>
</builtin>
</rtps>
</participant>
<!--
</profiles>
</dds>
-->
<!--><-->

<!-->CONF-DISCOVERY-LEASE-DURATION<-->
<participant profile_name="participant_discovery_lease_duration">
<rtps>
<builtin>
<discovery_config>
<leaseDuration>
<sec>10</sec>
<nanosec>20</nanosec>
</leaseDuration>
</discovery_config>
</builtin>
</rtps>
</participant>
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<dds xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
<profiles>
-->
<participant profile_name="participant_discovery_lease_duration">
<rtps>
<builtin>
<discovery_config>
<leaseDuration>
<sec>10</sec>
<nanosec>20</nanosec>
</leaseDuration>
</discovery_config>
</builtin>
</rtps>
</participant>
<!--
</profiles>
</dds>
-->
<!--><-->

<!-->CONF-DISCOVERY-LEASE-ANNOUNCEMENT<-->
<participant profile_name="participant_discovery_lease_announcement">
<rtps>
<builtin>
<discovery_config>
<leaseAnnouncement>
<sec>1</sec>
<nanosec>2</nanosec>
</leaseAnnouncement>
</discovery_config>
</builtin>
</rtps>
</participant>
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<dds xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
<profiles>
-->
<participant profile_name="participant_discovery_lease_announcement">
<rtps>
<builtin>
<discovery_config>
<leaseAnnouncement>
<sec>1</sec>
<nanosec>2</nanosec>
</leaseAnnouncement>
</discovery_config>
</builtin>
</rtps>
</participant>
<!--
</profiles>
</dds>
-->
<!--><-->

<!-->DISCOVERY-CONFIG-INITIAL-ANNOUNCEMENT<-->
Expand Down Expand Up @@ -2585,6 +2621,31 @@
</data_writer>
<!--><-->

<!-->IGNORE_LOCAL_ENDPOINTS_DOMAINPARTICIPANT<-->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
<dds xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
<profiles>
-->
<participant profile_name="ignore_local_endpoints_domainparticipant_xml_profile">
<rtps>
<propertiesPolicy>
<properties>
<!-- Avoid local matching of this participant's endpoints -->
<property>
<name>fastdds.ignore_local_endpoints</name>
<value>true</value>
</property>
</properties>
</propertiesPolicy>
</rtps>
</participant>
<!--
</profiles>
</dds>
-->
<!--><-->

<!-->FASTDDS_STATISTICS_MODULE<-->
<participant profile_name="statistics_domainparticipant_conf_xml_profile">
<rtps>
Expand Down
135 changes: 71 additions & 64 deletions docs/fastdds/discovery/general_disc_settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,23 @@ The possible values are:
| | | RTPS layer methods. |
+---------------------+---------------------+--------------------------------------------------------------------------+

+----------------------------------------------------------------------------------------------------------------------+
| **C++** |
+----------------------------------------------------------------------------------------------------------------------+
| .. literalinclude:: /../code/DDSCodeTester.cpp |
| :language: c++ |
| :start-after: //CONF-DISCOVERY-PROTOCOL |
| :end-before: //!-- |
| :dedent: 8 |
+----------------------------------------------------------------------------------------------------------------------+
| **XML** |
+----------------------------------------------------------------------------------------------------------------------+
| .. literalinclude:: /../code/XMLTester.xml |
| :language: xml |
| :start-after: <!-->CONF-DISCOVERY-PROTOCOL |
| :end-before: <!--><--> |
+----------------------------------------------------------------------------------------------------------------------+
.. tabs::

.. tab:: C++

.. literalinclude:: /../code/DDSCodeTester.cpp
:language: c++
:start-after: //CONF-DISCOVERY-PROTOCOL
:end-before: //!--
:dedent: 8

.. tab:: XML

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->CONF-DISCOVERY-PROTOCOL
:end-before: <!--><-->
:lines: 2-4,6-14,16-17

.. _discovery_ignore_flags:

Expand Down Expand Up @@ -115,22 +116,26 @@ The possible values are:
| | host is discarded. |
+------------------------------------------------------------+---------------------------------------------------------+

+----------------------------------------------------------------------------------------------------------------------+
| **C++** |
+----------------------------------------------------------------------------------------------------------------------+
| .. literalinclude:: /../code/DDSCodeTester.cpp |
| :language: c++ |
| :start-after: //CONF-DISCOVERY-IGNORE-FLAGS |
| :end-before: //!-- |
| :dedent: 8 |
+----------------------------------------------------------------------------------------------------------------------+
| **XML** |
+----------------------------------------------------------------------------------------------------------------------+
| .. literalinclude:: /../code/XMLTester.xml |
| :language: xml |
| :start-after: <!-->CONF-DISCOVERY-IGNORE-FLAGS |
| :end-before: <!--><--> |
+----------------------------------------------------------------------------------------------------------------------+
.. tabs::

.. tab:: C++

.. literalinclude:: /../code/DDSCodeTester.cpp
:language: c++
:start-after: //CONF-DISCOVERY-IGNORE-FLAGS
:end-before: //!--
:dedent: 8

.. tab:: XML

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->CONF-DISCOVERY-IGNORE-FLAGS
:end-before: <!--><-->
:lines: 2-4,6-14,16-17

.. note::
To configure a |DomainParticipant| to not receive data from its own |DataWriters|, please refer to :ref:`property_ignore_local_endpoints`.

.. _discovery_lease_dur:

Expand All @@ -147,22 +152,23 @@ DomainParticipant receives any kind of traffic from the local DomainParticipant.

The lease duration is specified as a time expressed in seconds and nanosecond using a |Duration_t-api|.

+----------------------------------------------------------------------------------------------------------------------+
| **C++** |
+----------------------------------------------------------------------------------------------------------------------+
| .. literalinclude:: /../code/DDSCodeTester.cpp |
| :language: c++ |
| :start-after: //CONF-DISCOVERY-LEASE-DURATION |
| :end-before: //!-- |
| :dedent: 8 |
+----------------------------------------------------------------------------------------------------------------------+
| **XML** |
+----------------------------------------------------------------------------------------------------------------------+
| .. literalinclude:: /../code/XMLTester.xml |
| :language: xml |
| :start-after: <!-->CONF-DISCOVERY-LEASE-DURATION |
| :end-before: <!--><--> |
+----------------------------------------------------------------------------------------------------------------------+
.. tabs::

.. tab:: C++

.. literalinclude:: /../code/DDSCodeTester.cpp
:language: c++
:start-after: //CONF-DISCOVERY-LEASE-DURATION
:end-before: //!--
:dedent: 8

.. tab:: XML

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->CONF-DISCOVERY-LEASE-DURATION
:end-before: <!--><-->
:lines: 2-4,6-17,19-20

.. _discovery_lease_announ:

Expand All @@ -178,19 +184,20 @@ delay the discovery of late joiners.
DomainParticipant's announcement period is specified as a time expressed in seconds and nanosecond using a
|Duration_t-api|.

+----------------------------------------------------------------------------------------------------------------------+
| **C++** |
+----------------------------------------------------------------------------------------------------------------------+
| .. literalinclude:: /../code/DDSCodeTester.cpp |
| :language: c++ |
| :start-after: //CONF-DISCOVERY-LEASE-ANNOUNCEMENT |
| :end-before: //!-- |
| :dedent: 8 |
+----------------------------------------------------------------------------------------------------------------------+
| **XML** |
+----------------------------------------------------------------------------------------------------------------------+
| .. literalinclude:: /../code/XMLTester.xml |
| :language: xml |
| :start-after: <!-->CONF-DISCOVERY-LEASE-ANNOUNCEMENT |
| :end-before: <!--><--> |
+----------------------------------------------------------------------------------------------------------------------+
.. tabs::

.. tab:: C++

.. literalinclude:: /../code/DDSCodeTester.cpp
:language: c++
:start-after: //CONF-DISCOVERY-LEASE-ANNOUNCEMENT
:end-before: //!--
:dedent: 8

.. tab:: XML

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->CONF-DISCOVERY-LEASE-ANNOUNCEMENT
:end-before: <!--><-->
:lines: 2-4,6-17,19-20
50 changes: 50 additions & 0 deletions docs/fastdds/property_policies/ignore_local_endpoints.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.. include:: ../../03-exports/aliases.include
.. include:: ../../03-exports/aliases-api.include

.. _property_ignore_local_endpoints:

Ignore Local Endpoints
----------------------

By default, Fast DDS will automatically match all the endpoints (meaning |DataReaders| and |DataWriters|) belonging to a
given |DomainParticipant| as soon as they share the same |Topic| and have compatible Qos.
This however can result in undesired feedback whenever an application creates a |DataReader| and a |DataWriter| under
the same |DomainParticipant| on a shared |Topic|.
Although this feedback can be filtered out at the application level upon data reception by filtering out messages coming
from a |DataWriter| belonging to the same |DomainParticipant| on the |DataReader| receiving the data (by looking at the
|GuidPrefix_t-api|), this entails for a data sample to go all the way to the |DataReaderListener| just to be discarded
by an overcomplicated application business logic.
For this reason, Fast DDS offers the possibility of instructing the |DomainParticipant| to avoid the matching of local
endpoints through the following property:

.. list-table::
:header-rows: 1
:align: left

* - PropertyPolicyQos name
- PropertyPolicyQos value
- Default value
* - ``"fastdds.ignore_local_endpoints"``
- ``"true"``/``"false"``
- ``"false"``

.. tabs::

.. tab:: C++

.. literalinclude:: /../code/DDSCodeTester.cpp
:language: c++
:start-after: // IGNORE_LOCAL_ENDPOINTS_DOMAINPARTICIPANT
:end-before: //!--
:dedent: 8

.. tab:: XML

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->IGNORE_LOCAL_ENDPOINTS_DOMAINPARTICIPANT<-->
:end-before: <!--><-->
:lines: 2-4,6-18,20-21

.. note::
An invalid value of ``fastdds.ignore_local_endpoints`` results in the default behaviour.

0 comments on commit 23898e8

Please sign in to comment.