Content Filtering on DataWriter instead of DataReader

6 posts / 0 new
Last post
Offline
Last seen: 6 years 11 months ago
Joined: 01/03/2018
Posts: 3
Content Filtering on DataWriter instead of DataReader

I have read through section 5.2.4 of the user manual and was wondering if there is any example qos that meets this criteria.

A DataWriter will automatically filter data samples for a DataReader if all of the following are
true; otherwise filtering is performed by the DataReader.
1. The DataWriter is filtering for no more than writer_resource_limits.max_remote_reader_filters DataReaders at the same time.

  • There is a resource-limit on the DataWriter called writer_resource_limits.max_remote_reader_filters (see DATA_WRITER_RESOURCE_LIMITS QosPolicy (DDS Extension) (Section 6.5.4)).This value can be from 0-32. 0 means do not filter any DataReader and 32 (default value) means filter up to 32 DataReaders.
  • If a DataWriter is filtering max_remote_reader_filters DataReaders at the same time and a new filtered DataReader is created, then the newly created DataReader (max_remote_reader_filters + 1) is not filtered. Even if one of the first (max_remote_reader_filters) DataReaders is deleted, that already created DataReader (max_remote_reader_filters + 1) will still not be filtered. However, any subsequently created DataReaders will be filtered as long as the  number of DataReaders currently being filtered is not more than writer_resource_limits.max_remote_reader_filters.

2. The DataReader is not subscribing to data using multicast.
3. There are no more than 4 matching DataReaders in the same locator (see Peer Descriptor Format (Section 14.2.1)).
4. The DataWriter has infinite liveliness. (See LIVELINESS QosPolicy (Section 6.5.13).)
5. The DataWriter is not using an Asynchronous Publisher. (That is, the DataWriter’s PUBLISH_MODE QosPolicy (DDS Extension) (Section 6.5.18) kind is set to DDS_SYNCHRONOUS_PUBLISHER_MODE_QOS.) See Note  elow.
6. If you are using a custom filter (not the default one), it must be registered in the DomainParticipant of the DataWriter and the DataReader.

Notes:
Connext supports limited writer-side filtering if asynchronous publishing is enabled. The mid-
dleware will not send any sample to a destination if the sample is filtered out by all the
DataReaders on that destination. However, if there is one DataReader to which the sample has to
be sent, all the DataReaders on the destination will do reader side filtering for the incoming sam-
ple.
In addition to filtering new samples, a DataWriter can also be configured to filter previously
written samples stored in the DataWriter’s queue for newly discovered DataReaders. To do so,
use the refilter field in the DataWriter’s HISTORY QosPolicy (Section 6.5.10).

 

Ismael Mendez's picture
Offline
Last seen: 10 months 10 hours ago
Joined: 07/03/2017
Posts: 74

Hi Collin,

Those are the DataReader/Writer QoS settings that match the criteria described above. Note that conditions three and six does not depend on the QoS.

<datawriter_qos>
<writer_resource_limits>
<max_remote_reader_filters>32</max_remote_reader_filters>
</writer_resource_limits>
<publish_mode>
<kind>SYNCHRONOUS_PUBLISH_MODE_QOS</kind>
</publish_mode>
<liveliness>
<kind>AUTOMATIC_LIVELINESS_QOS</kind>
<lease_duration>
<sec>DURATION_INFINITE_SEC</sec>
<nanosec>DURATION_INFINITE_NSEC</nanosec>
</lease_duration>
</liveliness>
</datawriter_qos>

<datareader_qos>
<multicast>
<kind>UNICAST_ONLY_TRANSPORT_MULTICAST_QOS</kind>
</multicast>
</datareader_qos>

Value for max_remote_reader_filters is the default one no need to specify if you want to use 32. 

Regards

Ismael

Offline
Last seen: 6 years 11 months ago
Joined: 01/03/2018
Posts: 3

Thanks Ismael,

So I have all of these configuration's setup in my QOS but it still seems that the data is published over the network regardless of if there is a subscriber with an accepting filter.  

Is there a way to verify that the filter is applied on the DataWriter as opposed to the DataReader?

Through the Admin Console when looking at my topic it shows that the DataReader QoS has content_filter_property.  Would this property exist on the DataWriter QoS if it was properly configured or does it always show on the DataReader QoS?

Thanks,

Collin

Ismael Mendez's picture
Offline
Last seen: 10 months 10 hours ago
Joined: 07/03/2017
Posts: 74

HI Collin,

Are you using a custom filter? In case you are using it, you also need to register it on the DataWriter side. Otherwise, the filtering will be performed on the DataReader. Please have a look at section 5.4.8.1 Filtering on the Writer Side with Custom Filters from the User's Manual.

 

Regards

Ismael

rip
rip's picture
Offline
Last seen: 2 weeks 4 days ago
Joined: 04/06/2012
Posts: 324

@Collin,  How are you verifying that the data is on the wire?  Wireshark, or the Admin Console?

Offline
Last seen: 6 years 11 months ago
Joined: 01/03/2018
Posts: 3

@ismael I am not using a custom filter, currently it's just a very simple value >= 0 filter, I am able to filter the data just wanted to narrow down a way to know that the filtering occurs on the writer and not the reader.

@rip Both, or attempting both.  I have wireshark captures in cases where I send 100 messages with none filter and 100 messages with all filtered.  The size of the all filtered is 25-50% smaller each time but not sure if this is an indicator.

Was just using Admin Console to look and noticed that the DataReaderQos had a property for the content-filter but the DataWriterQos does not.  Also was not sure if this is an indicator that the filter is applied on the reader or just where a filter is always registered even if it is passed to the writer.