Example #1
0
        public async Task <IList <Uri> > GetGateways()
        {
            var membershipTableData = await ConsulBasedMembershipTable.ReadAll(this.consulClient, this.deploymentId, this.logger);

            if (membershipTableData == null)
            {
                return(new List <Uri>());
            }

            return(membershipTableData.Members.Select(e => e.Item1).
                   Where(m => m.Status == SiloStatus.Active && m.ProxyPort != 0).
                   Select(m =>
            {
                m.SiloAddress.Endpoint.Port = m.ProxyPort;
                return m.SiloAddress.ToGatewayUri();
            }).ToList());
        }
Example #2
0
        public async Task <IList <Uri> > GetGateways()
        {
            var membershipTableData = await ConsulBasedMembershipTable.ReadAll(this.consulClient, this.clusterId, this.kvRootFolder, this.logger, null);

            if (membershipTableData == null)
            {
                return(new List <Uri>());
            }

            return(membershipTableData.Members.Select(e => e.Item1).
                   Where(m => m.Status == SiloStatus.Active && m.ProxyPort != 0).
                   Select(m =>
            {
                var endpoint = new IPEndPoint(m.SiloAddress.Endpoint.Address, m.ProxyPort);
                var gatewayAddress = SiloAddress.New(endpoint, m.SiloAddress.Generation);
                return gatewayAddress.ToGatewayUri();
            }).ToList());
        }