Monq.Core.GrpcClientExtensions
0.1.0-rev-41620895905
dotnet add package Monq.Core.GrpcClientExtensions --version 0.1.0-rev-41620895905
NuGet\Install-Package Monq.Core.GrpcClientExtensions -Version 0.1.0-rev-41620895905
<PackageReference Include="Monq.Core.GrpcClientExtensions" Version="0.1.0-rev-41620895905" />
<PackageVersion Include="Monq.Core.GrpcClientExtensions" Version="0.1.0-rev-41620895905" />
<PackageReference Include="Monq.Core.GrpcClientExtensions" />
paket add Monq.Core.GrpcClientExtensions --version 0.1.0-rev-41620895905
#r "nuget: Monq.Core.GrpcClientExtensions, 0.1.0-rev-41620895905"
#:package Monq.Core.GrpcClientExtensions@0.1.0-rev-41620895905
#addin nuget:?package=Monq.Core.GrpcClientExtensions&version=0.1.0-rev-41620895905&prerelease
#tool nuget:?package=Monq.Core.GrpcClientExtensions&version=0.1.0-rev-41620895905&prerelease
Monq.Core.GrpcClientExtensions
Monq.Core.GrpcClientExtensions registers gRPC clients that resolve their addresses through
Monq.Core.MicroserviceAddressing. It is the gRPC counterpart of Monq.Core.HttpClientExtensions
for the HTTP side and centralizes the transport rules that every MONQ service otherwise had to
duplicate:
- scheme-aware channel credentials — grpc-dotnet requires explicit credentials for any address
scheme other than
http/https(dns:///from Service Discovery, but alsoipv4:///,unix:/and custom resolver schemes), so non-http addresses getChannelCredentials.Insecure; - round-robin balancing — enabled for load-balanced addresses per the addressing contract
(resolution mode
ServiceDiscoveryor thednsscheme); Direct (ClusterIP) addresses keep kube-proxy balancing; to keeppick_firston a manualdns:///address, clear the service config afterwards:.ConfigureChannel(o => o.ServiceConfig = null); - client-side service discovery — a DNS resolver with a configurable refresh interval shared by all clients;
- static authorization fallback for background/console clients — the incoming
Authorizationheader is forwarded, and when no HTTP context is present a token is obtained throughMonq.Core.HttpClientExtensions.RestHttpClient.
Quick start
Name-based registration requires AddMicroserviceAddressing() on the host; when it is missing,
the first client creation throws with a message naming the fix. Fixed-address overloads work
without it.
builder.Services.AddMicroserviceAddressing();
builder.Host.UseGrpcMicroserviceAddressResolver(new KubernetesServiceDiscoveryAddressResolver());
// Address resolved by application name on the first client creation.
builder.Services.AddMicroserviceGrpcClient<SampleService.SampleServiceClient>("sample-api-service");
// Named registration for several clients of the same type.
builder.Services.AddMicroserviceGrpcClient<SampleService.SampleServiceClient>(
name: "secondary",
applicationName: "sample-api-service",
port: 5006,
addressResolver: new FixedMicroserviceAddressResolver(new Uri("http://localhost:5006")));
// Settings resolved lazily — for composed libraries.
builder.Services.AddMicroserviceGrpcClient<SampleService.SampleServiceClient>(
"sample",
provider => new GrpcClientAddressSettings("sample-api-service", 5006));
// Fixed address for local debugging.
builder.Services.AddMicroserviceGrpcClient<SampleService.SampleServiceClient>(
new Uri("http://localhost:5006"));
// Additional client/channel configuration via the options object.
builder.Services.AddMicroserviceGrpcClient<SampleService.SampleServiceClient>(
"sample-api-service",
options: new GrpcClientOptions
{
ChannelOptionsAction = channelOptions => channelOptions.MaxReceiveMessageSize = null,
});
Background and console clients use the console variants and receive call credentials with static token fallback:
builder.Services.AddMicroserviceGrpcConsoleClient<SampleService.SampleServiceClient>(
"sample-api-service");
Service discovery options
builder.Services.ConfigureGrpcServiceDiscovery(options =>
options.DnsRefreshInterval = TimeSpan.FromSeconds(15));
Behavior summary
| Address | Credentials | Load balancing |
|---|---|---|
http/https (Direct, ClusterIP) |
inferred from scheme | kube-proxy (no service config) |
dns:/// (Service Discovery mode, headless Service) |
Insecure |
round-robin over resolved pods |
ipv4:///, unix:/, custom schemes |
Insecure |
per resolver semantics |
Fixed URI (Uri overloads) |
scheme-aware | round-robin only for the dns scheme |
Every registered client also receives the MONQ defaults:
- propagation of the
X-Smon-Userspace-IdandAccept-Languageheaders from the current HTTP request to the outgoing gRPC metadata (HeaderPropagationInterceptor); MaxReceiveMessageSize= 51 MB andUnsafeUseInsecureChannelCallCredentials=true;- call context (event id) propagation (
EnableCallContextPropagation); Authorizationforwarding from the current HTTP request — interactive clients forward it as is, console clients additionally fall back to a static token viaRestHttpClient.
Defaults are applied before the actions of GrpcClientOptions, so each default can be overridden
per client.
Roadmap
MONQ service frameworks move their gRPC registration internals onto this package without changing their public APIs; composed server libraries are expected to use it directly.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Grpc.AspNetCore.Server.ClientFactory (>= 2.83.0)
- Monq.Core.HttpClientExtensions (>= 8.0.0-rev-41050814772)
- Monq.Core.MicroserviceAddressing (>= 0.1.0)
-
net8.0
- Grpc.AspNetCore.Server.ClientFactory (>= 2.83.0)
- Monq.Core.HttpClientExtensions (>= 8.0.0-rev-41050814772)
- Monq.Core.MicroserviceAddressing (>= 0.1.0)
-
net9.0
- Grpc.AspNetCore.Server.ClientFactory (>= 2.83.0)
- Monq.Core.HttpClientExtensions (>= 8.0.0-rev-41050814772)
- Monq.Core.MicroserviceAddressing (>= 0.1.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Monq.Core.GrpcClientExtensions:
| Package | Downloads |
|---|---|
|
Monq.Core.BasicDotNetMicroservice
NetCore Microservice extensions library that brings simplicity to configure asp.net and console programs as microservices. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-rev-41620895905 | 47 | 11/3/2026 |
| 0.1.0-rev-41608146486 | 44 | 11/3/2026 |
| 0.1.0-rev-41121789246 | 67 | 10/30/2026 |
| 0.1.0-rev-41116107820 | 65 | 10/30/2026 |