Пример #1
0
 public ResolvableServiceClient(string serviceName, string serviceVersion, IServiceDiscoveryClient serviceDiscoveryClient, IRestClient restClient)
 {
     this.serviceName            = serviceName;
     this.serviceVersion         = serviceVersion;
     this.serviceDiscoveryClient = serviceDiscoveryClient;
     this.restClient             = restClient;
 }
Пример #2
0
        public void WhenApplicationIsRegisteredMultipleTimes_ThenAllAddressesAreVisibleInServiceDiscovery()
        {
            const string appName = "test-service";
            const int    count   = 10;

            var clients = new IServiceDiscoveryClient[count];

            for (var i = 0; i < count; i++)
            {
                var builder = new BuilderSyntax()
                              .RegisterApplication(appName)
                              .WithAddress($"https://localhost:{5000 + i}")
                              .WithTags("api", "test");


                clients[i] = builder.Build();
            }

            var result = clients[0].GetAllAsync(appName).Result;

            Assert.Equal(count, result.Length);

            for (var i = 0; i < count; i++)
            {
                clients[i].Dispose();
            }
        }
Пример #3
0
        public ConsulHttpClientFactoryPolicy(IServiceDiscoveryClient discoveryClient)
        {
            if (discoveryClient == null)
            {
                throw new ArgumentNullException(nameof(discoveryClient));
            }

            _discoveryClient = discoveryClient;
        }
 public ConsulMessageHandler(IServiceDiscoveryClient discoveryClient, string clientName)
 {
     _discoveryClient = discoveryClient;
     _clientName      = clientName;
 }
 public ConsulHttpClientFactoryPolicy(IServiceDiscoveryClient discoveryClient)
 {
     _discoveryClient = Check.NotNull(discoveryClient, nameof(discoveryClient));
 }
Пример #6
0
 public FlatContainerService(IServiceDiscoveryClient serviceDiscoveryClient)
 {
     _serviceDiscoveryClient = serviceDiscoveryClient ?? throw new ArgumentNullException(nameof(serviceDiscoveryClient));
 }
Пример #7
0
 public IndexModel(ILogger <IndexModel> logger, IServiceDiscoveryClient client)
 {
     _logger = logger;
     _client = client;
 }
Пример #8
0
 public ConsulMessageHandler(IServiceDiscoveryClient discoveryClient)
 {
     _discoveryClient = discoveryClient;
 }