-
Notifications
You must be signed in to change notification settings - Fork 6
Rendezvous
If MessageRouter represents a node within a network, then Rendezvous Service represents the kino network itself. Rendezvous is a single well-known endpoint and a single piece of configuration, which should be shared among all nodes of the network. MessageRouters connect to it to share the content of their ExternalRoutingTables and to learn the ones from others. In other words, connecting to the same Rendezvous service means being in the same network.
One of the Gossip protocols could be used for message routes information sharing. Nevertheless, it is more complicated and difficult to implement in a reliable way. Currently, the decision was made in favor of a central well-known registration service. Rendezvous service is installed on the cluster of the servers, where the leader is elected based on the consensus. At any point in time only the leader can send messages to other members of the network.
As soon as the service starts, it tries to connect to other members of the cluster and elect a leader. If instance becomes the leader, it begins to broadcast message routes configuration changes to all members of the network. Other instances of Rendezvous service stays in passive mode. kino nodes randomly connect to any of the configured Rendezvous service instances. If a node connects to a passive instance and sends a message to it, Rendezvous service will respond with RendezvousNotLeaderMessage including the URI of the current leader. The node should then re-connect to the URI of the leader.
If the whole Rendezvous cluster is unavailable, kino network will still operate, except that message routes updates will not be propagated until the cluster is available again. As soon as the cluster is up and running, for the kino nodes, which went online during Rendezvous downtime, their routing information will be shared among all members of the network.
Rendezvous is implemented as a Windows Service. You may use the following code within Main() function of your Console application to wire it up and start:
private static void Main(string[] args)
{
// Resolve required dependencies
SocketConfiguration socketConfiguration = new SocketConfiguration {...};
ApplicationConfiguration applicationConfiguration = new ApplicationConfiguration {...};
// Create an instance of your logger, which implements ILogger interface
ILogger logger = new MyLogger();
// Instantiate and start Rendezvous service
new ServiceHost(socketConfiguration,
applicationConfiguration,
logger)
.Run();
}