Kahuna.Aspire.Client
1.15.6
dotnet add package Kahuna.Aspire.Client --version 1.15.6
NuGet\Install-Package Kahuna.Aspire.Client -Version 1.15.6
<PackageReference Include="Kahuna.Aspire.Client" Version="1.15.6" />
<PackageVersion Include="Kahuna.Aspire.Client" Version="1.15.6" />
<PackageReference Include="Kahuna.Aspire.Client" />
paket add Kahuna.Aspire.Client --version 1.15.6
#r "nuget: Kahuna.Aspire.Client, 1.15.6"
#:package Kahuna.Aspire.Client@1.15.6
#addin nuget:?package=Kahuna.Aspire.Client&version=1.15.6
#tool nuget:?package=Kahuna.Aspire.Client&version=1.15.6
Kahuna.Aspire.Client
Registers a Kahuna KahunaClient from a .NET Aspire connection string.
builder.AddKahunaClient("kahuna");
app.MapPost("/orders/{id}", async (string id, KahunaClient kahuna) =>
{
await using KahunaLock orderLock = await kahuna.GetOrCreateLock($"order/{id}", TimeSpan.FromSeconds(10));
// ...
});
The call registers:
- A singleton
KahunaClientfor the endpoints inConnectionStrings:kahuna. - A health check that asks each endpoint for its cluster membership, until one node can serve. With more than one endpoint, each call has a limit of 2 seconds.
- The export of the
Kahuna.Clientspans and theKahuna.ClientandKahuna.Client.Routingmetrics.
Settings bind from the Kahuna:Client configuration section:
{
"Kahuna": {
"Client": {
"DisableHealthChecks": false,
"HealthCheckTimeout": "00:00:05",
"DisableTracing": false,
"DisableMetrics": false
}
}
}
The connection string can name one node (http://localhost:8083), a comma-separated list of nodes,
or use the Endpoints= key. For two clusters, call AddKeyedKahunaClient("name") once for each.
The client sends each request to the next node in turn, also when that node is down, and it does not send
a failed request again. An application that must continue while a node is down needs a time limit and a
retry of its own. See RetryAsync in examples/ClusterExample/ClusterExample.Api/Program.cs.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Kahuna.Client (>= 1.15.6)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.14)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.14)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.14)
- OpenTelemetry.Extensions.Hosting (>= 1.20.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.