Routing Service Configuration for Python API

10 posts / 0 new
Last post
Offline
Last seen: 1 year 5 months ago
Joined: 11/23/2021
Posts: 32
Routing Service Configuration for Python API

Hello @all,

I want to use roting service along with the Python API to route all topics from Domain 1 to Domain 0 (see routing configuration below).
I have a publsiher that publishes data to Domain ID 1 and I have a subscriber that subscribes to Domain ID 0.
However no data is routed from Domain 1 to Domain 0. Without routing - both, subscriber and publisher application, are communicating without problems.

    <routing_service name="RoutingService">
        <domain_route name="RouteName">
            <participant name="ParticipantBase">
                <domain_id>0</domain_id>
            </participant>
            <participant name="ParticipantBase">
                <domain_id>1</domain_id>
            </participant>
            <session name="Session">
                <auto_topic_route name="AllForward">
                    <publish_with_original_info>true</publish_with_original_info>
                    <input participant="ParticipantBase">
                        <creation_mode>ON_DOMAIN_MATCH</creation_mode>
                    </input>
                    <output>
                        <creation_mode>ON_DOMAIN_OR_ROUTE_MATCH</creation_mode>
                    </output>
                </auto_topic_route>
                <auto_topic_route name="AllBackward">
                    <publish_with_original_info>true</publish_with_original_info>
                    <input participant="ParticipantBase">
                        <creation_mode>ON_DOMAIN_OR_ROUTE_MATCH</creation_mode>
                    </input>
                    <output>
                        <creation_mode>ON_DOMAIN_MATCH</creation_mode>
                    </output>
                </auto_topic_route>
            </session>
        </domain_route>
    </routing_service>
</dds>

 

Any ideas?

Thanks in advance!

Best Regards,

Marc

Offline
Last seen: 4 months 2 weeks ago
Joined: 09/23/2018
Posts: 63

Marc,  

Give this a try.

I took our standard Connext Pro bridge_domain_0_and_domain_1 routing service example and reversed the domains. 

