Put Client Configuration Operation (Server-Wide)


  • The server-wide Client-Configuration is a set of configuration options that are set on the server and apply to any client when communicating with any database in the cluster.
    See the available configuration options in the article about put client-configuration for database.

  • To set the server-wide Client-Configuration on the server:

    • Use PutServerWideClientConfigurationOperation from the client code.
      See the example below.

    • Or, set the server-wide Client-Configuration from the Studio Client-Configuration view.

  • A Client-Configuration that is set on the server overrides the initial Client-Configuration that is set on the client when creating the Document Store.
    A Client-Configuration that is set on the server for the database level will override the server-wide Client-Configuration for that database.

  • Once the Client-Configuration is modified on the server, the running client will receive the updated settings the next time it makes a request to the database.



Put client-configuration (server-wide)

// Define the client-configuration object
ClientConfiguration clientConfiguration = new ClientConfiguration
{
    MaxNumberOfRequestsPerSession = 100,
    ReadBalanceBehavior = ReadBalanceBehavior.FastestNode
    // ...
};
    
// Define the put server-wide client-configuration operation, pass the configuration 
var putServerWideClientConfigOp = new PutServerWideClientConfigurationOperation(clientConfiguration);

// Execute the operation by passing it to Maintenance.Server.Send
store.Maintenance.Server.Send(putServerWideClientConfigOp);
// Define the client-configuration object
ClientConfiguration clientConfiguration = new ClientConfiguration
{
    MaxNumberOfRequestsPerSession = 100,
    ReadBalanceBehavior = ReadBalanceBehavior.FastestNode
    // ...
};
        
// Define the put server-wide client-configuration operation, pass the configuration 
var putServerWideClientConfigOp = new PutServerWideClientConfigurationOperation(clientConfiguration);
    
// Execute the operation by passing it to Maintenance.Server.SendAsync
tore.Maintenance.Server.SendAsync(putServerWideClientConfigOp);

Syntax

public PutServerWideClientConfigurationOperation(ClientConfiguration configuration)
Parameter Type Description
configuration ClientConfiguration Client configuration that will be set on the server
(server-wide, for all databases)

public class ClientConfiguration
{
    private char? _identityPartsSeparator;
    public long Etag { get; set; }
    public bool Disabled { get; set; }
    public int? MaxNumberOfRequestsPerSession { get; set; }
    public ReadBalanceBehavior? ReadBalanceBehavior { get; set; }
    public LoadBalanceBehavior? LoadBalanceBehavior { get; set; }
    public int? LoadBalancerContextSeed { get; set; }
    public char? IdentityPartsSeparator;  // can be any character except '|'
}