UKBatch.Transport.Http
0.1.4-alpha
See the version list below for details.
dotnet add package UKBatch.Transport.Http --version 0.1.4-alpha
NuGet\Install-Package UKBatch.Transport.Http -Version 0.1.4-alpha
<PackageReference Include="UKBatch.Transport.Http" Version="0.1.4-alpha" />
<PackageVersion Include="UKBatch.Transport.Http" Version="0.1.4-alpha" />
<PackageReference Include="UKBatch.Transport.Http" />
paket add UKBatch.Transport.Http --version 0.1.4-alpha
#r "nuget: UKBatch.Transport.Http, 0.1.4-alpha"
#:package UKBatch.Transport.Http@0.1.4-alpha
#addin nuget:?package=UKBatch.Transport.Http&version=0.1.4-alpha&prerelease
#tool nuget:?package=UKBatch.Transport.Http&version=0.1.4-alpha&prerelease
UKBatch.Transport.Http
A broker-free HTTP transport adapter for UKBatch — a lightweight, pluggable batch/job orchestration library for .NET 8 and .NET 10. It implements ITransport over HMAC-signed REST so a batch can dispatch a step to a different microservice as easily as a local step, with no message broker to run.
Status: part of the UKBatch 0.1.0-alpha package family. Same
JobMessage/JobResultenvelope asUKBatch.Transport.RabbitMQ— a different wire.
Install
dotnet add package UKBatch.Transport.Http
Quick start
Both sides register the transport; the secret and service registry bind from the UKBatch:Transport:Http configuration section.
Orchestrator (sender):
using UKBatch.AspNetCore;
using UKBatch.Transport.Http;
builder.AddUKBatchAspNetCore(b =>
{
b.Configure(o => o.ThisServiceName = "orchestrator");
b.AddBatch("invoice-pipeline", batch => batch
.RunJob<PrepareOrderJob>() // local
.ThenRunJob("InvoiceProcessing", step => step.OnService("billing-worker"))); // remote
});
builder.Services.AddUKBatchHttpTransport(); // binds UKBatch:Transport:Http
Worker (receiver):
builder.AddUKBatchAspNetCore(b =>
{
b.Configure(o => o.ThisServiceName = "billing-worker");
b.AddJob<InvoiceProcessingJob>().Named("InvoiceProcessing");
});
builder.Services.AddUKBatchHttpTransport();
var app = builder.Build();
app.MapUKBatchHttpTransport(); // exposes /ukbatch/internal/jobs/{publish,poll,invoke}
app.Run();
The sender does not reference the worker's job assembly — only the job NAME is shared. The full sample is under samples/Sample.CrossServiceHttp.
Configuration
{
"UKBatch": {
"Transport": {
"Http": {
"SharedSecret": "<32+ bytes — env var / Key Vault in production>",
"Services": {
"billing-worker": { "BaseUrl": "http://billing-worker:5150" }
}
}
}
}
}
SharedSecret is the HMAC key and is required whenever Services is non-empty (the validator enforces this). Receiver-only nodes have no outbound targets and leave Services empty.
HMAC SHA256 auth
Every request carries X-UKBatch-Signature, X-UKBatch-Timestamp, and X-UKBatch-Nonce. The signature is HMAC-SHA256 over a strict canonical envelope (method, canonical path, timestamp, nonce, body hash) that sender and receiver compute identically. Replay is blocked by an LRU nonce cache plus a clock-skew window (MaxClockSkew, default 5 min). Signature mismatch / missing header / nonce replay all return 401 ukbatch:transport-auth-failed (no information leak); clock-skew failures return 401 ukbatch:transport-clock-skew so legitimate NTP drift is diagnosable.
Resilience and limits
Each per-service HttpClient carries one Polly v8 pipeline (via Microsoft.Extensions.Http.Resilience): an outer wall-clock timeout, retry (default [2s, 5s, 15s] + jitter), a circuit breaker (5 failures per 30s → open 30s → half-open probe), and a per-attempt timeout. 4xx does not retry (a caller error wastes the budget); only HttpRequestException, 5xx, 408, and 503 do. Request bodies are capped at MaxBodyBytes (1 MB default) to bound HMAC body-hash CPU cost — keep your worker's Kestrel MaxRequestBodySize at or above it.
Critical notes
- Service identity is required for outbound steps. Set
UKBatchOptions.ThisServiceName(or env varUKBATCH_SERVICE_NAME); a cross-service step without it fails fast at dispatch with an actionable error. - The receiver mount path is fixed at
/ukbatch/internal/jobs/*— not caller-configurable, so service-to-service discovery is unambiguous. Cache-Control: no-storeis set on every receiver response (even on a handler throw) so intermediaries never cache long-poll responses.SharedSecretin plaintextappsettings.jsonis for dev/samples only — source it from an env var or a secret store in production.
When to use it
Choose this transport for cross-service dispatch when you want point-to-point request/reply without standing up a broker. If you need a stopped worker's message to wait durably until it restarts, use UKBatch.Transport.RabbitMQ instead — same envelope, broker-backed.
License
MIT. See LICENSE in the repo root. Full docs: UKBatch on GitHub.
| 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
- Cronos (>= 0.10.0)
- Microsoft.Extensions.Http.Resilience (>= 10.0.0)
- Polly (>= 8.5.0)
- Polly.Extensions (>= 8.5.0)
- UKBatch.Abstractions (>= 0.1.4-alpha)
- UKBatch.Core (>= 0.1.4-alpha)
-
net8.0
- Cronos (>= 0.10.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Http.Resilience (>= 10.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
- Polly (>= 8.5.0)
- Polly.Extensions (>= 8.5.0)
- UKBatch.Abstractions (>= 0.1.4-alpha)
- UKBatch.Core (>= 0.1.4-alpha)
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.2.2-alpha | 57 | 6/18/2026 |
| 0.2.1-alpha | 53 | 6/15/2026 |
| 0.2.0-alpha | 55 | 6/14/2026 |
| 0.1.6-alpha | 53 | 6/13/2026 |
| 0.1.5-alpha | 52 | 6/12/2026 |
| 0.1.4-alpha | 54 | 6/10/2026 |
| 0.1.3-alpha | 54 | 6/8/2026 |
| 0.1.1-alpha | 57 | 6/8/2026 |
| 0.1.0-alpha | 56 | 6/6/2026 |