filter pubsub messages by query