Skip to content

Add lightweight health and resilience sample - #13

Merged
balajibashyam merged 4 commits into
mainfrom
feature/health-resilience-shutdown-sample
Aug 3, 2026
Merged

Add lightweight health and resilience sample#13
balajibashyam merged 4 commits into
mainfrom
feature/health-resilience-shutdown-sample

Conversation

@balajibashyam

Copy link
Copy Markdown
Contributor

Summary

Adds a minimal .NET 10 companion sample for the .NET 8 Cloud-Native: Health Probes, Polly Resilience & Zero-Downtime Kubernetes Deployments tutorial.

What's included

  • New sample: cloud-native/health-resilience-zero-downtime — 13 files

    • Tagged liveness and readiness health checks
    • Structured JSON health responses
    • Shutdown readiness draining via ShutdownReadinessService
    • Typed PaymentGatewayClient with Microsoft.Extensions.Http.Resilience 10.8.0
    • HTTP 503 retry (2 retries, jittered exponential backoff)
    • Circuit breaker (3 qualifying 503s opens, 10s break)
    • Attempt timeout (2 seconds)
    • Non-retriable HTTP 400 (1 attempt, no retry)
    • Deterministic in-process SimulatedPaymentHandler
    • 6 integration tests
  • Root README: New sample row + updated cloud-native tree (both siblings)

  • GitHub Actions: New test-health-resilience-shutdown job; path filters updated

Deliberately omitted (stays in the full tutorial)

Databases, queues, migrations, background processing, Docker, Kubernetes, OpenTelemetry, load testing, secrets, production rollout.

Versions

  • .NET SDK: 10.0.302
  • Microsoft.Extensions.Http.Resilience: 10.8.0
  • Microsoft.AspNetCore.Mvc.Testing: 10.0.10
  • Microsoft.NET.Test.Sdk: 18.8.1
  • xunit.v3: 3.2.2
  • xunit.runner.visualstudio: 3.1.5

Validation

  • dotnet restore — passed
  • dotnet build --configuration Release — passed (0 errors, 0 warnings)
  • dotnet test — passed (6/6)
  • Normal health — all 200 OK (structured JSON)
  • Retry success — 3 attempts, 200 OK
  • Non-retriable 400 — 1 attempt, 400 Bad Request
  • Circuit breaker — first: 3 attempts/503, second: 0 attempts/503 circuit open
  • Security scan — clean

@balajibashyam
balajibashyam merged commit 323c44f into main Aug 3, 2026
15 checks passed
@balajibashyam
balajibashyam deleted the feature/health-resilience-shutdown-sample branch August 3, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant