Skip to content

Commit 9ba97f9

Browse files
Send only non-default QoS & Use 'serialize_optional_qos' for optional QoS in EDP messages (#1065)
* Refs #23078: Document new property Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> * Refs #23078: Review Signed-off-by: cferreiragonz <carlosferreira@eprosima.com> --------- Signed-off-by: cferreiragonz <carlosferreira@eprosima.com>
1 parent 7c872be commit 9ba97f9

3 files changed

Lines changed: 103 additions & 4 deletions

File tree

code/DDSCodeTester.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,16 @@ void dds_domain_examples()
981981
"disabled");
982982
//!--
983983
}
984+
985+
{
986+
// SERIALIZE_OPTIONAL_QOS_PROPERTY
987+
DomainParticipantQos pqos;
988+
989+
pqos.properties().properties().emplace_back(
990+
"fastdds.serialize_optional_qos",
991+
"True");
992+
//!--
993+
}
984994
}
985995

986996
//DOMAINPARTICIPANTLISTENER-DISCOVERY-CALLBACKS
@@ -2062,7 +2072,7 @@ void dds_topic_examples()
20622072
include_paths.push_back("<path/to/folder/containing/included/idl/files>");
20632073

20642074
// Retrieve the instance of the desired type
2065-
DynamicTypeBuilder::_ref_type dyn_type_builder =
2075+
DynamicTypeBuilder::_ref_type dyn_type_builder =
20662076
DynamicTypeBuilderFactory::get_instance()->create_type_w_uri(idl_file, type_name, include_paths);
20672077

20682078
// Register dynamic type
@@ -7937,7 +7947,7 @@ void rpcdds_internal_api_examples()
79377947
// Error
79387948
return;
79397949
}
7940-
7950+
79417951
// Wait for some time until a Reply sample is received
79427952
requester->get_requester_reader()->wait_for_unread_message(Duration_t{3,0});
79437953

@@ -7948,12 +7958,12 @@ void rpcdds_internal_api_examples()
79487958
// Error
79497959
return;
79507960
}
7951-
7961+
79527962
if (expected_request_info.related_sample_identity == received_request_info.related_sample_identity)
79537963
{
79547964
// Received Reply sample is associated to the sent Request sample
79557965
}
7956-
7966+
79577967
// Delete created Requester
79587968
ret = participant->delete_service_requester(requester->get_service_name(), requester);
79597969
if (RETCODE_OK != ret)

code/XMLTester.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,6 +3293,30 @@
32933293
-->
32943294
<!--><-->
32953295

3296+
<!-->SERIALIZE_OPTIONAL_QOS_PROPERTY<-->
3297+
<!--
3298+
<?xml version="1.0" encoding="UTF-8" ?>
3299+
<dds xmlns="http://www.eprosima.com">
3300+
<profiles>
3301+
-->
3302+
<participant profile_name="serialize_optional_qos_domainparticipant_xml_profile">
3303+
<rtps>
3304+
<propertiesPolicy>
3305+
<properties>
3306+
<property>
3307+
<name>fastdds.serialize_optional_qos</name>
3308+
<value>True</value>
3309+
</property>
3310+
</properties>
3311+
</propertiesPolicy>
3312+
</rtps>
3313+
</participant>
3314+
<!--
3315+
</profiles>
3316+
</dds>
3317+
-->
3318+
<!--><-->
3319+
32963320
<!-->FASTDDS_STATISTICS_MODULE<-->
32973321
<participant profile_name="statistics_domainparticipant_conf_xml_profile">
32983322
<rtps>

docs/fastdds/property_policies/non_consolidated_qos.rst

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,3 +474,68 @@ The different property values have the following effects on the local |DomainPar
474474
:start-after: <!-->TYPE_PROPAGATION_PROPERTY<-->
475475
:end-before: <!--><-->
476476
:lines: 2-4,6-17,19-20
477+
478+
.. _property_serialize_optional_qos:
479+
480+
Adding optional QoS to Discovery data
481+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
482+
483+
During the Endpoint Discovery Phase (EDP), |DataWriters-api| and |DataReaders-api| acknowledge each other.
484+
To do that, the DomainParticipants share information about their DataWriters and DataReaders with each other,
485+
using the communication channels established during the PDP.
486+
This information contains all data required to match the endpoints, such as the |Topic-api|, data type, and
487+
certain :ref:`QoS Policies <dds_layer_core_policy>` that might affect matching.
488+
Specific compatibility rules can be found in each QoS section of :ref:`QoS Policies <dds_layer_core_policy>`.
489+
490+
However, there are some QoS that are not mandatory for matching, but can be useful to have in the EDP messages.
491+
Property ``fastdds.serialize_optional_qos`` allows the user to include these optional QoS in the EDP messages.
492+
This property is configured at the |DomainParticipant-api| level through the policy :ref:`propertypolicyqos`.
493+
Hence, all associated endpoints to that |DomainParticipant-api| will send their optional QoS in the EDP messages.
494+
495+
Optional QoS, like any other QoS, will only be serialized if they have non-default values.
496+
Not receiving information about a QoS in the EDP message means that it has a default value.
497+
Optional QoS will be serialized if the value of the property is set to ``TRUE``, ``True``, ``true`` or ``1``, any
498+
other value will be considered as not set or ``FALSE``.
499+
500+
The following table lists all the optional QoS that can be serialized in the EDP messages:
501+
502+
.. list-table::
503+
:header-rows: 1
504+
:align: left
505+
506+
* - PropertyPolicyQos
507+
- Applies to:
508+
* - |ResourceLimitsQosPolicy-api|
509+
- |DataWriter-api| and |DataReaders-api|.
510+
* - |TransportPriorityQosPolicy-api|
511+
- |DataWriter-api|.
512+
* - |WriterDataLifecycleQosPolicy-api|
513+
- |DataWriter-api|.
514+
* - |ReaderDataLifecycleQosPolicy-api|
515+
- |DataReaders-api|.
516+
* - |PublishModeQosPolicy-api|
517+
- |DataWriter-api|.
518+
* - |RTPSReliableWriterQos-api|
519+
- |DataWriter-api|.
520+
* - |RTPSReliableReaderQos-api|
521+
- |DataReaders-api|.
522+
* - |RTPSEndpointQos-api|
523+
- |DataWriter-api| and |DataReaders-api|.
524+
* - |WriterResourceLimitsQos-api|
525+
- |DataWriter-api|.
526+
* - |ReaderResourceLimitsQos-api|
527+
- |DataReaders-api|.
528+
529+
.. tab-set-code::
530+
531+
.. literalinclude:: /../code/DDSCodeTester.cpp
532+
:language: c++
533+
:start-after: // SERIALIZE_OPTIONAL_QOS_PROPERTY
534+
:end-before: //!--
535+
:dedent: 8
536+
537+
.. literalinclude:: /../code/XMLTester.xml
538+
:language: xml
539+
:start-after: <!-->SERIALIZE_OPTIONAL_QOS_PROPERTY<-->
540+
:end-before: <!--><-->
541+
:lines: 2-4,6-17,19-20

0 commit comments

Comments
 (0)