pipeline of nodes

4 posts / 0 new
Last post
Offline
Last seen: 3 years 5 months ago
Joined: 04/27/2017
Posts: 1
pipeline of nodes

Hi 

I am working on a demo of RTI DDS and I was wondering if it is possible to create a dynamic pipeline that process messages on a single topic.

The scenario is:

Single topic'circles' type 'shape'.

Three services are running, they subscribe to the topic but they processs the messages in a pipeline. 

  • The first process gets a message and changes the color to green
  • The second process gets the green circle and publishes a red circle (shifting the hue by X)
  • The third process gets a red circle and publishes another color again by shifting the hue by Y.

So the shapes are processed sequentially and modified by each stage in the pipeline. Additionally if the second process is removed I want the thrid process to automatically pick up the shapes from the first process, but off course the end color will be different. 

This could be implemented by manually creating topics for each stage and running a low strength 'replay' node in case one of the stages failed. But i was wondering if there was are more elegant way of implementing this usecase dynamically without having to manually create topics for each stage

 

 

 

Organization:
rip
rip's picture
Offline
Last seen: 2 days 20 hours ago
Joined: 04/06/2012
Posts: 322

It's straightforward using "Content Filter Topic" (see https://community.rti.com/static/documentation/connext-dds/5.2.3/doc/api/connext_dds/api_java/group__NDDSFilterExampleModule.html for the Java info, which exists in the docs for the other languages also). 

App one filters for the initial YELLOW, publishes GREEN

App two filters for GREEN, publishes RED

App three filters for RED.

Failover (app three reacting to missing RED by looking for YELLOW) can be handled different ways but it really depends on what the *actual* use case is (rather than the naive example based on ShapeType).  For this use case, I'd just have a second reader that subscribed to the normal topic and discarded everything it received except for the meta-data messages (i.e., are the publishers meeting their contracts v-a-v QoS for liveliness, etc) and have /it/ worry about spawning another agent that does what the missing agent was supposed to be doing)

gianpiero's picture
Offline
Last seen: 1 year 6 months ago
Joined: 06/02/2010
Posts: 174

Hello,

I would like to suggest to alternative method for doing that:

  • The first one is to use RTI Routing Service. This tool will allow you to specify 'routes' with input and otuput and, for each one of them you can specify a transformationto do change of color, or swapping x and y, or changing topics. You can find the user manual here 
  • Use the RTI Connector in python or javascript. You can get it from this github repo and look at the example directory for some guidance. 

Best,
  Gianpiero

rip
rip's picture
Offline
Last seen: 2 days 20 hours ago
Joined: 04/06/2012
Posts: 322

There are several good posts in the forum about using the routing serviceThis post is excellent even if you aren't a C or C++ programmer.  Easiest is to do it in Java (I say...but then I'm a java guy so I would say that) because you can set up Eclipse to allow for debugging of your route transform code. 

Because Routing Service uses Dynamic Data internally it can be tricky to set up the transforms as you aren't working with the native types generated by rtiddsgen (unless RTI has addressed that/provided methods to auto-convert DynamicData to generated type and back). 

I had fun writing adapters that took Altova MapForce generated transforms and looped the data back out using the same Routing Service instance.  It wasn't straightforward but that was five years ago.  That might be easier now.

rip