LiteBus
Operations

Operations and Management

Production tier: GA

LiteBus.Extensions.AspNetCore exposes HTTP management endpoints for inbox/outbox processors, retention, and diagnostics. Map routes with AddLiteBusManagementEndpoints() after registering AddLiteBusManagement().

When an axis is not registered on the host (for example inbox-only configuration), requests under that axis prefix return 404 Not Found with an axis-not-configured message instead of 500 Internal Server Error.

Packages to Install

PackageRole
LiteBus.Extensions.AspNetCoreManagement routes, health bridge
Inbox/outbox + storage as requiredProcessor control targets

Registration

builder.Services.AddLiteBusManagement(options =>
{
    options.AuthorizationPolicy = "LiteBusOperator";
    options.FailHealthWhenNoProbes = true;
});

var app = builder.Build();
app.UseAuthentication();
app.UseAuthorization();
app.AddLiteBusManagementEndpoints();
app.Run();

Register authentication before mapping routes. When AllowAnonymousManagement is false (default), unauthenticated callers receive 401 unless you assign AuthorizationPolicy.

Options Reference

PropertyDefaultNotes
AllowAnonymousManagementfalseSet true only for local demos
AuthorizationPolicynullWhen set, applied to all management routes
FailHealthWhenNoProbestrueHealth fails when no IDiagnosticCheck registered
DiagnosticChecks.Timeout5 secondsPer-probe health timeout
DiagnosticChecks.MaxParallelism4Maximum concurrent probes
DefaultDrainTimeout30 secondsDrain timeout when the request omits an override
MaxDrainTimeout5 minutesLargest drain timeout accepted from a request
MaxPageSize100Largest message-query page accepted from a request
MaxBulkMessageIds1,000Largest selective requeue or purge identifier set
RoutePrefixlitebusRoute group prefix

Endpoints (Summary)

MethodRoutePurpose
GET/inbox/messagesQuery inbox rows
DELETE/inbox/messagesPurge with filter; requires confirm body when unrestricted
POST/inbox/processor/drainStop leasing; finish in-flight
POST/inbox/processor/pause / resumeProcessor control
POST/inbox/retention/purgeRun retention cleanup
GET/DELETE/POST/outbox/...Outbox equivalents

Purge Confirmation (v6)

Unrestricted purge (no narrowing query parameters) requires JSON body:

{ "confirm": true }

Requests without confirm: true return 400. Narrow filters (status, age, tenant) may purge without the body when the filter is explicit.

Error Responses

Endpoint failures use application/problem+json with stable type, title, status, and detail values. The traceId extension identifies the request in host logs. Responses never include exception messages from managers, stores, or transport adapters. Invalid input and operator safety rejections return 400; unexpected failures return 500.

Guarantees and Non-Guarantees

GuaranteedNot guaranteed
Drain stops new leases; in-flight work completes per processor optionsInstant process exit without hosted-service stop
Auth enforced when configuredRBAC beyond ASP.NET authentication you configure

Operations

TaskEndpoint / doc
Stuck Processing rowsProduction runbook
Pre-deploy drainPOST .../processor/drain, then stop host
Audit purgeLogged at Information; use confirm body in automation

Tests

ScenarioLocation
Purge without confirm to 400LiteBus.Extensions.AspNetCore.UnitTests
Redacted failure problem with trace identifierLiteBus.Extensions.AspNetCore.UnitTests
Outbox routes when outbox not registered to 404LiteBus.Extensions.AspNetCore.UnitTests
Anonymous to 401LiteBus.Extensions.AspNetCore.IntegrationTests
Manifest probe registrationLiteBus.Extensions.Diagnostics.HealthChecks.IntegrationTests

On this page