Get Unfiltered Data from DataReader

2 posts / 0 new
Last post
Last seen: 7 months 1 week ago
Joined: 05/20/2015
Posts: 11
Get Unfiltered Data from DataReader

Hey guys,

we are experimenting with the Ownership and OwnershipStrength QoS parameters in our system.  We want to have one special application that is able to see all of the instances of a particular topic, even if the QoS OwnershipStrength settings normally filter them out.

For instance, I am publishing a Blue Square with Exclusive Ownership with a strength of 10 from one ShapesDemo instance, and a Blue Square with Exclusive Ownership with a strength of 20 from a second ShapesDemo instance.  I have a separate reader program listening for the Square ShapesType topic.  I can see that I have multiple matched subscriptions, but I only get the data from the 20 strength message in the on_data_available callback.  This is the expected behavior we want in all of our normal applications.  In the special app, we'd like to get the data from both the 10 and the 20 strength messages.  I've been trying to play around with the DDSDataReader::get_matched_publications method to get the unfiltered data, but I can't quite figure out how to convert the DDS_PublicationBuiltinTopicData back into the actual Topic Type struct to get to the data in the message, if that's even possible.

Am I on the right track, or is there a better way to do this?  This is being done in C++.  Thanks!

Gerardo Pardo's picture
Last seen: 1 day 13 hours ago
Joined: 06/02/2010
Posts: 598


I am afraid that is not possible with a single DataReader. The logic of deciding whether to accept a received sample or not form a matched remote DataWriter happens inside the DataReader queue. This logic looks at the strength of the DataWriter and who has written the same instance before... AFAIK there is no way to bypass it.

One thing you could do is have your application create multiple DomainParticipants. As meny as the number of DataWriters you discover on any one Topic. Each participant would create its own DataReader fot that Topic. Then use the DomainParticipant::ignore_publication() to have each DataReader match only one DataWriter. This requires some logic at the application level to coordinate things so it is not trivial to set up.  Once this is setup then you can combine the data from the multiple DataReader entities to get the result...

Of course it would be a lot simpler if the DataReader could be configured to ignore the "strength" and pass all the data. Thinking about it, it should not be so difficult to implement with some changes to the core...  It is just a bypass of the checl for "strength" which is what the DataReader with OWNERSHIP=SHARED already does...   Are you under support? If so and this is important I would suggest you contact your RTI field representative and see if there is a way we could get this scheduled into an upcoming release of the product...