ForEach.Routing.Http
0.1.0
dotnet add package ForEach.Routing.Http --version 0.1.0
NuGet\Install-Package ForEach.Routing.Http -Version 0.1.0
<PackageReference Include="ForEach.Routing.Http" Version="0.1.0" />
<PackageVersion Include="ForEach.Routing.Http" Version="0.1.0" />
<PackageReference Include="ForEach.Routing.Http" />
paket add ForEach.Routing.Http --version 0.1.0
#r "nuget: ForEach.Routing.Http, 0.1.0"
#:package ForEach.Routing.Http@0.1.0
#addin nuget:?package=ForEach.Routing.Http&version=0.1.0
#tool nuget:?package=ForEach.Routing.Http&version=0.1.0
ForEach.Routing.Http
The HTTP implementation of IRoutingClient (package ForEach.Routing.Abstractions): a Refit client to a routing host
that serves the wire contract of the abstractions package, with a service token and a resilience pipeline.
services.AddRoutingHttp(options =>
{
options.BaseUrl = "https://routing.example.com";
options.Auth.Authority = "https://auth.example.com";
options.Auth.ClientId = "my-service";
options.Auth.ClientSecret = secret;
options.Auth.Scope = "routing";
});
// ...
RoutingResult<RouteResponseDto> result = await client.GetRouteAsync(request, ct);
| Member | What it does |
|---|---|
AddRoutingHttp |
Registers IRoutingClient (scoped), the token provider and two named HttpClients. Binds nothing: the host sets RoutingHttpOptions in the delegate, from a configuration section or from an IConfigureOptions. Options are read per call, so a changed value needs no restart. |
RoutingHttpOptions |
BaseUrl, AttemptTimeoutSeconds (30), TotalTimeoutSeconds (60), OptimizeTimeoutSeconds (120) and Auth (Authority, ClientId, ClientSecret, Scope). |
- Service token. OAuth client-credentials at
{Auth.Authority}/connect/token, cached until 60 seconds before it expires, one request at a time. A 401 from the routing host drops the cached token. - Resilience. Route, table, nearest, trip, geocode and info are read-only computations, so each is idempotent and may be retried (twice, exponential backoff with jitter): no connection, a timeout, 408, 429, 502 and 504 are retried; 500 and 503 are not. A circuit breaker opens at 90% failures over at least 5 calls. The two calls that hand the host a problem to solve (
OptimizeAsync,StartOptimizationJobAsync) have a pipeline of their own: one attempt withOptimizeTimeoutSeconds, never retried, and a circuit breaker a slow solve cannot open for the others. - Results, not exceptions. 400 is
RoutingFailureKind.Invalidand 404 isNotFound, both with the host's message. 502, 503, 504, 401, 403, no connection, a timeout, an open circuit, no service token and a missing or invalidBaseUrlareUnavailable; 401/403 and the configuration cases are logged as errors, because they are a deployment fault. Anything else isUnexpected. A cancellation by the caller propagates. - Nothing personal in the logs. Requests and answers carry addresses and locations that can be homes: only the call name and the status are logged.
- No kill switch. Whether to call the host at all is the application's decision; the client sends whenever it is called.
Targets net8.0 and net10.0. Dependencies: ForEach.Routing.Abstractions, Microsoft.Extensions.Http, Microsoft.Extensions.Http.Resilience, Refit and Refit.HttpClientFactory.
Source and release notes: https://github.com/foreach-rs/nuget-releases/tree/main/packages/Routing
| 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 was computed. 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
- ForEach.Routing.Abstractions (>= 0.1.0)
- Microsoft.Extensions.Http (>= 10.0.9)
- Microsoft.Extensions.Http.Resilience (>= 10.7.0)
- Refit (>= 13.1.0)
- Refit.HttpClientFactory (>= 13.1.0)
-
net8.0
- ForEach.Routing.Abstractions (>= 0.1.0)
- Microsoft.Extensions.Http (>= 10.0.9)
- Microsoft.Extensions.Http.Resilience (>= 10.7.0)
- Refit (>= 13.1.0)
- Refit.HttpClientFactory (>= 13.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 51 | 11/20/2026 |