Monq.Core.MicroserviceAddressing
0.1.0
dotnet add package Monq.Core.MicroserviceAddressing --version 0.1.0
NuGet\Install-Package Monq.Core.MicroserviceAddressing -Version 0.1.0
<PackageReference Include="Monq.Core.MicroserviceAddressing" Version="0.1.0" />
<PackageVersion Include="Monq.Core.MicroserviceAddressing" Version="0.1.0" />
<PackageReference Include="Monq.Core.MicroserviceAddressing" />
paket add Monq.Core.MicroserviceAddressing --version 0.1.0
#r "nuget: Monq.Core.MicroserviceAddressing, 0.1.0"
#:package Monq.Core.MicroserviceAddressing@0.1.0
#addin nuget:?package=Monq.Core.MicroserviceAddressing&version=0.1.0
#tool nuget:?package=Monq.Core.MicroserviceAddressing&version=0.1.0
Monq.Core.MicroserviceAddressing
Monq.Core.MicroserviceAddressing provides shared address resolution policies for
MONQ microservices. It creates logical addresses and indicates whether a client must
connect directly or enable client-side service discovery. DNS lookup, HTTP endpoint
selection, and gRPC balancing remain the responsibility of the corresponding client
libraries.
Built-in conventions
| Strategy | HTTP | gRPC |
|---|---|---|
| ClusterIP | http://{application}.{namespace}.svc.cluster.local:80 |
http://{application}.{namespace}.svc.cluster.local:5006 |
| Service Discovery | http://{application}-http.{namespace}.svc.cluster.local:5005 |
dns:///{application}-grpc.{namespace}.svc.cluster.local:5006 |
| Fixed | The supplied absolute URI | The supplied absolute URI |
The namespace is derived from IHostEnvironment.EnvironmentName and normalized to
lowercase. Pass a port to override a strategy default.
Registration
The built-in fallback is Kubernetes ClusterIP:
builder.Services.AddMicroserviceAddressing();
HTTP and gRPC can use different policies:
builder.Host
.UseHttpMicroserviceAddressResolver(
new KubernetesClusterIpAddressResolver())
.UseGrpcMicroserviceAddressResolver(
new KubernetesServiceDiscoveryAddressResolver());
Use one common resolver when a library should provide protocol-specific defaults that an application can replace with a single common override:
builder.Host.UseMicroserviceAddressResolver(
new ProtocolMicroserviceAddressResolver(
httpResolver: new KubernetesClusterIpAddressResolver(),
grpcResolver: new KubernetesServiceDiscoveryAddressResolver()));
A library that provides a fallback policy can call TryUseMicroserviceAddressResolver
instead: it selects the default resolver only when none was selected before, so an
earlier application selection is preserved.
Resolve an address from another library or application component:
public sealed class EndpointConsumer(IMicroserviceAddressProvider addresses)
{
public Uri Resolve(string applicationName, int port) =>
addresses.Resolve(
applicationName,
MicroserviceProtocol.Http,
port).Address;
}
Resolver precedence is:
- Resolver supplied for a particular client.
- HTTP or gRPC resolver.
- Default resolver.
- Built-in Kubernetes ClusterIP resolver.
Custom policy
Implement IMicroserviceAddressResolver and replace only the required scope:
public sealed class ProductAddressResolver : IMicroserviceAddressResolver
{
public ResolvedMicroserviceAddress Resolve(MicroserviceAddressContext context)
{
var address = context.Environment.IsDevelopment()
? new Uri(context.Configuration["BaseUri"]!)
: new Uri(
$"http://{context.TargetApplicationName}.custom.svc.cluster.local:{context.PortOverride ?? 80}");
return new(address);
}
}
builder.Host.UseHttpMicroserviceAddressResolver(
new ProductAddressResolver());
The default, HTTP, and gRPC resolvers can be registered as an instance or as a
factory using the final HostBuilderContext. The selected resolver instance is
shared by client registration and the runtime IMicroserviceAddressProvider.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
-
net6.0
-
net7.0
-
net8.0
-
net9.0
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Monq.Core.MicroserviceAddressing:
| Package | Downloads |
|---|---|
|
Monq.Core.HttpClientExtensions
The HTTP client extensions for the microservice communication with openid support. |
|
|
Monq.Core.Authorization
Middleware-библиотека для поддержки авторизации запросов через сервис пользовательских прав MONQ. |
|
|
Monq.Core.GrpcClientExtensions
Shared gRPC client registration on top of Monq.Core.MicroserviceAddressing: name-based addresses, scheme-aware credentials, round-robin balancing and DNS service discovery. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 55 | 10/29/2026 |
| 0.1.0-rev-40878119964 | 37 | 10/29/2026 |