Discovering Subscription and Publication Data

5 posts / 0 new
Last post
Offline
Last seen: 6 years 1 month ago
Joined: 04/04/2014
Posts: 27
Discovering Subscription and Publication Data

Hello,

i want to implement a monitoring application for our system, capable of inspecting published data and publishing user data on arbitrary topic. Topic types can vary so I'm using DynamicDataReaders and DynamicDataWriters. It's not a problem to publish or subscribe data with known TypeCode (to create DDSDynamicDataTypeSupport object). I'm currently using following approach: For every generated type I automatically generate small application which print selrialized TypeCode in text file in specific location. Later this text file can be used to create TypeCode object for specific type name. So far everything works but I'd like to be able to dynamically discover TypeCode for publications and subscriptions. It should be possible using builtin topics. I've used different examples (e.g. ExampleHOWTO) from community site and got it working.

However I'm observing problems in following scenario:

  1. Create DomainParticipant
  2. Wait some time (10s)
  3. Lookup builtin DataReader for DCPSPublication and DCPSSubscription
  4. Wait for data and take it as soon it comes

In this case I get information only about DataReaders and DataWriters, which joined after initial delay of 10s. Already running DataReaders/Writers are not discovered. I assume that discovery happens during initial wait time and doesn't occur any more.

Is it possible to receive data on builtin topics again? Or is this data cached within DomainParticipant? (like discovered_topics and discoverd_participants)

I have attached monitoring application (tested locally with rti connext 5.1.0 on linux), which can be used to reproduce an error. Steps are:

  1. On the same host, default QoS settings.
  2. Start any publisher
  3. Start discovertypecodes
  4. Output doesn't contain typecode from the publisher
  5. Restart publisher from step 2
  6. Typecode of the publisher is received and printed

Thanks a lot in advance!

 

 

AttachmentSize
File discovertypecodes.c3.11 KB
Organization:
gianpiero's picture
Offline
Last seen: 2 months 1 week ago
Joined: 06/02/2010
Posts: 177

 

Hello Sergey,

In your code you are putting a sleep between the creation of the Domain paricipant and the call to 

DDS_DomainParticipant_get_builtin_subscriber

 

By doing that you are missing the dicovery information. The building subcribers are only created when the get_builtin_subscriber is called for the first time as explained here.

The rigth way to do this, is to create the domain participant disabled, get the built-int subscribers and then enable the participant.
Let me know if that works for you.

Best,
  Gianpiero

 

Offline
Last seen: 6 years 1 month ago
Joined: 04/04/2014
Posts: 27

Thank you for a quick response! Removing delay or enabling participant later works.

During my tests I had impression that some discovery data is lost when there are too many topics. Is it possible? I've checked QoS of DDS_PublicationBuiltinTopicDataDataReader and it's reliable and DDS_PublicationBuiltinTopicDataData has key, so no data should be lost, right? Or if any data was lost it happened between creation of domain participant and looking up builtin data reader?

Offline
Last seen: 5 years 8 months ago
Joined: 01/31/2011
Posts: 37

Hi Sergey,

If the RTI core discovered the remote peer, then you should have access to the discovery data.  Discovery data shouldn't be lost; it might not be received and require a retransmission before discovery completes, but again - if the RTI core discovers the peer, you should have access to the discovery data.

If you're not seeing some discovery traffic, it's likely because of your last question: discovery data that is processed between creating the participant and accessing the builtin subscriber.  Your local participant sends out discovery announcements as soon as it's created, triggering discovery with any remote peers that are alive.  Discovery may have already occurred between this happening and you registering a listener for the builtin topics. 

Try creating the participant disabled, accessing the builtin subscriber, registering your listener, and then enabling the participant. Discovery announcements are not sent until the participant is enabled, and this approach should allow you to see all discovery traffic.  You'll find code examples here (http://community.rti.com/examples/builtin-topics)

-sumeet

Offline
Last seen: 6 years 1 month ago
Joined: 04/04/2014
Posts: 27

Hi Sumeet,

thank you for reply! Moving datareader lookup directly after domain participant creation solved the problem and I don't observe discovery data loss any more. If the problem comes later, I'll use creating disabled participant