RTI DDS两个应用程序在同一域上发布数据。当一个应用程序关闭并重新打开时,它将丢失数据。怎么解决? [英] RTI DDS two applications publishing data on same domain. When one application closes and reopens it looses the data. How to solve?

查看:353
本文介绍了RTI DDS两个应用程序在同一域上发布数据。当一个应用程序关闭并重新打开时,它将丢失数据。怎么解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个发布者和订阅者应用程序。

I have two publisher and subscriber application.


  • App1-> publish-> Student(1,ABC),Student(2, EFG)。
    之后,我运行第二个应用程序。这两个应用程序都可以在同一域上进行订阅和发布

  • App2可以订阅由App1
    发布的Student(1,ABC),Student(2,EFG),然后我发布了数据。 App2->发布->老师(1,AAA),老师(2,BBB)
    现在我有学生(1,ABC),学生(2,EFG),老师(1,AAA),老师(2 ,BBB)来自App2的

  • 当我关闭app2并再次重新打开时,我无法订阅此数据
    如何订阅我之前发布的数据正在关闭应用程序?
    DDS间谍显示数据仍在同一域中。

  • 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?

推荐答案


在关闭应用程序
之前,如何订阅发布的数据?

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

持久性服务质量(QoS)设置支持您正在寻找的行为。它指定是否需要保留已发布的数据,以将其传递给在数据发布后加入域的晚期加入订户,以及持续多长时间。

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.

有四个您可以为持久性QoS选择不同的策略。为了提高数据的生命周期,它们是:

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


  • VOLATILE (默认):更新仅交付给发布时已存在的DataReader

  • TRANSIENT_LOCAL :更新仍然可用于交付给DataReader只要DataWriter存在

  • TRANSIENT :只要域存在,更新仍然可以传递给DataReader

  • PERSISTENT :即使域已重新启动,更新仍将永远提供给DataReader。

  • 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.

对于任何这些策略,如果使用了 dispose()调用,或者其使用期限到期,则也会删除数据。

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

从您的简短描述中,您似乎需要为耐久性QoS选择 TRANSIENT_LOCAL 策略。

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

有关更多信息,请参见DDS规范中的2.2.3.4节耐久性。 hich可从 OMG DDS网页免费下载。

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

这篇关于RTI DDS两个应用程序在同一域上发布数据。当一个应用程序关闭并重新打开时,它将丢失数据。怎么解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