When do I need to send TypeCode or TypeObject?

Note: Applies to Connext DDS 5.x and above

Sending TypeCode/TypeObject on the wire provides convenience over specifying the type via XML configuration, but has the disadvantage that more data must be sent during endpoint discovery. This can cause network congestion problems when the TypeCode/TypeObject is large or must be sent many times.

To determine if sending TypeObject/TypeCode is necessary for your system, you should consider the three main types of Connext DDS applications which you may be running, as well as which features you’re making use of in each case:

  1. A user application with type support generated by rtiddsgen and compiled into your program does not need to receive TypeCode/TypeObject from the wire.

    Note: In scenario 1 above, be aware that by not sending the type on the wire, the user loses the ability to use Type Matching, and type evolution cannot be enforced. See "Type Safety and System Evolution" in the Extensible Types Guide for more information.

  2. A user application which uses the DynamicData API is flexible, and can have the type specified via XML, constructed programmatically, or received from the wire.

  3. An RTI service or tool that publishes/subscribes to a topic is flexible, and can have the type specified via XML or received from the wire.

If your use-case does not call for receiving the type from the wire, you can avoid unnecessary endpoint discovery traffic by disabling the TypeCode and TypeObject propagation via the DomainParticipantResourceLimits QoS. The XML snippets below shows how to configure this for Connext DDS 5.x and 6.x: 

<!-- To disable sending the type on the wire in Connext 5.x, the max serialized length for both TypeCode and TypeObject must be set to 0 -->

<participant_qos>
    <resource_limits>
        <type_code_max_serialized_length>0</type_code_max_serialized_length>
        <type_object_max_serialized_length>0</type_object_max_serialized_length>
    </resource_limits>
</participant_qos>

To save on bandwidth, Connext 6.0.0 and later releases compress the TypeObject by default and do not send TypeCode by default. If you don't require TypeObject to be sent, you can further reduce bandwidth with this snippet: 

<!-- To disable sending the type on the wire in Connext 6.x, only the max serialized length for TypeObject must be set to 0. 
 Type_code_max_serialized_length defaults to 0 -->

<participant_qos>
    <resource_limits>
        <type_object_max_serialized_length>0</type_object_max_serialized_length> 
    </resource_limits>
</participant_qos>

Disabling TypeCode Only (Connext DDS 5.x)

Users of Connext DDS 5.x should consider that in many scenarios, only TypeObject or TypeCode needs to be sent, but usually not both. TypeCode only needs to be sent if there are DDS applications running within your system that do not support TypeObject, such as applications running RTI Connext DDS 4.x. In many cases, users of Connext DDS 5.x can set  type_code_max_serialized_length to 0 so that only TypeObject is sent. The XML snippet below shows how to configure this:  

<participant_qos>
    <resource_limits>
        <type_code_max_serialized_length>0</type_code_max_serialized_length>
    </resource_limits>
</participant_qos>
 

 For further detail about this topic, please contact support@rti.com.

Programming Language: