How to get only the latest sample for later-join subscribers and keep reliability?

3 posts / 0 new
Last post
Offline
Last seen: 7 years 4 months ago
Joined: 07/20/2017
Posts: 2
How to get only the latest sample for later-join subscribers and keep reliability?

How to get only the latest sample per instance for later-join subscribers and keep reliability? 

Assume that DataWriter and DataReader have Reliability QOS as RELIABLE_RELIABILITY_QOS, and History QOS as KEEP_LAST with depth=100. For a later-join DataReader, I would like to receive only the latest instance value, instead of the last 100. Is there a way to do it?

Thanks.

Juanjo Martin's picture
Offline
Last seen: 2 years 3 months ago
Joined: 07/23/2012
Posts: 48

Hi Allen,

If you want to get the latest instance value instead of the last 100, you need to use KEEP_LAST with depth 1:

  • If you set depth 1 in the DataWriter, the DataWriter will only keep the last sample per instance. Reliability will be maintained for this last sample per instance.
  • If you set depth 1 in the DataReader, the DataReader will only keep the latest sample per instance. This means, that if the DataReader processes the data fast enough, you may see more than 1 sample being received when receiving historical data if it is receiving more than 1.

I want to highlight that HistoryQos is working in a per-instance basis. Having KEEP_LAST with depth 1 and 3 different instances will maintain 3 different samples.

Thanks,

Juan J. Martin

Professional Services Group

Offline
Last seen: 7 years 4 months ago
Joined: 07/20/2017
Posts: 2

Juan,

Thank you for the answer. If I  set depth 1 in the DataReader, the late-joiner would loss some reliability after start, where if my application pull the data slower from Connext DDS, the sample would be overwrite by late updates. 

My purpose is to keep some kind of reliability, at the same time, the late-joiner should only get the latest data snapshot.