Reputation: 12415
I've an OpenDDS node that's both a DataDriver and DataReader. The consequence is that if the node send a topic, the same topic is received from the same node.
Is there a QoS policy that avoid this behaviour? I want that a node can receive the topic from all nodes but itself.
Upvotes: 1
Views: 281
Reputation: 17373
I want that a node can receive the topic from all nodes but itself.
If you are in a situation where your data type for the relevant Topic includes an attribute that contains information about the source of the data, then you can use that attribute to filter on via a ContentFilteredTopic. Suppose that your data type has a field nodeId
that identifies your node, then you can use a ContentFilter expression like nodeId <> %0
and set the parameter to your own nodeId
. The middleware would deliver all updates to your DataReaders, except for those that have your own nodeId
. Check out the DDS specification for more details.
Given that your application wants to ignore data coming from your own node, I would argue that your data type actually needs that nodeId
as an attribute, because apparently that is information relevant for your application. So if you do not have it at the moment, you might have to add it.
If you are not allowed or do not want to add such a field your data type, you can also use another, more convoluted mechanism by leveraging the ignore_publication()
or ignore_participant()
methods. These are explained in the specification as well. If you want to go that route, let me know if you have questions about it.
Finally, there might be vendor-specific extensions to the API that provide you with easier ways to achieve what you are looking for. For example, see How do I get a DataReader to ignore a DataWriter that belongs to the same DomainParticipant? for a solution using the RTI product.
Upvotes: 1