Request Specific data from Persistence Service

4 posts / 0 new
Last post
Offline
Last seen: 9 months 3 weeks ago
Joined: 01/30/2024
Posts: 2
Request Specific data from Persistence Service

Hello,

Is there any way to request specific data from a persistence service. 
I want the Persistence Service to persist some messages that are sent around my system. Each message has some time information as part of its content. In my application i want to request the last message that was sent before a specific point in time.

Also there are very big amount of messages being sent, which means that sending all messages before a specific time and sorting later would not be a very efficent solution. 

Example:

message1{sampletime: 1000}

message2{sampletime: 2000}

message3{sampletime: 3000}

When my specified time is 2500, then i only want to get message2 returned and not message1 and message2.

Is there an easy way implement this?

I have been looking into content filtered topics but did not find a solution.

Thanks

  

Howard's picture
Offline
Last seen: 11 hours 2 min ago
Joined: 11/29/2012
Posts: 608

Dear Julius,

Sorry to say that Persistence Service is not design for and does not support the functionality that you're asking about.  Persistence Service exists to support the TRANSIENT and PERSISTENT operation of the Durability QoS Policy.

With the Durability QoS Policy, you can only configure the system to provide the last N values received by Persistence Service.  Persistence Service cannot filter based on content or time.  It is not designed to be queried like a database.

However, you may be able to the Topic Query API provided by RTI to do what you want, provided that the data can be stored in the DataWriter cache. 

Please see these links for documentation:

https://community.rti.com/static/documentation/connext-dds/7.2.0/doc/manuals/connext_dds_professional/users_manual/users_manual/TopicQueries.htm?Highlight=topic%20query

https://community.rti.com/static/documentation/connext-dds/7.2.0/doc/api/connext_dds/api_cpp/group__DDSTopicQueryModule.html

An example is distributed in the rti_workspace, e.g.

%DOCUMENTS%\rti_workspace\7.2.0\examples\connext_dds\c++\hello_world_topic_query

 

Offline
Last seen: 9 months 3 weeks ago
Joined: 01/30/2024
Posts: 2

Thank you for your quick reply.

Unfortunately i am still using the version 6.0.1 and do not have access to that example.

 

Howard's picture
Offline
Last seen: 11 hours 2 min ago
Joined: 11/29/2012
Posts: 608

There is an example distributed with Connext 6.0.1 as well...

rti_workspace\6.0.1\examples\connext_dds\c++\hello_world_topic_query