Content Filtered Topic not really filtered?

5 posts / 0 new
Last post
Offline
Last seen: 6 years 11 months ago
Joined: 10/18/2017
Posts: 13
Content Filtered Topic not really filtered?

Hello everyone,

I am testing a simple application with ContentFilteredTopic.

The DataWriter basically just send random numbers (possible temperature values in a range 0-100) and the DataReader receives them with a filter: it should only receive values less than 20 and greater than 80.

Apparently the application works fine. If i run publisher and subscriber I actually see what I expect and the temperature values are filtered as I want.

My doubt came when I started Administration Console in order to look at my DataWriter and DataReader. When I click on Match Graph -> right click on DataReader -> Visualize -> Sample Log, I can see that all the samples are recorded in the sample log. I guess that when a sample is filtered it should not be sent on the wire so I was not expecting to read the filtered values in the DataReader's log (is this right?).

Pub and Sub are running on the same machine, I do not know if it makes difference.

Thanks for your support,

- Luigi

rip
rip's picture
Offline
Last seen: 3 days 19 hours ago
Joined: 04/06/2012
Posts: 324

Hi Luigi,

Each Pub<->Sub instance is a separate connection. Ordinarily, then:

Pub <-> App with Filtered Sub is one instance, and it shows filtered data

Pub <-> Admin Console Sub is a second instance, and since it isn't using a filter, gets all the data.

In order for the Admin Console to be able to mimic your filter, it would have to set up a publisher on the topic, so that the App-with-filtered-Sub subscriber's filter would propagate to it via discovery.  Once it had the filter, it would then need to recreate that content-filter in its own subscriber.  This seems a bit too tricky and prone to error.  Keep in mind that subscribers won't talk to each other, so there is no way for two subscribers to exchange what filters they are using directly.

I don't have Admin Console installed on this machine, so I can't look at the documentation, but I'm pretty sure it isn't designed to work that way (create a publisher in order to read the other subscribers filters).

Check the docs to see if Admin Console lets you set up filters when capturing the data for graphing.

rip

 

 

 

Offline
Last seen: 6 years 11 months ago
Joined: 10/18/2017
Posts: 13

Hi rip,

thanks for your reply!

I'll take a look to admin console manual, but do you agree with the fact that if I have a Pub <-> App_with_filtered_Sub and I try to send some data from the Pub that are filtered by the sub (so not received) these data should not go on wire and do not crowd the network?

I have read the documentation and it seems like that, but now I have some doubts about it.

Thanks,

- Luigi

rip
rip's picture
Offline
Last seen: 3 days 19 hours ago
Joined: 04/06/2012
Posts: 324

Are you looking at the traffic via Wireshark, or are you looking at the traffic via the Admin Console?

If you see the data in wireshark, wire-tapping the connection Pub <-> Filtered Topic Subscriber, then yes, that is significant.  There are reasons why you might, but you haven't said anything about any of the other conditions that would cause this state to be active.  In *general*, the publisher will not send data to the filtered topic subscriber, when the data won't pass the subscriber's filter.  In *general*.  There are conditions where it is also the case where data will be sent and require the subscriber to filter it.  The end result in these two cases is the same:  the *application* will not see the filtered data.

Now:  If you see the data in Admin Console, it is because this is a *different connection* then the Pub <-> Filtered Topic Subscriber, and so it has its own filter (or not, in the normal case).

So: Wireshark or Admin Console?

rip

Offline
Last seen: 6 years 11 months ago
Joined: 10/18/2017
Posts: 13

Hi Rip,

I have tried to look at the traffic through Wireshark, but then I realized that my application (that is just a test application) is running Pub and Sub on the same machine, so the data should not be sent on the wire and I do not think that wireshark is capable to sniff these data since, as I said, these data are actually not on the wire (there is a way to do it?)

So I tried with Admin Console and probably this is why I still can see the data even if they are filtered...

- Luigi