<?xml version="1.0"?>
<dds xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://community.rti.com/schema/6.0.1/rti_routing_service.xsd">

    <routing_service name="bridge_domain_1_and_domain_0">
        <annotation>
            <documentation>
                Routes all topics from domain 1 to domain 0
            </documentation>
        </annotation>

        <domain_route name="D1_D0_DomainRoute">
            <participant name="D0">
                <domain_id>0</domain_id>
            </participant>

            <participant name="D1">
                <domain_id>1</domain_id>
            </participant>

            <session name="Session1">
                <auto_topic_route name="AllForward">
                    <publish_with_original_info>true</publish_with_original_info>
                    <input participant="D1">
                        <allow_topic_name_filter>*</allow_topic_name_filter>
                        <allow_registered_type_name_filter>*</allow_registered_type_name_filter>
                        <deny_topic_name_filter>rti/*</deny_topic_name_filter>
                        <creation_mode>ON_DOMAIN_AND_ROUTE_MATCH</creation_mode>
                    </input>
                    <output participant="D0">
                        <allow_topic_name_filter>*</allow_topic_name_filter>
                        <allow_registered_type_name_filter>*</allow_registered_type_name_filter>
                        <deny_topic_name_filter>rti/*</deny_topic_name_filter>
                        <creation_mode>ON_DOMAIN_AND_ROUTE_MATCH</creation_mode>
                    </output>
                </auto_topic_route>
            </session>
        </domain_route>
    </routing_service>
</dds>

 

 

r
Offline
Last seen: 1 week 3 days ago
Joined: 06/17/2019
Posts: 50

Marc, assuming Gary's suggestion works and if you wanted to work backwards as to why you are having trouble, I would change the name of your participants so they have unique names

Currently it looks like both of yours are named 'ParticipantBase', and the name is how they are referred to later in the XML configuration. 

            <participant name="ParticipantBase">
                <domain_id>0</domain_id>
            </participant>
            <participant name="ParticipantBase">
                <domain_id>1</domain_id>
            </participant>
Offline
Last seen: 1 year 5 months ago
Joined: 11/23/2021
Posts: 32

Hello garyb,

I inserted your routing service example but it does not work. I am able to start the routing service without errors using the command:

rtiroutingservice -cfgFile "USER_ROUTING_SERVICES.xml" -cfgName "bridge_domain_1_and_domain_0"

but it does not route the topics from domain 1 to domain 0. I tried it also using the simple Python example "coherent_subscriber, coherent_publisher" by setting the publisher domain ID to 1 and the subscriber domain ID to 0.
However, without success. Any further ideas?

Regards,

Marc

Howard's picture
Offline
Last seen: 1 week 2 days ago
Joined: 11/29/2012
Posts: 618

I would say that the problem is possibly incompatible QoS settings.  The Routing Service configuration does not configure the QoS for the DataWriters/DataReaders that it creates for the routes, which means that the entities are created with the default QoS settings.  If your python app uses modified QoS settings for the DataWriters/DataReaders that it creates, then they could be incompatible with the ones used by the Routing Service. 

If you start RTI Admin Console, it should quickly show if there are QoS incompatibilities in your configurations.

Offline
Last seen: 4 months 2 weeks ago
Joined: 09/23/2018
Posts: 63

Hi Marc,

As Howard stated,  Admin Console is the best tool to determine QoS mismatches along with a number of other issues.

You stated -- "Without routing - both, subscriber and publisher application, are communicating without problems."    

So if you run both the publisher and subscriber on domain 0, things work as expected and the same for domain 1?    During each of these individual tests,  it would be a good idea to use Admin Console or RTI DDS Spy to make sure the domains are indeed correct.  

For the domains in question,  are they on the same exact network or include some sort of separation?  (e.g.  a switch in between)

Another interesting test is to use the rtiddsping utility to see if you can cross domains.       

For example, in 3 separate command windows:

1.) Run Routing Service

source /home/gary/rti_connext_dds-6.0.1/resource/scripts/rtisetenv_x64Linux4gcc7.3.0.bash                           // I am on a LinuxMint Debian machine with this arch

rtiroutingservice -cfgFile CUSTOM_ROUTING_SERVICE.xml -cfgName bridge_domain_1_and_domain_0 -verbosity 3         // the XML file contains what I pasted earlier
 
2.) Run rtiddsping pub on domain 1:     

source /home/gary/rti_connext_dds-6.0.1/resource/scripts/rtisetenv_x64Linux4gcc7.3.0.bash

rtiddsping -pub -domainId 1

3.) Run rtiddsgping sub on domain 0:     

source /home/gary/rti_connext_dds-6.0.1/resource/scripts/rtisetenv_x64Linux4gcc7.3.0.bash

rtiddsping -sub -domainId 0

Offline
Last seen: 1 year 5 months ago
Joined: 11/23/2021
Posts: 32

Hello,

Thanks for all the information. That helped me definitely further.
The problem was located in the data reader qos of my application:

<datawriter_qos>
 <deadline>
 <period>
 <sec>2</sec>
 <nanosec>0</nanosec>
 </period>
 </deadline>
</datawriter_qos>

<datareader_qos>
    <deadline>
        <period>
            <sec>2</sec>
            <nanosec>0</nanosec>
        </period>
    </deadline>
    <time_based_filter>
        <minimum_separation>
            <sec>0</sec>
            <nanosec>500000000</nanosec>
        </minimum_separation>
    </time_based_filter>
</datareader_qos>

When I remove the deadline tag of my data reader the application is communicating from ID 1 to ID 0 . Are there any problems known?

Regards,

Marc

Offline
Last seen: 4 months 2 weeks ago
Joined: 09/23/2018
Posts: 63

Hi Marc,

It does not seem to be a known issue using deadlines with the Python API.      In the non-working configuration,  you should be able to use Admin Console to view the application's and routing service's QoS'es to see if there is a QoS Mismatch.   The Match Graph is particularly useful for this operation.

 

Howard's picture
Offline
Last seen: 1 week 2 days ago
Joined: 11/29/2012
Posts: 618

If you use the Deadline QoS in your own application, you have to configure the routes in the Routing Service also to create it's DataReaders and DataWriters with the Deadline QoS settings as well.

Offline
Last seen: 1 year 5 months ago
Joined: 11/23/2021
Posts: 32

Hello Howard,

Thanks for your help! Adding the QoS settings for deadline to the routing service configuration under the input/output tag solved the problem!

Regards,

Marc