Locator interceptor for IceRPC
$ dotnet add package IceRpc.LocatorIceRpc.Locator provides an IceRPC interceptor that allows you to resolve ice service addresses using an Ice locator.
Use this interceptor in IceRPC client applications that call services hosted by IceGrid-managed servers.
Ice interop only
Source code | Package | Example | API reference | Ice interop
using IceRpc;
using IceRpc.Ice;
// Create an invocation pipeline.
var pipeline = new Pipeline();
// You typically use the locator interceptor with a connection cache.
await using var connectionCache = new ConnectionCache();
// You can use the same invocation pipeline for all your proxies.
var locatorProxy = new LocatorProxy(
pipeline,
new Uri("ice://localhost/DemoIceGrid/Locator"));
// If you install the retry interceptor, install it before the locator interceptor.
pipeline = pipeline
.UseRetry()
.UseLocator(locatorProxy)
.Into(connectionCache);
// A call on this proxy will use the locator to find the server address(es) associated
// with `/hello`.
// The locator interceptor caches successful resolutions.
var wellKnownProxy = new HelloProxy(pipeline, new Uri("ice:/hello"));
// The locator also resolves ice proxies with an adapter-id parameter.
var indirectProxy = new HelloProxy(
pipeline,
new Uri("ice:/hello?adapter-id=HelloAdapter"));