Can a user subscribe to a topic


I am trying to a write an app, where users can subsribe to a topic(s) when they are logged as annoynomus users. Users needs to pull the data when there is an update on the topic. Similarly users can publish topic(s) which can be seen by the subscribers of this topic(s). Are there any working examples for thiskind of services. I would like to use openfire and spark combination. I am looking for a high scalabilty.