Skip to content

Commit

Permalink
Refs #20849: Add max_message_size property policy docs
Browse files Browse the repository at this point in the history
Signed-off-by: elianalf <62831776+elianalf@users.noreply.github.com>
  • Loading branch information
elianalf committed May 16, 2024
1 parent a783abc commit 485fcb3
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 5 deletions.
32 changes: 27 additions & 5 deletions code/DDSCodeTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,28 @@ void dds_domain_examples()
"unicast");
//!--
}

{
// MAX_MESSAGE_SIZE_PROPERTY_PARTICIPANT
eprosima::fastrtps::rtps::RTPSParticipantAttributes part_attributes;

// Set maximum number of bytes of the datagram to be sent
part_attributes.properties.properties().emplace_back(
"fastdds.max_message_size",
"1200");
//!--
}

{
// MAX_MESSAGE_SIZE_PROPERTY_WRITER
eprosima::fastrtps::rtps::WriterAttributes writer_attributes;

// Set maximum number of bytes of the datagram to be sent
writer_attributes.endpoint.properties.properties().emplace_back(
"fastdds.max_message_size",
"1200");
//!--
}
}

//DOMAINPARTICIPANTLISTENER-DISCOVERY-CALLBACKS
Expand Down Expand Up @@ -4986,10 +5008,10 @@ void dynamictypes_examples()
sequence_member_descriptor->type(DynamicTypeBuilderFactory::get_instance()->create_type(
type_descriptor)->build());
*/

// Add the sequence member to the struct
struct_builder->add_member(sequence_member_descriptor);

sequence_member_descriptor = traits<MemberDescriptor>::make_shared();
sequence_member_descriptor->name("short_sequence");
sequence_member_descriptor->type(DynamicTypeBuilderFactory::get_instance()->create_sequence_type(
Expand Down Expand Up @@ -5027,7 +5049,7 @@ void dynamictypes_examples()
int16_t out_simple_value;
sequence_data->set_int16_value(2, in_simple_value);
sequence_data->get_int16_value(out_simple_value, 2);

data->return_loaned_value(sequence_data);
//!--
}
Expand Down Expand Up @@ -5080,7 +5102,7 @@ void dynamictypes_examples()
int32_t out_simple_value;
array_data->set_int32_value(2, in_simple_value);
array_data->get_int32_value(out_simple_value, 2);

data->return_loaned_value(array_data);
//!--
}
Expand Down Expand Up @@ -5351,7 +5373,7 @@ void dynamictypes_examples()
// Get the loan for the bitset member
DynamicData::_ref_type bitset_data = data->loan_value(data->get_member_id_by_name("my_bitset"));

// Set and retrieve bitfield values
// Set and retrieve bitfield values
int16_t in_value {2};
int16_t out_value;
bitset_data->set_int16_value(bitset_data->get_member_id_by_name("d"), in_value);
Expand Down
36 changes: 36 additions & 0 deletions code/XMLTester.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3232,6 +3232,42 @@
-->
<!--><-->

<!-->MAX_MESSAGE_SIZE_PROPERTY_PARTICIPANT<-->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
-->
<participant profile_name="max_message_size_participant_xml_profile">
<rtps>
<propertiesPolicy>
<properties>
<!-- Avoid local matching of this participant's endpoints -->
<property>
<name>fastdds.max_message_size</name>
<value>1200</value>
</property>
</properties>
</propertiesPolicy>
</rtps>
</participant>
<!--><-->

<!-->MAX_MESSAGE_SIZE_PROPERTY_WRITER<-->
<!--
<?xml version="1.0" encoding="UTF-8" ?>
-->
<data_writer profile_name="max_msg_size_datawriter_xml_profile">
<propertiesPolicy>
<properties>
<!-- Enable pull mode -->
<property>
<name>fastdds.max_message_size</name>
<value>1200</value>
</property>
</properties>
</propertiesPolicy>
</data_writer>
<!--><-->

<!-->FASTDDS_STATISTICS_MODULE<-->
<participant profile_name="statistics_domainparticipant_conf_xml_profile">
<rtps>
Expand Down
69 changes: 69 additions & 0 deletions docs/fastdds/property_policies/non_consolidated_qos.rst
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,72 @@ The behavior regarding this can be configured using the property ``fastdds.shm.e
:language: xml
:start-after: <!-->XML-SHM-ENFORCE-META-TRAFFIC
:end-before: <!--><-->

.. _property_max_message_size:

Maximum Message Size
^^^^^^^^^^^^^^^^^^^^

It is possible to set the maximum number of bytes of an RTPS datagram sent by an RTPSParticipant.
The value can be set in the RTPSParticipant properties or in the RTPSWriter properties.

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

* - PropertyPolicyQos name
- PropertyPolicyQos value
- Default value
* - ``"fastdds.max_message_size"``
- ``int32_t``
- ``"4294967295"``

.. tabs::

.. tab:: C++

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

.. tab:: XML

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->MAX_MESSAGE_SIZE_PROPERTY_PARTICIPANT<-->
:end-before: <!--><-->
:lines: 2,4-16

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

* - PropertyPolicyQos name
- PropertyPolicyQos value
- Default value
* - ``"fastdds.max_message_size"``
- ``int32_t``
- ``"4294967295"``

.. tabs::

.. tab:: C++

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

.. tab:: XML

.. literalinclude:: /../code/XMLTester.xml
:language: xml
:start-after: <!-->MAX_MESSAGE_SIZE_PROPERTY_WRITER<-->
:end-before: <!--><-->
:lines: 2,4-14

.. note::
An invalid value of ``fastdds.max_message_size`` results in an exception.

0 comments on commit 485fcb3

Please sign in to comment.