KB: How to use Services without sending TypeCode/TypeObject

In order to reduce discovery traffic, you can avoid sending the TypeCode and TypeObject from your applications and Services.

You avoid propagating the Type by setting the max_serialized_length in the QoS file as follows:

  • To not propagate TypeCode:
  • To not propagate TypeObject:

See this article to learn more about TypeCodes and TypeObjects.

If you are going to use a Service, you need to specify the type, so there is no need to propagate it. In order to do this with, for example, Routing Service, follow these steps:

  • Obtain the equivalent XML file from the IDL definition. We will use this XML type definition in the configuration file for Routing Service to specify the type. If you only have the IDL type definition, you can use rtiddsgen to generate an equivalent XML file:

    %NDDSHOME%/bin/rtiddsgen -convertToXML <idl_definition>
  • Define the type in the Routing Service configuration. In order to do this, you will need to specify the type inside the <types> label. There are two ways of doing this, by defining the XML file or by defining the type itself:

        <include file="types.xml"/>


        <struct name="ShapeType">
            <member name="color" stringMaxLenght="128" type="string" key="true"/>
            <member name="x" type="int32"/>
            <member name="y" type="int32"/> 
            <member name="shapesize" type="int32"/> 
  • Register the type for your participants:

        <registered_type name="ShapeType" type_name="ShapeType"/> 

Now the application and the Service will communicate properly without sending the TypeCode/TypeObject on the wire.

The Routing Service example is attached.