Does an XMPP service require a single point of entry?
Let's say I have the following server-side architecture for my XMPP-based chat service:
I assume that each client (Sender being one, Recipient 1 and 2 being others) must initially connect to and bind to an XMPP server and that the client will always be bound to that server for the client's entire session. Correct?
If correct, then what determines which XMPP server the client initially connects to? Is there some single point of e开发者_Go百科ntry server in this XMPP cluster that decides this?
Yes, a client will have a persistent connection to one XMPP server for each session.
Assuming all servers in your figure serves the same domain, the usual method to provide multiple servers would be using multiple DNS SRV records for the domain. For example, an XMPP client connecting to "google.com" would resolve the following servers/ports:
$ dig +short -t SRV _xmpp-client._tcp.google.com
20 0 5222 talk3.l.google.com.
20 0 5222 talk2.l.google.com.
5 0 5222 talk.l.google.com.
20 0 5222 talk1.l.google.com.
20 0 5222 talk4.l.google.com.
This is defined in the spec at: http://xmpp.org/rfcs/rfc6120.html#tcp-resolution
精彩评论