Retry interceptor for IceRPC
$ dotnet add package IceRpc.RetryIceRpc.Retry provides an IceRPC interceptor that retries failed invocations automatically.
Source code | Package | Example | API reference | Interceptor documentation
// Client application
using IceRpc;
await using var connectionCache = new ConnectionCache();
// Create an invocation pipeline and install the retry interceptor.
Pipeline pipeline = new Pipeline()
.UseRetry()
.Into(connectionCache);
// Client application
using IceRpc;
using IceRpc.Extensions.DependencyInjection;
var hostBuilder = Host.CreateDefaultBuilder(args);
hostBuilder.ConfigureServices(services =>
services
.AddIceRpcConnectionCache()
.AddIceRpcInvoker(builder =>
builder
// Add the retry interceptor to the invocation pipeline.
.UseRetry()
.Into<ConnectionCache>()));
using var host = hostBuilder.Build();
host.Run();