Speed up data reader liveliness count

3 posts / 0 new
Last post
Offline
Last seen: 11 months 2 days ago
Joined: 05/10/2016
Posts: 5
Speed up data reader liveliness count

Hi. I'm using DDS RTI 5.3.0 with the Modern C++ API. I'm using DDS to communicate an app, which serves as a front-end and has several DataReaders, with a separate app that works as the backend and consequently has several DataWriters.

Users interact with the front-end app and should be able to know whether the backend is alive, so I thought it would be nice to check whether there are DataWriters publishing the topics for the DataReaders to read. I've used two alternatives:

mProcessorPerformanceReader.subscription_matched_status().current_count()

and

mProcessorPerformanceReader.liveliness_changed_status().alive_count()

In both cases the count changes the moment a DataWriter appears, but if the DataWriter disappears (by killing the backend application, for example), it takes quite a while for the count to go back from 1 to 0, close to 20 seconds or more. If the frontend app is restarted, the counts directly return 0, so it seems that the app start forces a discovery of sorts.

Therefore the question is, is there a quicker way of knowing when a DataWriter arrives and leaves? Waiting 20 seconds to detect that the DataWriter is no more isn't acceptable, but I'd rather not have a "heartbeat" message between the front and the back-end.

Thanks in advance.

Offline
Last seen: 2 months 1 day ago
Joined: 02/11/2016
Posts: 142

Hey,

Look into the liveliness qos, which does exactly what you're looking for.

sara's picture
Offline
Last seen: 4 days 4 hours ago
Joined: 01/16/2013
Posts: 122

Hi,

Just to elaborate a bit more on what KickR was saying, You can customize the time that it takes for an application to realize that the other side is gone by using Liveliness QoS policy, for instance the lease_duration.

If you want more details, you can take a look at this KB article.

All the best,
Sara