1 Reply Latest reply on Jun 4, 2013 11:02 AM by jfuerth

    Chat with user identification

    arnie-k

      I want to create chat, I know that there are communication chanels in which user can broadcast messages.

      I wonder how to be sure that message is not broadcasted to everyone but only to client participating in selected chat.

      I am sure that it is possible.

        • 1. Re: Chat with user identification
          jfuerth

          Hi Arnie,

           

          Like all messages, broadcast messages are sent to a specific subject on the bus. Messages are only delivered to clients who have to subscribed to that subject. So the trick is to define a different subject name for each chat room/channel/conversation. A chat room is a bus subject.

           

          But how does a client know which subject(s) to subscribe to? Well, you could have one conversational service (or RPC service) with a well-known name (like ChatRoomListService) which responds with a list of subject names that the requesting client is allowed to enter.

           

          If you want your chat rooms to be secure, incorporate some securely-generated random hash into each chat room name. As long as the name is impossible to guess, unauthorized clients will not be able to gain access to the messages sent to that subject.

           

          -Jonathan

          1 of 1 people found this helpful