Share via


ServicePartitionResolver.ResolveAsync Method

Definition

Overloads

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(Uri, ServicePartitionKey, CancellationToken)

Resolves a partition of the specified service by invoking FabricClient's ResolveServicePartitionAsync(Uri)method. This uses the default settings for timeout and back-off retry intervals.

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, 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.

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.

public System.Threading.Tasks.Task<System.Fabric.ResolvedServicePartition> ResolveAsync (System.Fabric.ResolvedServicePartition previousRsp, System.Threading.CancellationToken cancellationToken);
member this.ResolveAsync : System.Fabric.ResolvedServicePartition * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Fabric.ResolvedServicePartition>
Public Function ResolveAsync (previousRsp As ResolvedServicePartition, cancellationToken As CancellationToken) As Task(Of ResolvedServicePartition)

Parameters

previousRsp
ResolvedServicePartition

The resolved service partition that the client got from the earlier invocation of the ResolveAsync() method.

cancellationToken
CancellationToken

The CancellationToken that this operation is observing. It is used to notify the operation that it should be canceled.

Returns

A Task that represents outstanding operation. The result from the task is the ResolvedServicePartition object, that contains the information about the resolved service partition including the service endpoints.

Exceptions

This method can throw a FabricServiceNotFoundExcepion if the service which was resolved previously is no longer present in the cluster.

Remarks

This method retries on all transient exceptions. For cases where you want to limit the max execution time of this method, you should create a cancellation token associated with that max execution time and pass that cancellation token to this method.

Applies to

ResolveAsync(Uri, ServicePartitionKey, CancellationToken)

Resolves a partition of the specified service by invoking FabricClient's ResolveServicePartitionAsync(Uri)method. This uses the default settings for timeout and back-off retry intervals.

public System.Threading.Tasks.Task<System.Fabric.ResolvedServicePartition> ResolveAsync (Uri serviceUri, Microsoft.ServiceFabric.Services.Client.ServicePartitionKey partitionKey, System.Threading.CancellationToken cancellationToken);
member this.ResolveAsync : Uri * Microsoft.ServiceFabric.Services.Client.ServicePartitionKey * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Fabric.ResolvedServicePartition>
Public Function ResolveAsync (serviceUri As Uri, partitionKey As ServicePartitionKey, cancellationToken As CancellationToken) As Task(Of ResolvedServicePartition)

Parameters

serviceUri
Uri

Name of the service instance to resolve.

partitionKey
ServicePartitionKey

Key that determines the target partition of the service instance. The partitioning scheme specified in the key should match the partitioning scheme used to create the service instance.

cancellationToken
CancellationToken

The CancellationToken that this operation is observing. It is used to notify the operation that it should be canceled.

Returns

A Task that represents outstanding operation. The result from the task is the ResolvedServicePartition object, that contains the information about the resolved service partition including the service endpoints.

Exceptions

This method can throw a FabricServiceNotFoundExcepion if there is no service instance in the cluster matching the specified serviceUri.

This method can throw a FabricException if the scheme specified in the ServicePartitionKey doesn't match the scheme used to create the service instance. See also Errors and Exceptions for handling common FabricClient failures.

Remarks

This method retries on all transient exceptions. For cases where you want to limit the max execution time of this method, you should create a cancellation token associated with that max execution time and pass that cancellation token to this method.

Applies to

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.

public System.Threading.Tasks.Task<System.Fabric.ResolvedServicePartition> ResolveAsync (System.Fabric.ResolvedServicePartition previousRsp, TimeSpan resolveTimeoutPerTry, TimeSpan maxRetryBackoffInterval, System.Threading.CancellationToken cancellationToken);
abstract member ResolveAsync : System.Fabric.ResolvedServicePartition * TimeSpan * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Fabric.ResolvedServicePartition>
override this.ResolveAsync : System.Fabric.ResolvedServicePartition * TimeSpan * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Fabric.ResolvedServicePartition>
Public Function ResolveAsync (previousRsp As ResolvedServicePartition, resolveTimeoutPerTry As TimeSpan, maxRetryBackoffInterval As TimeSpan, cancellationToken As CancellationToken) As Task(Of ResolvedServicePartition)

Parameters

previousRsp
ResolvedServicePartition

The resolved service partition that the client got from the earlier invocation of the ResolveAsync() method.

resolveTimeoutPerTry
TimeSpan

The timeout passed to FabricClient's ResolveServicePartitionAsync(Uri)method

maxRetryBackoffInterval
TimeSpan

The max interval to back-off before retrying when FabricClient's ResolveServicePartitionAsync(Uri)method fails with a retry-able exception. The actual back off interval is a random time interval which is less than or equal to the specified maxRetryBackoffInterval.

cancellationToken
CancellationToken

The CancellationToken that this operation is observing. It is used to notify the operation that it should be canceled.

Returns

A Task that represents outstanding operation. The result from the task is the ResolvedServicePartition object, that contains the information about the resolved service partition including the service endpoints.

Implements

Exceptions

This method can throw a FabricServiceNotFoundExcepion if the service which was resolved previously is no longer present in the cluster.

Remarks

This method retries on all transient exceptions. For cases where you want to limit the max execution time of this method, you should create a cancellation token associated with that max execution time and pass that cancellation token to this method.

Applies to

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.

public System.Threading.Tasks.Task<System.Fabric.ResolvedServicePartition> ResolveAsync (Uri serviceUri, Microsoft.ServiceFabric.Services.Client.ServicePartitionKey partitionKey, TimeSpan resolveTimeoutPerTry, TimeSpan maxRetryBackoffInterval, System.Threading.CancellationToken cancellationToken);
abstract member ResolveAsync : Uri * Microsoft.ServiceFabric.Services.Client.ServicePartitionKey * TimeSpan * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Fabric.ResolvedServicePartition>
override this.ResolveAsync : Uri * Microsoft.ServiceFabric.Services.Client.ServicePartitionKey * TimeSpan * TimeSpan * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Fabric.ResolvedServicePartition>
Public Function ResolveAsync (serviceUri As Uri, partitionKey As ServicePartitionKey, resolveTimeoutPerTry As TimeSpan, maxRetryBackoffInterval As TimeSpan, cancellationToken As CancellationToken) As Task(Of ResolvedServicePartition)

Parameters

serviceUri
Uri

Name of the service instance to resolve.

partitionKey
ServicePartitionKey

Key that determines the target partition of the service instance. The partitioning scheme specified in the key should match the partitioning scheme used to create the service instance.

resolveTimeoutPerTry
TimeSpan

The timeout passed to FabricClient's ResolveServicePartitionAsync(Uri)method.

maxRetryBackoffInterval
TimeSpan

The max interval to back-off before retrying when FabricClient's ResolveServicePartitionAsync(Uri)method fails with a retry-able exception. The actual back off interval is a random time interval which is less than or equal to the specified maxRetryBackoffInterval.

cancellationToken
CancellationToken

The CancellationToken that this operation is observing. It is used to notify the operation that it should be canceled.

Returns

A Task that represents outstanding operation. The result from the task is the ResolvedServicePartition object, that contains the information about the resolved service partition including the service endpoints.

Implements

Exceptions

This method can throw a FabricServiceNotFoundExcepion if there is no service instance in the cluster matching the specified serviceUri.

This can throw a FabricException if the scheme specified in the ServicePartitionKey doesn't match the scheme used to create the service instance. See also Errors and Exceptions for more information.

Remarks

This method retries on all transient exceptions. For cases where you want to limit the max execution time of this method, you should create a cancellation token associated with that max execution time and pass that cancellation token to this method.

Applies to