HAGI.Robust
1.1.0
dotnet add package HAGI.Robust --version 1.1.0
NuGet\Install-Package HAGI.Robust -Version 1.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="HAGI.Robust" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HAGI.Robust" Version="1.1.0" />
<PackageReference Include="HAGI.Robust" />
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 HAGI.Robust --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HAGI.Robust, 1.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 HAGI.Robust@1.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=HAGI.Robust&version=1.1.0
#tool nuget:?package=HAGI.Robust&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
HAGI.Robust
A shared resilience toolkit for HAGI microservices supporting both web applications and console applications.
Features
- Polly Retry (1-3-9s) + Circuit Breaker
- Timeout policy
- Health and Readiness endpoints (web apps)
- Dependency Waiter (RabbitMQ, Redis, HTTP, TCP)
- ILogger integration
- Standalone mode for console apps
- Integrated mode for web apps
Usage
Standalone Mode (Console Apps)
Simple 3-line integration for console applications:
using Hagi.Robust;
using Hagi.Robust.Probes;
Console.WriteLine("Starting ChatService...");
// Wait for RabbitMQ to be ready
var rabbitProbe = new RabbitMqProbe("rabbitmq", 5672);
await HagiRobust.WaitForDependenciesAsync(new[] { rabbitProbe });
Console.WriteLine("RabbitMQ is ready! Starting service...");
// Continue with your application logic
Available probes:
RabbitMqProbe(host, port)- RabbitMQ connectionRedisProbe(host, port)- Redis connectionHttpProbe(url)- HTTP endpoint availabilityTcpProbe(host, port)- Generic TCP port check
Multiple dependencies:
var probes = new IStartupProbe[]
{
new RabbitMqProbe("rabbitmq", 5672),
new RedisProbe("redis", 6379),
new HttpProbe("http://authservice:8080/health")
};
await HagiRobust.WaitForDependenciesAsync(probes);
Integrated Mode (Web Apps)
Full integration with ASP.NET Core health endpoints:
using Hagi.Robust;
using Hagi.Robust.Probes;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHagiResilience();
builder.Services.AddSingleton<IStartupProbe>(sp => new RabbitMqProbe("rabbitmq", 5672));
var app = builder.Build();
app.MapReadinessEndpoint(); // Creates endpoint at /health/ready
app.Run();
Installation
dotnet add package HAGI.Robust --version 1.1.0
Or from GitHub Packages:
dotnet add package HAGI.Robust --source https://nuget.pkg.github.com/MTBonde/index.json --version 1.1.0
Repository
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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.
-
net9.0
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 9.0.0)
- Microsoft.Extensions.Http.Resilience (>= 9.0.0)
- Polly.Core (>= 8.6.4)
- RabbitMQ.Client (>= 7.0.0)
- StackExchange.Redis (>= 2.8.16)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.