Where Filtering is Applied—Publishing vs. Subscribing Side
Filtering may be performed on either side of the distributed application. (The DataWriter obtains the filter expression and parameters from the DataReader during discovery.)
Connext DDS also supports network-switch filtering for multi-channel DataWriters (see Multi-channel DataWriters).
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.
- 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)). This value can be from [0, (2^31)-2]. 0 means do not filter any DataReader; 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.
- The DataReader is not subscribing to data using multicast.
- There are no more than 4 matching DataReaders in the same locator (see Peer Descriptor Format).
- The DataWriter has infinite liveliness. (See LIVELINESS QosPolicy.)
- The DataWriter is not using an Asynchronous Publisher. (That is, the DataWriter’s PUBLISH_MODE QosPolicy (DDS Extension) kind is set to DDS_SYNCHRONOUS_PUBLISHER_MODE_QOS.) See Note below.
- 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 DDS supports limited writer-side filtering if asynchronous publishing is enabled. The middleware will not send any DDS sample to a destination if the DDS sample is filtered out by all the DataReaders on that destination. However, if there is one DataReader to which the DDS sample has to be sent, all the DataReaders on the destination will do reader side filtering for the incoming DDS sample.
- In addition to filtering new DDS samples, a DataWriter can also be configured to filter previously written DDS samples stored in the DataWriter’s queue for newly discovered DataReaders. To do so, use the refilter field in the DataWriter’s HISTORY QosPolicy.
- When batching is enabled, content filtering is always done on the reader side. See BATCH QosPolicy (DDS Extension).
© 2015 RTI