45.1 Where Content Filtering is Applied—Publishing vs. Subscribing Side

Content filtering may be performed on either side of the distributed application. (The DataWriter obtains the filter expression and parameters from the DataReader during discovery.)

When batching is enabled, content filtering is always done on the reader side.

Connext also supports network-switch filtering for multi-channel DataWriters (see Chapter 39 Multi-Channel DataWriters for High-Performance Filtering).

A DataWriter will automatically filter DDS 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 59.6 DATA_WRITER_RESOURCE_LIMITS QosPolicy (DDS Extension)). This value can be from [0, (2^31)-2] or DDS_LENGTH_UNLIMITED (default). 0 means do not filter any DataReader (in other words, disable writer-side filtering); 1 to (2^31)-2 means that the DataWriter will filter for up to the specified number of DataReaders, and the Datawriter will store the result of the filtering per sample per DataReader; DDS_LENGTH_UNLIMITED means that the DataWriter will filter for up to (2^31)-2 DataReaders, but in this case the DataWriter will not store the filtering result per sample per DataReader: if a sample is resent (such as due to a loss of reliable communication), the sample will be filtered again.
    • 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 four matching DataReaders in the same locator (transport destination, for example IP address + port).
  4. Note: Connext supports limited writer-side filtering if there are more than four matching DataReaders in the same locator. The middleware will not send any sample to a locator if the sample is filtered out by all the DataReaders receiving samples on that locator. However, if there is one DataReader to which the sample has to be sent, all the DataReaders on the locator will perform reader-side filtering for the incoming sample.

  5. The DataWriter has infinite liveliness. (See 59.15 LIVELINESS QosPolicy.)
  6. If the DataWriter is using an Asynchronous Publisher (the DataWriter’s 59.20 PUBLISH_MODE QosPolicy (DDS Extension) kind is set to DDS_ASYNCHRONOUS_PUBLISHER_MODE_QOS), samples that are filtered for all DataReaders on a locator will be filtered on the DataWriter side. However, if there is one DataReader to which the sample has to be sent, all the DataReaders on the locator will perform reader-side filtering for the incoming sample.
  7. If you are using a custom filter (not the default one), it must be registered in the DomainParticipant of the DataWriter and the DataReader.
  8. The DataWriter is not configured to use batching.
  9. When batching is enabled, content filtering is always done on the reader side. See 59.2 BATCH QosPolicy (DDS Extension).