Suggestions on architecture for XMPP-based chat service?
Let's say my goal is to create a chat service. I also want multiple, discrete chat rooms.
开发者_开发百科I am leaning toward using XMPP for scaling / load balancing. I read the article here, and I am looking at
Let's say I want to send a message from one client to another. According to this diagram,
1) The sender sends a message to Sender's XMPP Server. 2) Sender's XMPP Server relays the message to the MUC server. 3) The MUC server determines which server the recipient is connected to and relays the message there.
(correct me if I'm wrong)
Two questions:
1) The article suggests clustering the MUC over several servers. Does this mean a) mirror the MUC server's status over sender and recipient servers or b) turn the MUC section of the diagram into multiple servers, and the sender and recipient servers communicate with that cluster, transparently?
2) When a user first connects to a node, how does the network know which server to bind the user to? Is there a single point of entry machine to delegate this?
As far as entry point into the system are concerned, your clients will always use default entry points or the one you have specified in your DNS SRV settings i.e. user rcv and send data only via your xmpp server port 5222 (c2s) or 5269 (s2s).
So MUC message stanza flow will look like this (lemme know if i mis-interpreted your question):
a) if Sender/Receiver are both registered at your server
sender@myjabber.com <--> myjabber.com:5222 <--> muc.myjabber.com <--> myjabber.com:5222 <--> receiver@myjabber.com
b) if Sender is @gmail.com user and Rcvr @myjabber.com user
sender@gmail.com <--> talk.google.com:5222 <--> myjabber.com:5269 <--> muc.myjabber.com <--> myjabber.com:5222 <--> receiver@myjabber.com
精彩评论