Beispiel #1
0
        private void OnInstanceStarted(SvcDiscovery.InstanceStarted msg)
        {
            Log.Info("{@Event}", msg);

            var svc        = Services.SingleOrDefault(x => x.ClusterAddress.Equals(msg.ClusterAddress));
            var newService = svc != null;

            svc = new Service(msg.ServiceName, msg.ServiceEndpoint, msg.ClusterAddress);

            if (newService)
            {
                Services.Add(svc);
            }

            ClusterBroadcast.Tell(new CommitService(svc), Self);

            //todo: Notify API Gateways
        }
Beispiel #2
0
 private bool CanHandleInstanceStarted(SvcDiscovery.InstanceStarted msg)
 {
     return(IsRoleLeader);
 }