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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Monq.Core.MicroserviceAddressing" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Monq.Core.MicroserviceAddressing" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Monq.Core.MicroserviceAddressing" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Monq.Core.MicroserviceAddressing --version 0.1.0
                    
#r "nuget: Monq.Core.MicroserviceAddressing, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Monq.Core.MicroserviceAddressing@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Monq.Core.MicroserviceAddressing&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Monq.Core.MicroserviceAddressing&version=0.1.0
                    
Install as a Cake Tool

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:

  1. Resolver supplied for a particular client.
  2. HTTP or gRPC resolver.
  3. Default resolver.
  4. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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