FabricTransportServiceRemotingClientFactory Class

public class FabricTransportServiceRemotingClientFactory implements ServiceRemotingClientFactory

An ServiceRemotingClientFactory that uses Fabric TCP transport to create ServiceRemotingClient that communicate with stateless and stateful services over interfaces that are remoted via FabricTransportServiceRemotingListener.

Constructor Summary

Constructor Description
FabricTransportServiceRemotingClientFactory(FabricTransportRemotingSettings fabricTransportSettings, ServiceRemotingCallbackClient callbackClient, ServicePartitionResolver servicePartitionResolver, List<ExceptionHandler> exceptionHandlers, String traceId)

Constructs a fabric transport based service remoting client factory.

Remarks:This factory uses an internal fabric transport exception handler to handle exceptions at the fabric TCP transport level and a ServiceRemotingExceptionHandler, in addition to the exception handlers supplied to the constructor.

Method Summary

Modifier and Type Method and Description
CompletableFuture<ServiceRemotingClient> getClientAsync(ResolvedServicePartition previousRsp, TargetReplicaSelector targetReplicaSelector, String listenerName, OperationRetrySettings retrySettings)

Re-resolves a partition of the specified service containing one or more communication listeners and returns a client to communicate to the endpoint corresponding to the given listenerName. The endpoint of the service is of the form - {"Endpoints":{"Listener1":"Endpoint1","Listener2":"Endpoint2" ...}}

CompletableFuture<ServiceRemotingClient> getClientAsync(URI serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector targetReplicaSelector, String listenerName, OperationRetrySettings retrySettings)

Resolves a partition of the specified service containing one or more communication listeners and returns a client to communicate to the endpoint corresponding to the given listenerName. The endpoint of the service is of the form - {"Endpoints":{"Listener1":"Endpoint1","Listener2":"Endpoint2" ...}}

CompletableFuture<OperationRetryControl> reportOperationExceptionAsync(ServiceRemotingClient client, ExceptionInformation exceptionInformation, OperationRetrySettings retrySettings)

Handles the exceptions that occur in the CommunicationClient when sending a message to the Service

Inherited Members

Constructor Details

FabricTransportServiceRemotingClientFactory

public FabricTransportServiceRemotingClientFactory(FabricTransportRemotingSettings fabricTransportSettings, ServiceRemotingCallbackClient callbackClient, ServicePartitionResolver servicePartitionResolver, List exceptionHandlers, String traceId)

Constructs a fabric transport based service remoting client factory.

Remarks:This factory uses an internal fabric transport exception handler to handle exceptions at the fabric TCP transport level and a ServiceRemotingExceptionHandler, in addition to the exception handlers supplied to the constructor.

Parameters:

fabricTransportSettings - The settings for the fabric transport. If the settings are not provided or null, default settings with no security.
callbackClient - The callback client that receives the callbacks from the service.
servicePartitionResolver - Service partition resolver to resolve the service endpoints. If not specified, a default service partition resolver returned by getDefault() is used.
exceptionHandlers - Exception handlers to handle the exceptions encountered in communicating with the service.
traceId - Id to use in diagnostics traces from this component.

Method Details

getClientAsync

public CompletableFuture getClientAsync(ResolvedServicePartition previousRsp, TargetReplicaSelector targetReplicaSelector, String listenerName, OperationRetrySettings retrySettings)

Re-resolves a partition of the specified service containing one or more communication listeners and returns a client to communicate to the endpoint corresponding to the given listenerName. The endpoint of the service is of the form - {"Endpoints":{"Listener1":"Endpoint1","Listener2":"Endpoint2" ...}}

Overrides:

FabricTransportServiceRemotingClientFactory.getClientAsync(ResolvedServicePartition previousRsp, TargetReplicaSelector targetReplicaSelector, String listenerName, OperationRetrySettings retrySettings)

Parameters:

previousRsp - Previous ResolvedServicePartition value
targetReplicaSelector - Specifies which replica in the partition identified by the partition key, the client should connect to
listenerName - Specifies which listener in the endpoint of the chosen replica, to which the client should connect to
retrySettings - Specifies the retry policy that should be used for exceptions that occur when creating the client.

Returns:

A CompletableFuture that represents outstanding operation. The result of the Task is the CommunicationClient( CommunicationClient) object.

getClientAsync

public CompletableFuture getClientAsync(URI serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector targetReplicaSelector, String listenerName, OperationRetrySettings retrySettings)

Resolves a partition of the specified service containing one or more communication listeners and returns a client to communicate to the endpoint corresponding to the given listenerName. The endpoint of the service is of the form - {"Endpoints":{"Listener1":"Endpoint1","Listener2":"Endpoint2" ...}}

Overrides:

FabricTransportServiceRemotingClientFactory.getClientAsync(URI serviceUri, ServicePartitionKey partitionKey, TargetReplicaSelector targetReplicaSelector, String listenerName, OperationRetrySettings retrySettings)

Parameters:

serviceUri - Uri of the service to resolve
partitionKey - Key that identifies the partition to resolve
targetReplicaSelector - Specifies which replica in the partition identified by the partition key, the client should connect to
listenerName - Specifies which listener in the endpoint of the chosen replica, to which the client should connect to
retrySettings - Specifies the retry policy that should be used for exceptions that occur when creating the client.

Returns:

A CompletableFuture that represents outstanding operation. The result of the Task is the CommunicationClient( CommunicationClient) object.

reportOperationExceptionAsync

public CompletableFuture reportOperationExceptionAsync(ServiceRemotingClient client, ExceptionInformation exceptionInformation, OperationRetrySettings retrySettings)

Handles the exceptions that occur in the CommunicationClient when sending a message to the Service

Parameters:

client - Communication client
exceptionInformation - Information about exception that happened while communicating with the service.
retrySettings - Specifies the retry policy that should be used for handling the reported exception.

Returns:

A CompletableFuture that represents outstanding operation. The result of the Task is a OperationRetryControl object that provides information on retry policy for this exception.

Applies to