Routing Service between domain with Different DataTypes

8 posts / 0 new
Last post
Offline
Last seen: 3 days 4 hours ago
Joined: 09/10/2020
Posts: 9
Routing Service between domain with Different DataTypes

I have two applications runing DDS on different domain, 0 & 1. Both have different topics with different DataTypes. I want to route specific topics from Domain 1 to 0. When I tried this, I would get error stating "Incompatible offered QoS on DataWriter assocated with topic. Is it possible and how do I using the routing service for this? 

Howard's picture
Online
Last seen: 8 min 54 sec ago
Joined: 11/29/2012
Posts: 102

Are you saying that you want to route a topic in one domain to a different topic in a different domain and that the two topics have different datatypes?

Or is it that you just have different topics with different datatypes that you want to route through Routing Service, but the topic name and topic datatype will be the same in the domain from where its published to the domain to where its subscribed.

I assume that you are able to configure Routing Service to do this in the second case (which is pretty much the example configuration distributed with Routing Service).

For the first case, you can't use <auto_route>s which require the same topic and datatype for <input> and <output>, instead, you'll have to use <topic_route> to define a route between domains and between topics with different names and/or different datatypes.  You may need to use an assignment transformation if the names of the members in the input datatype and the output datatypes aren't exactly the same, and you need to map the member of the input Topic to a member of the output Topic.  See the example here, an example configuration file is provided in the workspace in your home directory, C:\Users\<name>\Documents\rti_workspace\6.0.1\examples\routing_service\shapes\topic_bridge_w_transf1.xml.

HOWEVER, the error that you are seeing has nothing to do with the configuration of routes, ""Incompatible offered QoS on DataWriter assocated with topic".  I'm not sure where you are seeing this error message, but assuming that it's being produced by Routing Service, this means that the DataWriter created by Routing Service to publish the data into the <output> domain has a QOS configuration that's incompatible with the applications that subscribe to the data in the <output> domain.

You'll need to use standard techniques to figure out what QOS values are incompatible, I suggest running RTI Admin Console, and then modify the QOS of the DataWriter created by Routing Service to use either the same QOS profile as used to create the DataReaders in the subscribing apps or to just configure the offending QOS policy with compatible values using the <datawriter_qos> tag in the <output> tag of a <topic_route>, see this doc.

 

 

Offline
Last seen: 3 days 4 hours ago
Joined: 09/10/2020
Posts: 9

Hi Howard,

It's the first instance. I have to two applications on different domain with different topics and datatypes in each. I want to route topics from Domain 1 to Domain 0 while keeping the datatypes of Domain 1. I was using the admin console to view the topics in both domains and saw the error right after i started the routing service using the xml.

File Attachments: 
Offline
Last seen: 3 days 4 hours ago
Joined: 09/10/2020
Posts: 9

I have the IDLs I want to use. The main IDL includes reference to other IDLs. Is there a way to convert the IDLs completely to DDS xml?

Howard's picture
Online
Last seen: 8 min 54 sec ago
Joined: 11/29/2012
Posts: 102

How do you mean "reference"?  Do you mean that it uses "#include <another.idl>" syntax?  Or does it just use types that were defined in another file?

Are these IDL files currently used to generate the type support code for your DDS applications?   I assume that your IDL files are passed to rtiddsgen to generate the type support code for the datatypes for use in your DDS applications.

If so, you can use rtiddsgen with the "-convertToXML" command line option to convert an IDL to XML format.  However, you'll need to do it for all of the IDL files that you have if one IDL file includes another IDL file.

Why do you need to convert the datatypes defined in IDL to XML?

 

 

Howard's picture
Online
Last seen: 8 min 54 sec ago
Joined: 11/29/2012
Posts: 102

I'm not sure what you mean by keeping the dataypes of Domain 1.  If the data types are different in Domain 0 and Domain 1, then when you deal with the data in Domain 0, Routing Service needs to use the data type defined in that domain, and the same for dealing with data in Domain 1.

As explained in my previous response, within Routing Service, you can use an assignment transformation to map members of the datatype defined in Domain 1 to the members of the datatype in Domain 0.

The RoutingService XML configuration file that you provided assumes that the datatypes in the input and output domains are exactly the same, which is why you see your error.

You have to change the Routing Service configuration to use specific data types in the input domain and output domain as well as apply an assignment transformation.  In my previous response, I pointed at an example that you can use and learn from.

Offline
Last seen: 3 days 4 hours ago
Joined: 09/10/2020
Posts: 9

Thanks for the explanation and sorry for the confusion. When I mention "reference", it's using the "#include <>". I want to convert to xml so I can include the type definition in the Routing Service. I thought that I could use the "Type convert" or "Code Generator" to conver the IDL so that it could be included in the routing service.

Looking at the "topic_bridge_w_transf2.xml", is this only possible by creating the function to transform the type? I'm still new to routing service and will need detail explanation on how to do this. 

Howard's picture
Online
Last seen: 8 min 54 sec ago
Joined: 11/29/2012
Posts: 102

No, you don't have to create a transform.  If you look at the XML configuration file, you'll see:

 

    <plugin_library name="Transformations">
        <!--
        This transformation is implemented in that shared library. It allows
        copying fields from one dynamic data sample to other dynamic data sample
        -->
        <transformation_plugin name="Assign">
            <!--
            By specifing this value, RTI Router will search for
            librtirsassigntransf.so in Unix systems and rtirsassigntransfs.dll in Windows
            systems. The path to search will be the current directory or if
            not there, the RTI Route executable directory, which is where it
            actually is.
            -->
            <dll>rtirsassigntransf</dll>
            <create_function>RTI_RoutingServiceAssignTransformationPlugin_create</create_function>
        </transformation_plugin>
    </plugin_library>

This instances an "rtiassigntransf" which is a DLL/shared library that is distributed with RTI Connext DDS that can be used by Routing Service to map members of one type to another per the other configuration in the file:

                    <transformation plugin_name="Transformations::Assign">
                        <!--
                        We will pass some parameters that the modify method will
                        receive to configure this instance. This transformation expects
                        a set of assignments between a field of the output sample
                        type and a field of the input sample type.

                            In our case, we are getting the fields we need, the
                            coordinates of the input ShapeType sample, and
                            assigning them to the output PointType sample
                            -->
                            <property>
                                <value>
                                    <element>
                                        <name>x_coord</name>
                                        <value>x</value>
                                    </element>
                                    <element>
                                        <name>y_coord</name>
                                        <value>y</value>
                                    </element>
                                </value>
                            </property>
                        </transformation>

So, what project are you working on?  I assume that you have an RTI developer license and the project has support from RTI.  If so, you can ask your support contact (a developer on your project that has been assigned RTI support access) to get additional help directly from RTI's support team.