Hey @maniv, thanks for that tip!
To get the best performance out of PubSub+, it’s best not to use selectors. They are an (effectively) unbounded compute problem. We have found that in the vast majority of cases, PubSub+'s dynamic, hierarchical topic structure can achieve the same filtering, simply put the header key in the topic:
message/topic/100/apples/food
header key number = 100
header key fruit = apples
header key type = food
Now to select all apples I just subscribe to:
message/topic//apples/
To get all food when the number is between 110 and 119, I do:
message/topic/11*/*/food.
To get all pears between 200 and 299 and 358 and 369, use multiple subscriptions:
message/topic/2*/pears/*
mesage/topic/358/pears/*
mesage/topic/358/pears/*
mesage/topic/36*/pears/*
This means I can have multiple keys (up to 125!).
This only really breaks down when you need a complicated range