ServicePartitionResolver Class

Definition

Implements the Service partition resolver class that uses the FabricClientResolveServicePartitionAsync(Uri) method for service resolution and implements a back-off/retry mechanism on errors from that method.

public class ServicePartitionResolver : Microsoft.ServiceFabric.Services.Client.IServicePartitionResolver
type ServicePartitionResolver = class
    interface IServicePartitionResolver
Public Class ServicePartitionResolver
Implements IServicePartitionResolver
Inheritance
System.Object
ServicePartitionResolver
Implements

Constructors

ServicePartitionResolver(CreateFabricClientDelegate)

Instantiates a ServicePartitionResolver, invoking the given delegate to instantiate FabricClient.

ServicePartitionResolver(CreateFabricClientDelegate, CreateFabricClientDelegate)

Instantiates a ServicePartionResolver, invoking the first delegate to get the FabricClient. During partition resolution if FabricClient object gets disposed and second delegate is provided, it uses the second delegate to get the FabricClient again. The second delegate provides a way to specify an alternate way to get or create FabricClient if FabricClient created with first delegate get disposed.

ServicePartitionResolver(FabricClientSettings, String[])

Instantiates a ServicePartitionResolver, uses the given FabricClient Settings and the connectionEndpoints to create a new instance of FabricClient.

ServicePartitionResolver(SecurityCredentials, FabricClientSettings, String[])

Instantiates a ServicePartitionResolver, uses the given security credentials, FabricClient Settings and the connectionEndpoints to create a new instance of FabricClient.

ServicePartitionResolver(SecurityCredentials, String[])

Instantiates a ServicePartitionResolver, uses the given security credentials and the connectionEndpoints to create a new instance of FabricClient.

ServicePartitionResolver(String[])

Instantiates a ServicePartitionResolver, uses the given connectionEndpoints to create a new instance of the FabricClient.

Fields

DefaultMaxRetryBackoffInterval

The default maximum back-off time used by ServicePartitionResolver's ResolveAsync method before retrying, when it is invoked without explicitly specifying the maxRetryBackoffInterval argument. The default value is 5 seconds.

DefaultResolveTimeout

The default resolve timeout per try used by the ResolveAsync method of ServicePartitionResolver when it is invoked without explicitly specifying the resolveTimeoutPerTry argument. The default value is 30 seconds.

Methods

GetDefault()

Gets the default ServicePartitionResolver.

The default service partition resolver instance uses the local fabric client. If you are using the ServicePartitionResolver to resolve services that are running on a remote cluster, the recommended practice is to create a ServicePartitionResolver using the appropriate endpoints or FabricClient and then update the default ServicePartitionResolver.

ResolveAsync(ResolvedServicePartition, CancellationToken)

Resolves a partition of the specified service by invoking FabricClient's ResolveServicePartitionAsync(Uri)method with back-off/retry on retry-able errors. This takes in the resolved service partition that was got via an earlier invocation of the ResolveAsync() method. This method overload is used in cases where the client knows that the resolved service partition that it has is no longer valid.

ResolveAsync(ResolvedServicePartition, TimeSpan, TimeSpan, CancellationToken)

Resolves a partition of the specified service by invoking FabricClient's ResolveServicePartitionAsync(Uri)method with back-off/retry on retry-able errors. This takes in the resolved service partition that was got via an earlier invocation of the ResolveAsync() method. This method overload is used in cases where the client knows that the resolved service partition that it has is no longer valid.

ResolveAsync(Uri, ServicePartitionKey, CancellationToken)

Resolves a partition of the specified service by invoking FabricClient's ResolveServicePartitionAsync(Uri)method. This uses the default settings for DefaultResolveTimeout and DefaultMaxRetryBackoffInterval intervals.

ResolveAsync(Uri, ServicePartitionKey, TimeSpan, TimeSpan, CancellationToken)

Resolves a partition of the specified service by invoking FabricClient's ResolveServicePartitionAsync(Uri) method with the given timeout and back-off/retry on retry-able errors.

SetDefault(ServicePartitionResolver)

Updates the default ServicePartitionResolver.

Extension Methods

DisableNotification(ServicePartitionResolver)

An extension method that disables the notification for this particular instance of ServicePartitionResolver By default, service partition Resolver register for notification.There is a cache of service endpoints in the client that gets updated by notifications and this same cache is used to satisfy complaint based resolution requests. If you interested in only complain based resolution, then you could use this extension to disable it.

Applies to