Exemple #1
0
        private string GetServiceEndpointJson(ResolvedServicePartition partition, HttpServiceUriBuilder uriBuilder)
        {
            string serviceEndpointJson;

            switch (uriBuilder.Target)
            {
            case HttpServiceUriTarget.Default:
            case HttpServiceUriTarget.Primary:
                serviceEndpointJson = partition.GetEndpoint().Address;
                break;

            case HttpServiceUriTarget.Secondary:
                serviceEndpointJson = partition.Endpoints.ElementAt(this._random.Next(1, partition.Endpoints.Count)).Address;
                break;

            default:
                serviceEndpointJson = partition.Endpoints.ElementAt(this._random.Next(0, partition.Endpoints.Count)).Address;
                break;
            }

            return(serviceEndpointJson);
        }
Exemple #2
0
        private Uri GetResolvedRequestUri(ResolvedServicePartition partition, HttpServiceUriBuilder uriBuilder)
        {
            string serviceEndpointJson = GetServiceEndpointJson(partition, uriBuilder);

            return(GetRequestUri(serviceEndpointJson, uriBuilder));
        }