I want to write application that make messaging between users, Messages that send between users is in 3 types
- Direct
- Channel: just send from admin
- Group
My application will save messages in RDBMS. When new message send and receiver user is online ,my app will notify to user that new message receive , I decided to write my application using Spring Websocket and Stomp .My application using spring security and and i want show online users in group and direct for each other member my question is know how many endpoint and broker i need ? and how can do that.
Update:
My application is similar gitter and slack , when user login messages may receive from direct or group or channel. when i switch between users and group or channel i will unsubscribe from last and subscribe to user or group that i chat in .i dont know subscribe and unsubscribe is correct or just one subscribe for all . is this usage correct or not?
chatSocket.subscribe("/user/exchange/direct/chat.message/{userId}", function(message) {});
chatSocket.subscribe("/topic/group/chat.message/{groupId}", function(message) {});