Skip to content
Sergey Ivasenko edited this page Dec 22, 2015 · 18 revisions

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.

Following are the responsibilities of the Rendezvous service:

  • broadcast message routes changes, i.e. registration of new routes, unregistration of invalid routes
  • broadcast Ping message used for health monitoring
  • broadcast Pong responses from the connected nodes

Design Considerations

One of the Gossip protocols could be used for both heartbeating and 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 and heartbeating 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.

Operation

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 send Ping messages, broadcast Pong responses and 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 it a message, 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 it 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.

Usage

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
    LeaseConfiguration leaseConfiguration = ....
    SocketConfiguration socketConfiguration = ...
    RendezvousConfiguration rendezvousConfiguration = ...
    ApplicationConfiguration applicationConfiguration = ...
    // Create an instance of your logger, which implements ILogger interface
    ILogger logger = new MyLogger();

    // Instantiate and start Rendezvous service
    new ServiceHost(leaseConfiguration, 
                    socketConfiguration,
                    rendezvousConfiguration,
                    applicationConfiguration,
                    logger)
        .Run();
    }
Clone this wiki locally