Do I need a retry policy to handle transient faults for Service Fabric internal communication?

1.3k Views Asked by At

We use Azure Service Fabric with Reliable Services and Actors, the IoTHub and Web Apis and are currently integrating "Transient Fault Handling" (TFH) to deal with errors during (remote) communication of services.

For Azure Storage and SQL it is already implemented, we use the built-in retry policies for that and it works fine.

But what about the Service Fabric internal communication? There are also services, communicating via a remoting mechanism.

Here are my questions:

  • Do we need to handle transient faults for the communication between Reliable Services and Reliable Actors in Service Fabric?
  • If so - how could this be done? Is the Transient Fault Handling Application Block the only way to implement retry policies for the internal communication?
  • If not - how does Service Fabric handle transient faults?

Additional information I already gathered:

This article about communication between services describes a typical fault-handling retry pattern for the inter-service communication. But instead of ICommunicationClientFactory and ICommunicationClient, we use Service Remoting for that. I could not figure out, how to use this typical fault handling with Service Remoting.

1

There are 1 best solutions below

0
Peter Lindström On

Late answer, but maybe people are still looking for answers... Anyhow, Service Fabric has default transient fault handling (and non transient fault handling as well). Via the OperationRetrySettings you can customize these. You can also customize other properties via the TransportSettings. Here is an example how you can customize these settings:

FabricTransportSettings transportSettings = new FabricTransportSettings
{
OperationTimeout = TimeSpan.FromSeconds(30)
};

var retrySettings = new OperationRetrySettings(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(1), 5);

var clientFactory = new Microsoft.ServiceFabric.Services.Remoting.FabricTransport.Client.FabricTransportServiceRemotingClientFactory(transportSettings);

var serviceProxyFactory = new Microsoft.ServiceFabric.Services.Remoting.Client.ServiceProxyFactory((c) => clientFactory, retrySettings);

var client = serviceProxyFactory.CreateServiceProxy<IXyzService>(new Uri("fabric:/Xyz/Service"));

return client;

hth //Peter