Hi,
We are using DDS to communcate data to different modules . I am in process of writing a service which can read the messages on DDS . I came accross MonitorData.java which fits the neds pretty well .
The only issue i am having is when i run the rtireplay first and then start the Monitor data . In this case non of the DDS messages are read. It seems to be waiting for waitForDiscoveredDataWriters.
I am attaching the file . Please review .
thanks,
Pankaj
Attachment | Size |
---|---|
monitordata.java | 17.74 KB |
Hi Pankaj,
I took a quick look at the file you attached. Nothing there stands out as an obvious problem.
Are you saying that if you start the MonitorData.java before
rtireplay
then you receive the messages but if you startrtireplay
first you do not?Did you try the original MonitorData.java application from http://community.rti.com/filedepot?cid=6&fid=20? does it have the same problem?
Can you try running rtiddspy instead of the MonitorData.java application? Does it exhibit the same behavior of not seeing the data if it gets started after the
rtireplay
?Some additional questions to help determine if this may be a discovery problem:
Gerardo
Hi Gerardo,
Please look at answers inlined in red
I took a quick look at the file you attached. Nothing there stands out as an obvious problem.
Are you saying that if you start the MonitorData.java before
rtireplay
then you receive the messages but if you startrtireplay
first you do not?Yes thats correct .
Did you try the original MonitorData.java application from http://community.rti.com/filedepot?cid=6&fid=20? does it have the same problem?
Yes it also has the same problem.
Can you try running rtiddspy instead of the MonitorData.java application? Does it exhibit the same behavior of not seeing the data if it gets started after the
rtireplay
?I ran rtiddsspy and it does not have the same problem. I can read the messages anytime before and after running rtireplay.
Some additional questions to help determine if this may be a discovery problem:
rgds,
Pankaj
Hi,
Thank you for the additional information. I identified the problem. It seems like there is a bug in the way we configure the WaitSet.
Please open the
MonitorData.java
file and look for the functionwaitForDiscoveredDataWriters
(see below)Edit the function replacing:
With:
This should solve the problem. Somehow we are processing the first syntax incorrectly and we get into an infinite wait as you had observed. I have also filed an internal issue to correct this problem. In addition I uploaded a new version of MonitorData.java (https://community.rti.com/filedepot?cid=6&fid=20) to the File Exchange with this fix.
Thank you for helping us troubleshoot this!
-Gerardo
Thanks for suggesting a solution. Though its not complete solution as still it gets stuck 1 out of 5 times. So this solution does not works all the times. Please help !!
I am still seeing this issue.
The current fix only works sometime and then it fails 1 out of 5 times.
Please give some pointers for the complete fix.
rgds,
Hi Pankaj,
I think the problem is that in the example we were not explicitly attaching the modified DomainParticipantFactory's QoS settings to the DomainParticipantFactory. As a result, the DomainParticipant and all its contained entities were enabled upon creation. When this happens, by the time we retrieve the built-in entities, discovery information may have been received and we may miss the data types of the first discovered entities. That is probably why your are running into this problem only 1 out of 5 times -- sometimes discovery happens before you have retrieved the built-in entities, but most of the times it happens after.
This snippet contains the fix. Note that we have added calls to
factory.get_qos()
andfactory.set_qos()
:Please, let me know if this fixes your issue.
Thanks,
Fernando.