Pubsub supports filtering messages before they are delivered to subscriber. the complete feature specs are defined at https://cloud.google.com/pubsub/docs/filtering
We need to support same in metro.
For implementation, you can refer to https://github.com/6RiverSystems/mmmbbb/tree/main/filter