I'm working on an application that allows users to send internal message to one-another.
I'll tell you what the current setup is and please help me figure out how to make it work or perhaps suggest another angle to take. We're using BlazeDS with Spring.
- User A listens for messages on message topic Chat.A
- User B listens for messages on message topic Chat.B
- Both users listen for global messages (system-wide messages) on topic Chat.System
So we have a multi-topic consumer for the personal message topic and one for the global message topic.
So a couple of questions I have:
- Is it better to do it as two distinct consumers (that share the same handler function) or as one, multi-topic consumer?
- How do I check that the client A is actually the one listening to Chat.A and not just some one else that knows how to write BlazeDS clients? We have Spring Security in place, but how can I listen for subscription requests and block them if their user name (pulled from security context) doesn't match the sub-topic that they requested?
I've also read about selectors. Well, that looked promising, but again, how do I check that when a consumer uses selector="for == A || for == System
that the consumer belongs to a client that has authenticated as that "for" user.
- How do selectors compare/contrast to sub-topics? What's the best situation for each of them?