RTI DDS two applications publishing data on same domain. When one application closes and reopens it looses the data. How to solve?

牧云@^-^@ 提交于 2019-12-24 03:12:35

问题


I have two publisher and subscriber application.

  • App1 -> publish -> Student (1,ABC), Student(2,EFG). After it I run second application. both application subscribe and publish on same domain
  • App2 able subscribe Student (1,ABC), Student(2,EFG) which is published by App1 then I Published data. App2-> publish -> Teacher(1,AAA),Teacher(2,BBB) Now I got Student (1,ABC), Student(2,EFG),Teacher(1,AAA),Teacher(2,BBB) from App2
  • when I close app2 and reopen again I am unable to subscribe this data How can I subscribe data which I published before closing application ? DDS Spy shows data still available on same domain.

Can somebody help to understand?


回答1:


How can I subscribe data which I published before closing application ?

The behavior that you are looking for is supported by the Durability Quality of Service (QoS) setting. It specifies if published data needs to remain available to be delivered to late joining Subscribers who joined the Domain after the data has been published, and for how long.

There are four different policies that you can select for the Durability QoS. In order of increasing lifetime of the data, they are:

  • VOLATILE (the default): Updates are delivered only to DataReaders that are present at the time of publication
  • TRANSIENT_LOCAL: Updates remain available for delivery to DataReaders as long as the DataWriter exists
  • TRANSIENT: Updates remain available for delivery to DataReaders as long as the Domain exists
  • PERSISTENT: Updates remain forever available for delivery to DataReaders, even after the Domain has been restarted.

For any of these policies, data is also removed if the dispose() call is used, or if its lifespan period expires.

From your short description, it looks like you need to select the TRANSIENT_LOCAL policy for your Durability QoS.

For more information, see section 2.2.3.4 DURABILITY in the DDS specification, which is freely downloadable from the OMG DDS webpage.



来源:https://stackoverflow.com/questions/54706939/rti-dds-two-applications-publishing-data-on-same-domain-when-one-application-cl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!