RTI DDS Connector requires sleep to reliably send messages

2 posts / 0 new
Last post
Offline
Last seen: 4 years 7 months ago
Joined: 03/31/2019
Posts: 3
RTI DDS Connector requires sleep to reliably send messages

Greetings,

We've been using the RTI DDS python connector library for a use case where we need to send simple messages to our DDS system via a python script. We've found it very simple to work with and would like to commend whoever made this very useful addon for Connext.

We're running into one issue that we could use some advice on. We notice that in the writer examples a sleep statement is used following write calls. In our experience, if this sleep is removed (or the amount lowered) it appears to be possible for the application to exit before sending is complete (hence no samples or fewer samples are received on the other side). Is there a more deterministic way to send messages that doesn't rely on this sleep call (for example, perhaps a blocking write or something of that sort)? It would be useful if there was a way to keep the application from exiting until the connector had initialized and all samples had been written.

Many thanks,
James

Offline
Last seen: 10 months 7 hours ago
Joined: 02/11/2016
Posts: 144

I'm guessing (although I haven't looked at the example) that the sleep is required to guarantee matching.

In DDS, if a message is sent by a writer and the writer is closed (by exiting the program, or by using the api) before a reader matches the writer, the message will not reach the reader.

In the regular APIs there is a way to verify that some match was made (and if you use qos data to identify the remote entity you matched with, you can guarantee that a specific reader matched).

I'm unsure if the python connector has access to these APIs, though.

Try to find something like get_publication_matched_status (in java this is a method you can call on a writer to see some info about its matches with readers).

 

Best of luck,

Roy.