DataWriter doesn't publish sample without RETCODE

2 posts / 0 new
Last post
Offline
Joined: 05/17/2017
Posts: 2
DataWriter doesn't publish sample without RETCODE

Running Environment

RTI Connext DDS 5.3.0, Java (x64Linux3gcc4.8.2)

---

Hi, I'm making Java DDS application.

Each application has one publisher and one subscriber.

And, there are many datawriters and datareaders in each publisher and subscriber.

(In runtime, API call from outside the application makes a new thread, and the thread makes a new datawriter and a datareader.)

 

Sometimes, when I call 'write' function to publish a sample, it doesn't throw any exception(RETCODE), but the sample doesn't published.

The 'write' function doesn't throw any exception, but subscribers can't receive the sample.

(Even a subscriber on the RTI Admin Console in the same host)

This problem is caused not ALWAYS, but OFTEN.

 

What causes this problem?

Offline
Joined: 02/11/2016
Posts: 116

Hey,

Considering the behavior you are describing my guess is this:

You are sending a sample before your newly created datawriter becomes connected to the (newly created?) datareader. In this scenario samples sent will be lost (unless durability qos is set to something higher than the default).

Solutions are therefore:

1. Use durability qos set to local_transient (or higher)

or

2. Make sure the writer and reader are matched before sending the sample (either by waiting a bit or using one of the methods for recognizing status changes [listener / status condition / api on the reader and writer])

 

This answer is based on the assumption that the problem does not always occur (as you mentioned).

 

Good luck,

Roy.