Is there a way of intercepting messages on a specific topic instead of looking at all the messages and then doing the filtering?
No.