Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/07/13 13:54:49 (11 years ago)
Author:
pfleck
Message:

#2030
Configured Tcp binding for Hive service on Hive clients.
Added binding-configuration priority list in Hive settings for managing multiple binding-configurations.
Added retry mechanism for multiple Hive-service bindings.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HivePerformance/sources/HeuristicLab.Clients.Hive/3.3/HiveServiceLocator.cs

    r7259 r9461  
    4747    }
    4848
     49    private int endpointRetries;
     50
     51    private string workingEndpoint;
     52
    4953    private HiveServiceClient NewServiceClient() {
    50       HiveServiceClient cl;
     54      if (endpointRetries >= Settings.Default.MaxEndpointRetries) {
     55        return CreateClient(workingEndpoint);
     56      }
     57
     58      var configurations = Settings.Default.EndpointConfigurationPriorities;
     59
     60      Exception exception = null;
     61      foreach (var endpointConfigurationName in configurations) {
     62        try {
     63          var cl = CreateClient(endpointConfigurationName);
     64          cl.Open();
     65          workingEndpoint = endpointConfigurationName;
     66          return cl;
     67        }
     68        catch (Exception exc) {
     69          exception = exc;
     70          endpointRetries++;
     71        }
     72      }
     73
     74      throw exception;
     75    }
     76
     77    private HiveServiceClient CreateClient(string endpointConfigurationName) {
     78      HiveServiceClient cl = null;
     79
    5180      if (string.IsNullOrEmpty(username) && string.IsNullOrEmpty(password))
    52         cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>();
     81        cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(endpointConfigurationName);
    5382      else
    54         cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(null, null, username, password);
     83        cl = ClientFactory.CreateClient<HiveServiceClient, IHiveService>(endpointConfigurationName, null, username, password);
    5584
    5685      return cl;
Note: See TracChangeset for help on using the changeset viewer.