Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Cometd servers may be aggregated into a cluster using Oort, which is a collection of extensions that use the java CometD client to link the servers together. The Oort class allows cometd servers to observe each other, which means to open bayeux connections in both directions.
  • Every comet server creates an instance of Oort which creates a BayeuxClient (called an OortComet) to connect to all other known comet servers (These URLs must be passed to the Oort object during instantiation). It then adds listeners to whatever channels it is interested in. Thus, each server communicates both ways with each other server in the cluster.
  • There is a special set of channels, "/oort/*" for cluster communication. There is a special channel called '/oort/cloud' on which comet servers can broadcast the URLs of comet servers they know of.
  •  Seti is used to send messages to a user on a different comet server.
    • There is one Seti instance on each server
    • When a new user logs into a comet server, it creates an entry associating its Id with a ServerSession object.
     
    • Additionally, it broadcasts on special channel called '/set/ALL' telling every other server that this user exists and is connected to this server and can be reached on a direct channel to this server
    • When a message meant for a particular user is sent, a server first checks local sessions to see if it has the client connected to it, otherwise it broadcasts the message on '/seti/ALL'
    • They are trying to introduce an intermediate level of 'shards' of comet servers, but haven't implemented that in version 2.0.0. The idea is that when a new user logs into one comet server, this piece of information is broadcast to this shard and not on '/seti/ALL'. Furthermore, when a message is sent out, it is sent to one comet inside each shard. If that comet cannot find the user in it's local connections, it broadcasts the message to its entire shard.