0

I have the following scenario when using OpenSplice DDS:

A publisher publishes a DDS topic instance continuously. A subscriber subscribes data using NoOpDataReaderListener, my test runs both publisher and subscriber at the same and the method on_data_available of NoOpDataReaderListener in the subscriber print out the data content using std::cout. My problem is that data is not printed out all the time when you run the test many runs even though the on_subscription_matched method of NoOpDataReaderListener is invoked during every run which indicating the matching of publisher and subscriber is successful. But the on_data_available does not always print out the data content.

Even I replace the data content printing out inside on_data_available with std::cout << data do come in, that message doesn’t appear all the time, only probably 7 out of 10 runs (7 runs all DDS samples can be seen from Subscriber, another 3 runs no DDS samples come out from Subscriber at all). So I think it is more to do with DDS problem instead of std out not being flushed out. Does anyone have idea or how to diagnostic DDS communication channel problem?

Some more information, with wireshark, I have observed the following:

it looks like whether the run is successful (subscriber successfully getting data from publisher) depends on if the user unicast port in publisher process can send data (RTPS DATA instead of just RTPS Heartbeat) to user multicast locator (239.255.0.1::multicast_port) in subscriber process.

Jia Liang Liu
  • 13
  • 1
  • 6
  • With the limited description of your test, this question is hard to answer. A common cause of missing data is a publishing application writing data before the DataWriter has discovered the matching DataReader. This is a consequence of the asynchronous nature of discovery. Just a guess... – Reinier Torenbeek Aug 22 '19 at 16:58
  • thanks Reinier, that make sense to me now. I need to figure out how to delay the publishing before ensuring the matching has happened. I wonder if there is any mechnism in OpenSplice allows me to do that. – Jia Liang Liu Aug 22 '19 at 17:03
  • It depends on what you want to achieve. One option would be to set the DURABILITY QoS to TRANSIENT_LOCAL (as opposed to the default of VOLATILE). That way, the DataWriter delivers the update to the DataReader even if they discover each other after the initial write took place. Note that this approach does not involve "delaying the publisher". See also https://stackoverflow.com/a/54712261/1380680 – Reinier Torenbeek Aug 22 '19 at 17:42
  • Sorry Reinier, I have a look at my code again, the publisher is continuously printing out data, so even the DataReader miss the earlier data, it shouldn't miss the later though. I think I am back to square one – Jia Liang Liu Aug 22 '19 at 17:59
  • do you know any test tool that can help debuging OpenSplice, somewhere I read that there is ospltest, as part of the Votex build, I have the community version, don't seem have that ospltest or spltun inside. – Jia Liang Liu Aug 22 '19 at 18:06
  • Are you missing *all* data in some of the runs, or just some of the data is some of the runs? In the latter case, are you writing at full speed, or are you pausing in between writes? – Reinier Torenbeek Aug 22 '19 at 18:09
  • missing all data in some of the runs, or all data appear in some of the runs – Jia Liang Liu Aug 22 '19 at 18:18

0 Answers0