ColdFusion 8: Extending Simple Chat Application : Multi Room support with SubTopics
This new sample illustrates how to take advantage of subtopics when using Messaging.
With the default setup, to send messages to a specific room we would have to handle all messages from the default destination at the client side and populate the right room with the new message or create 1 destination (at runtime) per room and each destination would handle their own messages. The first approach is not the best since we would get all messages from all rooms which would consume unnecessary bandwidth with useless data. While the second approach can solve our problems it does not work in FDS 2.0.1 since it does not support runtime configurations.
There is a third option which is the use of subtopics. When assigning the subtopic property to a consumer/producer, you are sharing the same destination but just want to send a message to a subset of the connected clients to that destination. In this sample, the room name is the subtopic so each client connected to a specific subtopic will only get messages from that room.

